Skip to content

Feature/cards decks foundation#31

Open
KellyBallinger05 wants to merge 3 commits intomainfrom
feature/cards-decks-foundation
Open

Feature/cards decks foundation#31
KellyBallinger05 wants to merge 3 commits intomainfrom
feature/cards-decks-foundation

Conversation

@KellyBallinger05
Copy link
Copy Markdown
Owner

Summary

Bundles the initial Cards + Decks foundation work:

  • Card detail + edit flow in Studio
  • Deck creation + deck list page
  • Minimal deck builder (add/remove cards)
  • Deck-size rules stored on the Game record + basic deck size feedback

What’s Included

Cards

  • /studio/cards/[id] card detail page
  • /studio/cards/[id]/edit card edit page + server action validation + redirect

Decks

  • /studio/decks decks index page (list decks)
  • /studio/decks/new create deck page + server action
  • /studio/decks/[id] minimal deck builder (add/remove cards via deck_cards)

Rules / DB

  • games.min_deck_size + games.max_deck_size (backend source of truth)
  • RLS policies for decks and deck_cards (ownership enforced via parent game/deck)

How to Test

  1. Cards:
    • Navigate to /studio/cards/<id> and /studio/cards/<id>/edit
    • Edit fields and confirm save redirects back with ?updated=1
  2. Deck creation:
    • Go to /studio/decks/new
    • Select a game, create deck, confirm redirect shows success
  3. Builder:
    • From /studio/decks, open a deck builder
    • Add/remove cards and confirm deck_cards updates + builder view updates

Known Issue

  • Deck count on /studio/decks can appear stale after navigating back from the builder due to client-side caching/prefetch. Data is correct in DB and builder view; UI refresh behavior will be addressed in a follow-up PR. Still trying to figure this out.
image image image

@KellyBallinger05
Copy link
Copy Markdown
Owner Author

Resolved the merge conflict in studio/decks/page.tsx again, same situation as the other PR. Kept the decks list with card counts and size validation. The DeckBuilderClient component is still in components/DeckBuilderClient.tsx, just not being used / wired up together yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant