Loading…
Reference in a new issue
No description provided.
Delete branch "build/lane5-p2-cards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is the server half of lane 5's board: two PRs in one, because PR 2 builds on PR 1's migration. No pages; page PR 4a builds on this.
PR 1: scenes (migration
b2c4d6e8f0a1)scenesis its own table./api/campaigns/{id}/scenes. A 409 carries the existingscene.scene_id, and a card'sPATCHtakesscene_id(an explicit null unfiles).{scene: "name"}finds or creates the scene.PR 2: the cards (migration
c3d5e7f9a1b2)reconcile_pinsmade it again within 20 seconds; the sweep's "Let it go" did the same. Removal is now a soft delete (removed_at) that the pin respects.POST …/shelf/{card}/restoreis D12's undo.card_kind: rule,reference_entry_id). Access is limited to the instance's packs and this campaign's own.scene_idwhen a card is added.Tests:
test_scenes.py,test_scenes_migration.py,test_shelf_removal.py,test_shelf_card_kinds.pyandtest_shelf_cards_migration.py.Known gap: a pack re-import unlinks rule cards (
reference_entry_id→ NULL). The snapshot keepspack_idandslugfor a later re-link.🤖 Generated with Claude Code
A scene was a free-text tag on each shelf card. It is now a row of the campaign (migration b2c4d6e8f0a1): made once, files cards on every session, can be empty, renamed in one place, and deleted with an undo (a card in a deleted scene reads as Unfiled and keeps its pointer). Names are unique among a campaign's live scenes ignoring case and spacing, by one SQL expression shared by the index, the service and the migration. - GET|POST /api/campaigns/{id}/scenes (?session_id= for tonight's counts), PATCH|DELETE .../scenes/{sid}, POST .../scenes/{sid}/restore; a taken name is a 409 carrying the scene that has it. - PATCH /api/sessions/{id}/shelf/{card} takes scene_id (explicit null unfiles); ShelfCardOut gains scene_id. {scene: name} still works for the current page (find-or-create by name). - Pins carry a scene_id, follow the GM's latest filing while open, and file the cards they materialise; copy-from keeps the scene. - The migration merges each campaign's names ignoring case and spacing (D114), files cards and pins, and leaves shelf_cards.scene frozen (no longer mapped); the downgrade writes the filing back as names. - No Foundry pairing column (D113). The demo seed files its cards in scene rows. The one-head pin moves to test_scenes_migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>A carried card taken off the shelf came back within 20 seconds: DELETE hard-deleted it and the next GET /shelf let its pin make it again (the sweep's "Let it go" too). Taking a card off is now a soft delete (shelf_cards.removed_at) that reconcile_pins counts as the pin's card, with an undo (D12). - DELETE /api/sessions/{id}/shelf/{card} keeps the card; a second DELETE is a no-op. POST .../shelf/{card}/restore is the undo and returns the card as it was (place, notes, scene, player text, pin, reveal). A removed card is a 404 to PATCH, pin, unpin, reveal and promote, and is left out of tonight's scene counts, This week's prep count, the cold open's carried count and the harvest; copy-from neither copies one nor puts one back. Re-adding a removed wiki entry or rule brings the same card back. Reveals keep naming the card. - Rule cards (IS-177): card_kind "rule" + reference_entry_id, checked as GET /reference/{id} checks it and narrowed to the instance's packs and this campaign's own. One per session, carried by pins, copied; no server-derived player text. The snapshot keeps pack_id + slug to find the record after a re-import. - Note cards (D119, IS-439): title and text on add and on PATCH (notes only); the text is the snapshot's summary. - POST /shelf takes scene_id, filing the new card as it is added. - Wiki cards' snapshots carry pronouns and the stats envelope (IS-235), live. - Migration c3d5e7f9a1b2 (down b2c4d6e8f0a1): the kind CHECK on cards and pins, reference_entry_id on both (SET NULL, indexed), one card per record per session, removed_at. The downgrade turns rule cards into notes and deletes removed cards. The one-head pin moves to test_shelf_cards_migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>