Repository navigation
fix(app-shell): a dashboard draft the server refuses to read stays unopened in Studio Interfaces, whatever order the designers load in - #29922
Merged
Conversation
…gistration and a same-leaf reload Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jQx7EwgLR5PQRL3zQp
…ed buffer back in Studio Interfaces Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jQx7EwgLR5PQRL3zQp
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-03T13:04ZHead-sha:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steedos · project thread
Fixes #29884
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6600806534).
维护者速读
StudioDesignSurface.tsx叶子加载里'refused' in draftRead分支新增的五行;新测试 describe(StudioDesignSurface.draftUnreadable-29015.test.tsx末尾)。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.draftUnreadable-29015.test.tsx,预期 6 个用例全部通过。What changes
isEditable = !!Preview && !StudioCanvasis false). That render takes the no-designer arm of the leaf load, which installs the leaf's clean{}buffer and stamps it as the leaf's (setDraftFor(leafKey), objectui#11272). When the preview registers, the load runs again and reads the draft. On a 403 its refused branch (added by fix(app-shell): Studio opens no buffer over a dashboard draft the server refuses to read #29132) only set the strip's error and returned, so the stamp stayed. TouseDraftAutoSavea stamped buffer is a loaded one, so the canvas, the Properties inspector and the item tools (Source) opened on{}, and the autosave was live with no version pin. A reload of a leaf whose earlier read was answered (a publish, a rollback) kept its loaded buffer the same way.setDraft({}),setDraftFor(''),forgetLeafVersion(), the read address cleared,setIfDirty(false). The object (setObjDraftFor('')), flow (setDraftFor('')) and app nav (setAppDraftFor('')) refused branches already do this.{}buffer. While!isEditable, the autosave is blocked (blocked: !current || !isEditable || …) and the inspector needsisEditable, so the arm sends nothing by itself. The hole was only the refusal keeping its stamp.if (!current) return), and their refused branches, like the app nav's, already clear. Only the Interfaces leaf had this ordering./studio/PKG/metadata/dashboard/NAMEnavigates a dashboard to the Interfaces pillar (StudioMetadataArea→areaItemPillarPath), so it is covered by the same fix, not a second editor.Tests
A new top-level describe in the #29015 shared harness,
StudioDesignSurface.draftUnreadable-29015.test.tsx. The designer registries are module state with no unregister, and the file'sbeforeEachregisters the dashboard preview, so each late-registration case loads the pillar and its registries afresh (vi.resetModules), with nothing registered. Each case first asserts the stamped state (the Source tool is shown and the draft has not been read), then registers the preview and a default inspector insideact.requiredPermissions.areaItemPillarPathgives for/studio/PKG/metadata/dashboard/NAME. This mounts the landing the area navigates to, not the area route itself.publishNoncereload is refused; the loaded buffer is taken back and nothing is sent.requiredPermissionsincluded) pinnedifMatch: 'v1'.beforeEach) still refuses, unchanged.Red at main, green with the fix, ablation
00f72f94with only the test commit:Tests 3 failed | 3 passed (6). All three new cases red onexpected <pre data-testid="surface-draft"></pre> to be null; both controls and the Studio: a dashboard draft whose requiredPermissions the author does not hold reads 403, Studio treats that as "no draft", and the next autosave overwrites the draft without the key #29015 case green.Test Files 1 passed (1),Tests 6 passed (6).scripts/ablation-replace.mjs: the refused branch'ssetDraftFor('')replaced bysetDraftFor((prev) => prev)(anchor 1 → 0, bloba60c33a4f242→ec0372a0a886). Result:Tests 3 failed | 3 passed (6), the same three red. Restored: blob == HEAD (a60c33a4f242),git diff HEADempty. No build is involved: ui vitest aliases app-shell tosrc.Neighbour sweep and type-check (head 1a9786f, after merging main)
InterfacesPillar(57 files, the harness included), two locked batches at--maxWorkers=2: 29 files / 155 tests passed; 28 files / 283 tests passed.StudioDesignSurfaceare not all run locally; the touched code is the Interfaces pillar's leaf load, and CI's Test UI runs the rest.pnpm exec turbo run type-check --filter=@object-ui/app-shell(65 tasks, test files included): exit 0.eslinton the two touched ui files: 0 errors; the 36 warnings all predate this PR (none is on a line it adds).Acceptance notes
requiredPermissions: ['showcase.export_data'](admin's draft read: 403).StudioDesignSurface.tsxserved): 7 of 7 fresh loads (5 on Interfaces, 2 by the deep link) show the strip AND the empty Properties form (5 form controls) and the item tools. A Source edit to the published body sentPUT …?mode=draft&package=…&surface=studiowith no If-Match, answered 200, and admin's draft read flipped 403 → 200 (the gate was gone). That happened on both routes./mnt/project-files/issue-29884/shots/.Fixes #29884is on the third line, after the project attribution block, which the session requires as the body's first two lines.Verification
Local gate union on the final head
58c3a3f7(main merged twice; the second merge brought 5 backend-only commits, none touchingui/):node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 35 families for the 3 changed paths (182 changed lines).exit 0on58c3a3f7, among themcheck-sdui-manifest.mjs(exit 0, the record does not move for a logic-only edit),check-changeset-no-major,check-empty-changeset,check-adr-0087-registration,check:query-options-erasure,check:type-check-debt,check:cross-package-test-inputs,check:test-source-alias.pnpm --dir ui exec vitest run scripts/: on1a9786f9(the first merge),Test Files 170 passed | 2 skipped (172),Tests 4979 passed | 2 skipped (4981), exit 0. The re-run on58c3a3f7finished green after this PR opened (4979 passed; card report 6604287278). The second merge touched noui/file.dispatch-gates --ranon1a9786f9: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.Generated by Claude Code