Eop card browser/refactor mentor followups - #3331
Conversation
|
I want to note that for refactoring: I used |
|
Yes, sure |
just confirming, you're good with one shared rank map, right? |
| /** | ||
| * Full edition name, used in card detail page titles and social meta tags in <svelte:head>. | ||
| */ | ||
| export const EDITION_FULL_NAMES: Record<string, string> = { |
There was a problem hiding this comment.
This can be moved to yaml
There was a problem hiding this comment.
Pull request overview
This PR refactors how edition display names are produced for card-detail pages and simplifies card loading for the /cards index and /cards/[card] routes by relying on DeckService.getCards().
Changes:
- Replaces repeated
getEdition()logic in multiple Svelte pages with a sharedEDITION_FULL_NAMESmap. - Updates card page
<svelte:head>title/social tags to use the shared full edition name. - Refactors
/cardsand/cards/[card]server loads to usedeckService.getCards(lang)instead of manually merging per-edition maps.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cornucopia.owasp.org/src/routes/edition/[edition]/[card]/+page.svelte | Uses shared EDITION_FULL_NAMES for head title/meta instead of a local helper. |
| cornucopia.owasp.org/src/routes/edition/[edition]/[card]/[version]/+page.svelte | Same shared edition-name refactor for version-scoped card route. |
| cornucopia.owasp.org/src/routes/edition/[edition]/[card]/[version]/[lang]/+page.svelte | Same shared edition-name refactor for lang-scoped card route. |
| cornucopia.owasp.org/src/routes/cards/+page.server.ts | Simplifies deck assembly by using DeckService.getCards(lang). |
| cornucopia.owasp.org/src/routes/cards/[card]/+page.svelte | Uses shared EDITION_FULL_NAMES for head title/meta instead of a local helper. |
| cornucopia.owasp.org/src/routes/cards/[card]/+page.server.ts | Loads cards via DeckService.getCards(lang) and builds decks from that result. |
| cornucopia.owasp.org/src/lib/services/deckServiceConsts.ts | Introduces EDITION_FULL_NAMES constants for consistent full edition display names. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
Draft. Applying mentor follow-ups across Eop Card browser project PRs
Done:
Current task:
Resolved or fixed issue: related to #1322
AI Tool Disclosure
[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.][e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.][Summarize the key prompts or instructions given to the AI tools]Affirmation