Repository navigation
C2: strategy rename and the all-pages controls through the store - #1023
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… rename is one strategy patch, the side of every page and neutral team colours are one commit over the other pages, each read as the store draws it; the title follows the store's name; a page that has not loaded or cannot be read is named with the way out
…ttings with its button
…rategy says so; every-page taps check every page after the commit and retry once; the title is the store's when the open completes; every-page faces speak of the other pages; the side button switches every page on a store-owned strategy too
…, and requires each in the store, on the server and on screen
f1c29c3 to
929a905
Compare
On a store-owned cloud strategy, the strategy's name, the shortcut that switches the side of every page, and the neutral team colours toggle work again. Each one saves on this computer at once, and the store sends it to the server. Before this PR, all three were switched off for a store-owned strategy.
Part of #615. This is the last part of C2, after #1009 (pages) and #1012 (map and theme). The scope is #1002 and the lead's ruling of 2026-11-30.
Seen in the app
Two accounts on the
storerunspreview,--library-store store --cloud-store own, Linux driver build of eb7504d (this head's code; the second commit changes only the scripts). Pair run 3: owner 90 steps, teammate 52, both clean. Offline run 2: owner 89 steps, teammate 40, both clean.Rename, each way. The owner renames the strategy from the title, and the teammate's title follows. Then the teammate renames it, and the owner's title follows. Each step checks the store, a fresh server read and the title.
Every page's side, and neutral colours. The owner presses F (side of every page), then turns on neutral team colours in Settings.
storeExpectEveryPagechecks all three pages in the store and on the server, plus the canvas, on both sides.A teammate's change racing mine. The owner's sender is held. The teammate renames page 2. The owner switches every side again. When the sender is let go:
revision_mismatch);Taking the cloud's version settles it, and both sides end on the teammate's page name.
Offline (through
linux-cut-network.sh). Before the cut, the teammate adds, renames and deletes a page the owner never opens. Cut off, the owner:Once the network is back:
What each control writes
All three use #1009's turn in
StorePageStructure:StoreOwnership.inTurn, onereadStrategyused asseen, onecommitEachAs, and one retry onrevisionMismatch. They use no marks. Each is a discrete tap, not canvas state compared at a handover.StrategyPatchOp{name}PagePatchOp{isAttack}per other live page whose side differs, all in one commitPageSettingsPatchOpper other live page whose setting differs, all in one commit; the page's other settings are kept, unknown fields includedreadPage, as the store draws itThe page on screen still goes through its canvas handover, as on main. That makes it and the batch two writes.
Neutral colours read each page with
readPage.readStrategydraws no page content, so its settings rows leave out this computer's unsent settings edits. A first version built on them, and a test caught it overwriting an unsent marker size on another page. The test "neutral colours turned on for every page while offline keep the marker size …" now pins this.The title follows the store. While the strategy is store-owned,
state.strategyNamefollows the name in the drawn snapshot header, which is the store's row. So a teammate's rename, a refusal, a hold and the reopened store after a doubt all show what the store holds. A written rename sets the title on the same frame.Results, sealed (the lead's conditions)
PageChangeStoppedis a sealed subset ofPageChange: refused, blocked, not saved, in doubt, not owned, not made. The turn returns either the per-change answers or a stop. For the all-pages controls,EveryPageChange = EveryPageSaved(held pages with reasons, missed pages) | EveryPageNotChanged(stop). Every switch on these is exhaustive, with no default arm.EveryPagePartlyHeldFacenames the held pages ("A teammate changed 'Page 2' first… The other pages have your change"). The redraw takes the store's rows, which leave out only held work.ChangeHeldForUserarm.PageBlock.notLoaded: "'{page}' hasn't loaded on this computer yet, so the other pages weren't changed. Open it while you're online, then try again." This covers the store's ownSettingsNeedContent, and a page whose settings the store has no row for.PageBlock.unreadable: "'{page}' holds settings this version of Icarus can't read, so the other pages weren't changed. Update Icarus, then try again."faceOfHeld.Cost per tap
For merge: no network in any tap's path. The title and the toggle change on the tap's own frame.
readStrategyreadStrategy(the one the commit names as seen, and the check after it)readStrategy+ 2readPageper other live page (to build, and to check after)The page on screen costs its usual handover. A
revisionMismatch, or a page that is still wrong after the check, repeats the reads and the commit once. The lands tests assert the commits each tap makes with the sender offline: 1 for a rename, 2 for each all-pages tap (the handover and the batch).Tests
In
store_canvas_commit_test.dart, group "the name and every page of a store-owned strategy". Each test was run on main (863ea63) with the same test code. The only edit for main was that the two refusal tests match any face, becauseEveryPageBlockedFacedoesn't exist there.B split(main sendsstrategies:updateover the network)B splitfalseStoreMatchesServer), because page 2 was never sentNull check operator)falseChanged with the lead's OK:
store_owned_open_test: the name and every-page controls are on.expectStoreEditablenow requires both controls on.Proof
store_canvas_commit_test.dartandstore_owned_open_test.dart, 120 tests, all pass.flutter analyzeon every changed Dart file, tests included: no issues.node tool/comments.mjs check: passes.storeExpectStrategyName, andstoreExpectEveryPage(side and/or neutral colours, in the store, on the server and on the canvas).store-strategy-owner/mate.json, andstore-strategy-offline(-mate).json.Parked for Dara
Not covered
cloud-store-own-open.jsonis stale since Page add, duplicate, delete, rename, reorder and restore commit to the store in a store-owned strategy #1009. It still presses the page controls and expects the server unchanged. This PR doesn't touch it; it gets its own fix.Sol's read of f1c29c3, as the lead ruled
Each was run on f1c29c3 with this head's test code first.
StoreOwnership.turnsDone) before it judges what is unsaved, as it already hands the canvas over first. This covers every tap that goes through the turn: #1009's page add, delete, rename, reorder and restore, and the controls here. APageChangeNotOwnedthat still reaches the editor now says "You left the strategy before your change was saved, so it wasn't saved."Expected: null, Actual: true); both store tests: no face (Expected: ['LeftBeforeSavedFace'], Actual: [])EveryPageSaved.missednames it ("{pages} changed while your change was being saved…").EveryPageSaved.savedis gone.Expected: false, Actual: true(side);Expected: true, Actual: false(neutral)Expected: 'Their name', Actual: 'B split'Expected: ['OtherPagesNotSavedFace'], Actual: ['PageChangeNotSavedFace']Expected: [true], Actual: [false]The two race tests for finding 2 were reworked: the first versions passed on f1c29c3, because the store runs its reads and writes strictly in order. They now park a store write so the batch's read comes first, then queue the teammate's change before the batch's commit, and they fail on f1c29c3 as shown.
Sol's test gaps:
cloud-store-own-open.json(after #1024): its strategy-wide section now renames from the title, presses F and turns on neutral colours, and requires each one in the store, on the server and on screen. Run on this head: 160 steps, clean.Driver on 929a905: pair run 4 (owner 90 steps, teammate 52), offline run 3 (owner 89, teammate 40), own-open run 1 (160): all clean.
ci: analyze test web desktop