Skip to content

fix(app-shell): four Studio editors open no buffer over a draft the server refuses to read - #29275

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-jr58yz
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-jr58yz

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #29148 (PR 1 of 2, the split the claim amendment 6574316242 records; PR 2 takes the Interfaces app nav, object, object-extension and flow loads in StudioDesignSurface.tsx and ResourceEditPage.tsx, and is the one that completes the card).

Clause-②: no
Metadata-protocol: none

The two lines are copied from the claim (comment 6574269114) and its amendment (comment 6574316242).

维护者速读

  • 改了什么:列表视图检查器、邮件模板/翻译表单编辑器、权限矩阵(包草稿入口)、钩子面板这四个 Studio 编辑器,读草稿遇到服务器 403(草稿带受众门 requiredPermissions,作者无权读)时,不再当成"没有草稿"去打开已发布版本,而是显示同一条拒绝说明,服务器原话放在"详情"里,自动保存没有内容可发。
  • 为什么改:之前这几个编辑器会把已发布版本当作编辑起点,下一次自动保存把它写成草稿,悄悄抹掉草稿里的权限门和其他未发布改动,发布后该项对所有人可见。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 只修了 Interfaces 的叶子项,本 PR 修其中四个编辑器,其余在 PR 2。
  • 风险与回滚:只影响草稿读取返回 403 的项;无草稿、可读草稿、其他读取失败的路径不变。钩子面板只拦被拒的那个钩子,其余钩子照常。回滚即撤销本 PR。
  • 先看:ObjectHooksPanel.tsx(部分拒绝的处理);PermissionMatrixEditor.tsx 加载处的 'refused' in pendingRead 分支与两处渲染;StudioBundleItemEditor.tsx 错误条新增的"详情"。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ObjectHooksPanel.draftUnreadable-29148.test.tsx,预期 3 个用例通过。
  • 需要你做的:无,席位落地。

What changes

readDraftForSave has handed a draft read refused 403 back as refused since #29132. These four editors now act on it the way the Interfaces leaf load does: no buffer is installed, the engine.studio.refusal.draftUnreadable sentence shows with the server's own sentence (formatMetadataError) behind Details, and the autosave has nothing to send. No new i18n key.

  • studio-design/ObjectListViewInspector.tsx (useObjectListViewDraft): a refused view draft read leaves the buffer unloaded (for: '', row: null) and sets failure to the new draftUnreadable arm, which the panel's existing refusal host renders. The published layer is not read.
  • studio-design/StudioBundleItemEditor.tsx: a refused read installs no draft, clears the guard's pins (forget), and shows neither the form nor the preview. The editor's error host now renders a Details disclosure when a refusal carries one (only this refusal does today).
  • metadata-admin/PermissionMatrixEditor.tsx (package door, load only): a refused read installs no matrix; the strip replaces it in both presentations (routed page and the Studio Access pillar), and the autosave is blocked. The pre-save re-read (it already refuses the save when the draft read answers nothing) and the post-save verdict re-read (installs nothing) are unchanged, per the claim amendment.
  • studio-design/ObjectHooksPanel.tsx: the list load keeps the refused hooks by name. A refused hook stays listed by its published row, pins nothing, and opens no buffer: selecting it shows the strip in the detail pane. A partial refusal holds only that hook; the other hooks load, edit and save as before. A hook known only by its refused draft is not listed, as today: nothing says it fires on this object.

Tests

One new file per editor, each with a refused case, a control (no pending draft: the published body opens and the first save is pinned If-None-Match: *), and for the hooks panel a partial-refusal case.

  • ObjectListViewInspector.draftUnreadable-29148.test.tsx (2): the real hook and panel over a real MetadataClient and an in-memory server whose ?state=draft read answers 403.
  • StudioBundleItemEditor.draftUnreadable-29148.test.tsx (2)
  • PermissionMatrixEditor.draftUnreadable-29148.test.tsx (3): routed page, Studio presentation, control.
  • ObjectHooksPanel.draftUnreadable-29148.test.tsx (3): refused, partial refusal, control.

Ablation, one per editor (scripts/ablation-replace.mjs, guard turned into false && …, restore proven blob == HEAD): each refused case goes red and each control stays green.

Acceptance notes

  • Each editor renders the strip in its own refusal host, in the Studio refusal strip's look. Moving StudioRefusalStrip into a shared module, so every editor draws the one component, is PR 2's (it edits StudioDesignSurface.tsx, which open PR fix(studio): a refusal in a Studio strip is announced to screen readers #29224 also edits).
  • Changed lines 843: 162 in the four editors, 669 in the four new test files, 12 in the changeset.

Verification

Head fc165c69 (main 47ee57fe merged in), branched from 10bfd70e. The new tests and app-shell type-check were re-run on the merged head; the sweep, the ui scripts suite and the gates ran on b944048d, before the merge.

New tests and ablations
vitest run (4 new files): Test Files 4 passed (4), Tests 10 passed (10)
ablation bundle   : 1 failed | 1 passed (refused case red, control green), restored blob == HEAD
ablation listview : 1 failed | 1 passed, restored
ablation perm     : 2 failed | 1 passed, restored
ablation hooks    : 1 failed | 2 passed, restored
Type-check and nearby suites
turbo run type-check --filter=@object-ui/app-shell: 65/65 tasks, exit 0 (tsc --noEmit and tsconfig.test.json)
vitest, the 80 test files naming the four editors (2 batches of 40): 40/40 (279 tests) and 40/40 (236 tests)
pnpm --dir ui exec vitest run scripts/: 169 passed | 2 skipped files, 4900 passed | 2 skipped tests
Derived gates

34 derived families run on b944048 (before the merge of main; main's incoming commits touch none of the four editors), every one exit 0. dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0

Generated by Claude Code

…erver refuses to read

The list-view inspector, the bundle item editor, the permission matrix's
package door and the hooks panel took readDraftForSave's refused (403)
answer for "no draft" and seeded the published body, which their next save
wrote over the pending draft. Each now installs no buffer, shows the
draftUnreadable sentence with the server's own behind Details, and its
autosave has nothing to send. The hooks panel holds only the refused hook.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jTCMoEXh1SQzWaNp2v
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head fc165c69 · 2026-11-02T11:14Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant