The shelf: two of the same creature as two cards ("Add another") #1321

Closed
opened 2026-11-02 22:39:28 +00:00 by claude-bot · 1 comment
Collaborator

The owner answered Q209 (SB5) on 2 Nov with option (a). Recorded as D318.

Why. Several of the same monster is the commonest encounter there is. Each card already keeps its own HP (D207), but uq_shelf_cards_session_reference allows only one card per rules entry per session. Once a creature is on the shelf, the preview says "On the shelf" instead of "Add to the shelf", so three goblins can only be one card.

What (D318):

  • When a rules entry is already on the shelf, the preview offers "Add another" beside the "On the shelf" chip.
  • Each copy is its own card, numbered "Goblin 2", "Goblin 3"…, with its own HP. The first stays "Goblin".
  • Database: replace the unique index with a copy number. Copies are unique per (session, reference_entry_id, copy_number). A migration backfills 1 for existing cards and has a real downgrade.
  • Carry-forward: decide and test what a copy does at carry-forward. Recommended: a pin carries one card, the first, as today, and copies stay with their session.
  • "Add to the shelf" without "another" keeps today's behaviour: it returns the card that's already there.
  • Tests: the copy numbers, HP kept per copy, the downgrade, carry-forward with copies, and Find's and Preview's flows.

Comes after #1243's slice 3 (Find browses), in 4.7.0.

The owner answered Q209 (SB5) on 2 Nov with option (a). Recorded as D318. **Why.** Several of the same monster is the commonest encounter there is. Each card already keeps its own HP (D207), but `uq_shelf_cards_session_reference` allows only one card per rules entry per session. Once a creature is on the shelf, the preview says "On the shelf" instead of "Add to the shelf", so three goblins can only be one card. **What (D318):** - When a rules entry is already on the shelf, the preview offers **"Add another"** beside the "On the shelf" chip. - Each copy is its own card, numbered "Goblin 2", "Goblin 3"…, with its own HP. The first stays "Goblin". - **Database:** replace the unique index with a copy number. Copies are unique per (session, reference_entry_id, copy_number). A migration backfills 1 for existing cards and has a real downgrade. - **Carry-forward:** decide and test what a copy does at carry-forward. Recommended: a pin carries one card, the first, as today, and copies stay with their session. - **"Add to the shelf"** without "another" keeps today's behaviour: it returns the card that's already there. - Tests: the copy numbers, HP kept per copy, the downgrade, carry-forward with copies, and Find's and Preview's flows. Comes after #1243's slice 3 (Find browses), in 4.7.0.
Author
Collaborator

Done: merged in #1323 (D318).

  • Migration d1321c0e5a7b adds shelf_cards.copy_number, and the unique index now includes it.
  • POST /api/sessions/{id}/shelf with another: true adds the next copy. Each card carries copy_number, and rule cards also carry copies.
  • The table names copies "Goblin 2", "Goblin 3" everywhere a card's name shows. The preview keeps "On the shelf" and adds "Add another", which announces "Goblin 2 added to the shelf." Wording r-001 to r-003 was approved.
  • Carry-forward uses the lowest copy number, so a pin carries one card forward.
  • Render check: three copies, each with its own HP; showing copy 3 names it "Goblin Warrior 3" throughout. axe found no violations and the console had no errors. CI passed twice, the second time after updating from main.

Not covered, as before: exporting and re-importing a campaign doesn't keep copies, and copying a shelf from another session carries one card per creature.

**Done:** merged in #1323 (D318). - Migration `d1321c0e5a7b` adds `shelf_cards.copy_number`, and the unique index now includes it. - `POST /api/sessions/{id}/shelf` with `another: true` adds the next copy. Each card carries `copy_number`, and rule cards also carry `copies`. - The table names copies "Goblin 2", "Goblin 3" everywhere a card's name shows. The preview keeps "On the shelf" and adds "Add another", which announces "Goblin 2 added to the shelf." Wording r-001 to r-003 was approved. - Carry-forward uses the lowest copy number, so a pin carries one card forward. - Render check: three copies, each with its own HP; showing copy 3 names it "Goblin Warrior 3" throughout. axe found no violations and the console had no errors. CI passed twice, the second time after updating from main. **Not covered, as before:** exporting and re-importing a campaign doesn't keep copies, and copying a shelf from another session carries one card per creature.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#1321
No description provided.