Repository navigation
fix(app-shell): a Studio pillar never accepts an edit or a save on a buffer that is not the open item's (objectui#11272) - #11296
Conversation
…ed for (red first) Six sequences through the real pillars, each red at the branch point: the load window on the page inspector, the Automations enable switch and Data's add-field; Automations and Data across a package switch; and the page inspector's non-editable round trip. Each ends on the control, an edit after the load that saves once to its own item. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
…buffer that is not the open item's
`useDraftAutoSave` takes `loadedFor`, the item whose document the buffer
holds, set by each caller where its load installs a buffer. Until it is
the target, the timer and `flush` send nothing, `sending` gives no claim
(the Automations enable switch and the Data column reorder ask it first),
and `loaded` is false: the pillars show and offer nothing of the buffer
under the open item (the page form, the enable switch, add-field and the
Data views wait for the item's own document).
The page inspector's non-editable branch stamps its `{}` as that leaf's
and clears the dirty flag, so reopening a page no longer sends `{}` as
its draft. The Data pillar's load clears the dirty flag as it installs.
Data and Automations are keyed by package at their mount site, as
Interfaces is, so a package switch no longer keeps the open item.
Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
…aded item Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
…re what was shown What a pillar showed during the held load is recorded there and asserted last, so an ablation of the UI half reads through to the post-load and control readings instead of stopping at the first UI fact. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: ① Derived judgmentsInputs: card #11272 (body; triage Accept sets and public surface: none move. (a) One rule, read at source. The hook's single check (b) The three members and their pins.
(c) The deviations.
② Semver levelOne changeset, ③ Boundary flags
Implemented-by: VERDICT: PASS |
Fixes #11272
Clause-②: no
Implemented on
claude/issue-11272-buffer-bound-to-loaded-item, dispatched by thedomain:uiseat 1 PM loop, sessionhttps://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ. Triage5920456880is the ruling executed; claim5921156111.What changed
One rule: a pillar's buffer is bound to the item it was loaded for. It lives once, in
useDraftAutoSave, beside the dirty period'ssinceandtargetfrom PR objectui#11265.useDraftAutoSavesince/target)loadedFor, the item whose document the buffer holds, intarget's spelling. The one check,owned(), now also requiresloadedFor === target. The timer,flushandsendingall read it.sendingreturns no claim (null) when the buffer is not the open item's, and the hook returnsloaded(the same comparison) for renderingleafKeyOf), the Interfaces nav (app:NAME), Data (object:NAME) and Automations (flow:NAME)sendingfirst and send nothing without a claim. Add-field is an edit, so the autosave's timer covers it; it also refuses on!loadedif (!current || !isEditable)){}and left the dirty flag up{}as that leaf's buffer and clears the dirty flagStudioDesignSurfacerendersDataPillar/AutomationsPillarkey={packageId}, theInterfacesPillarshapeZone 2, measured
b4333ab8a3, through the real pillars with the new item's load held. Each pin's first save reading is red with the card's exact write:landingcarryinghome's document (name: home, the hello block) with label 'Typed during load';nightly_digestcarryingnotify_owner's document with status 'obsolete';acme_notecarryingacme_task's document (label 'Task', fieldstitle,status,field_3).PackageSwitcher(the route keeps the surface mounted across:packageId).notify_ownerwithpackageIdcom.beta.app.acme_taskwithpackageIdcom.beta.app.flow:NAMEdoes not change on a package switch, and the item's load (keyed oncurrent) does not re-run.home, open anobjectleaf, reopenhomewith its reload held. The result is 1 save of pagehomewith body{}. Whether the server refuses an empty page body is NOT MEASURED: the harness double accepts it, and no backend was run. The hook's comment is corrected, as in the table.owned()is the single check for the timer,flushand every save a caller sends itself (throughsending).loadedis the same comparison, read at render. No pillar carries its own variant; each pillar only says where its load installs a buffer.loading). But the rail kept the page form overhome's document ('Home') and the badge, and took edits.notify_owner's status.loading; eslint reports that state as "assigned a value but never used" at the base. The header showedacme_task's field count underacme_note, add-field was offered, and the views renderedacme_task's buffer.Pins
They are added to the objectui#11232 pin file,
StudioDesignSurface.autosaveSwitch-11232.test.tsx, beside its pins and on its harness: the real pillars, the real registered flow and page previews and inspectors, and a server double that records every save and can hold a load.{}is sent; the edit after the reload saveshome's own document once.One objectui#11232 pin is adapted, and why. In "a save in flight across a page switch", the middle step typed into
home's page form while it was shown underlandingduringlanding's held load. Triage's ruling removes that form ("Nothing is shown under the new item until its own document is in"). So the step now uses whatever the rail offers, and the pin asserts last that nothing was offered. Its save readings are unchanged. Consequence: PR objectui#11265's leg C (the claim's target comparison removed) no longer turns that pin red. See leg C below; the comparison itself is kept, as settled behaviour. No other existing pin is modified.Ablations (each on a committed head; mutation and restore proven on disk)
Every leg went through objectstack's
scripts/ablation-replace.mjsin WRAP mode. Each mutation's anchor count fell by one and its blob moved. Each restore was proven with blob == HEAD24700a93d71dandgit diff HEADempty. A two-mutation leg nests two WRAPs. The pins import the pillar source by a relative path, so there is nodist/leg. The source blob is the same at99b9420504andf5af9cb962.f5af9cb962only moves each load-window pin's UI facts to the end. The package-switch and round-trip pins are byte-identical between the two heads.c1df814853over the branch-point sourcef5af9cb962)loadedforcedtrue(UI half off, refusal kept)f5af9cb962)owned()without itsloadedForcomparisonsinceholds its savesf5af9cb962)owned()without itsloadedForcomparison, UI keptf5af9cb962)acme_note's own served document, unedited; the other three as in U99b9420504)key={packageId}removed from Data and Automations99b9420504)homewith body{}99b9420504)f5af9cb962)loadedForalso refuses theref5af9cb962)Two attempts did not run, and their readings are void. K's first attempt was refused by the tool: the replacement was a substring of its anchor, so its count could not rise. UD's first attempt missed its anchor, because the shell quoting left a backslash-n literal. Both were rerun with corrected strings: the K and UD rows above.
Tests and gates
Pass counts are read from vitest's own summary lines. Heavy runs went through the shared verify lock.
turbo run build --filter='@object-ui/app-shell^...' --concurrency=2, 28 of 28 tasks, exit 0, at99b9420504. The diff touches no package in that closure.pnpm --filter @object-ui/app-shell type-check(tsc --noEmit && tsc -p tsconfig.test.json): exit 0 atf5af9cb962.tsc -p tsconfig.test.json --listFilesOnlylists the pin file once.f5af9cb962.packages/app-shell/src/views/studio-design/, every test file (82; thegit ls-fileslisting and the tree agree), in three chunks atf5af9cb962: 29 files / 137 tests, 25 / 137, 28 / 207. That is 82 files / 481 tests passed, 0 failed.git grep -lfinds namingStudioDesignSurface,useDraftAutoSaveor a pillar: 21 files / 326 tests passed atf5af9cb962. They includeStudioRoute.test.tsx,StudioRoute.landingI18n.test.tsxandstudio-locale.i18n.test.tsx.StudioDesignSurface.tsxhas 17 warnings. The base version has one more, the Data pillar's never-readloading, which is now read. The pin file has none. No type-aware lint is configured, so the diff cannot move another file's verdict.f5af9cb962:check:metadata-write-doors,check:new-line-citations(0 new),check-changeset-presence,changeset:check,check:control-bytes;check:changeset-claims: one pending changeset names this file,6681-declared-lazy-marketplace-routes.md. Read: its static-import claim aboutSuggestedBindingsPanelstill holds, and no import line moved;check:pending-changeset-literals,check:test-path-roots,check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:i18n-keys;check-governed-queue-guard --test: NOT GOVERNED, 3 paths.mainmoved six commits past the branch point; none touchesstudio-design/.pnpm lint, e2e) and a browser run.Acceptance notes
loadedForrefuses too (legs C and UC). It is kept as settled behaviour.Generated by Claude Code