Repository navigation
fix(app-shell): Studio pillar loads and the metadata item editor open no buffer over a draft the server refuses to read - #29380
Merged
Conversation
… no buffer over a draft the server refuses to read The Interfaces app nav, the Data object and its pair extension, the Automations flow, and ResourceEditPage's load and post-publish re-read take a refused (403) draft read as a held draft, not as "no draft": no buffer, no pin, no save, and the shared refusal strip says why. StudioRefusalStrip moves to its own module so ResourceEditPage draws it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTCMoEXh1SQzWaNp2v
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTCMoEXh1SQzWaNp2v
Contributor
Author
|
domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB 席位核对 — ACCEPT ·
|
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 #29148 (PR 2 of 2, the split the claim amendment 6574316242 records; PR 1 #29275 landed the four editors at 192c15c).
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6574269114) and its amendment (comment 6574316242).
维护者速读
requiredPermissions,作者无权读)时,不再当成"没有草稿"去打开已发布版本:不装编辑缓冲,不发任何保存,显示同一条拒绝说明,服务器原话放在"详情"里。StudioRefusalStrip移到独立模块,元数据项编辑页画的就是 Studio 那一条。ResourceEditPage.tsx的draftRefused状态、加载与doPublish两处'refused' in draftRead分支和提前返回;StudioDesignSurface.tsx四处同样的分支;新模块StudioRefusalStrip.tsx(内容原样搬移)。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.draftUnreadable-29148.test.tsx,预期 3 个用例通过。What changes
readDraftForSavehands a draft read refused403back asrefused(#29132). The remaining loads that installed a buffer from that answer now act on it the way the Interfaces leaf load (#29015) and PR 1's four editors do: no buffer and no pin are installed, theengine.studio.refusal.draftUnreadablesentence shows with the server's own sentence (formatMetadataError) behind Details, and nothing is sent. No new i18n key.studio-design/StudioDesignSurface.tsx, Interfaces pillar, app nav load: a refused app draft installs no nav buffer (appDraftForstays unloaded, so the nav autosave's target is never loaded), the pillar reads it as a failed load with the strip, and Edit nav is not offered. No leaf opens under the unread navigation.objDraftForunloaded, so the designer shows the strip in place of the object and its autosave has nothing to send. On the draft-only path the published layers are not read to stand in for it.draftForunloaded; the strip shows in place of the canvas and the enable switch.metadata-admin/ResourceEditPage.tsx, load (:1344) and the re-read after a publish (:2250): a refused read sets the newdraftRefusedstate instead of installing a buffer or recording a pin.canWriteis false while it is set, so every write the page offers is withheld, and the page renders the strip in its shell in place of the editor (the same early return the loading state uses).studio-design/StudioRefusalStrip.tsx:StudioRefusalStripmoved out ofStudioDesignSurface.tsxunchanged, soResourceEditPagedraws the same strip.StudioDesignSurfacere-exports it for its pins (refusalAnnounced-29139);index.tsstill does not.Unchanged on purpose: the verdict-only re-reads in
StudioDesignSurface.tsx(they install nothing), and PR 1's four editors, which keep their own refusal hosts.Tests
Three new files; each refused case has a control (no pending draft: the published body opens, and where the harness saves, the first save is pinned
If-None-Match: *).StudioDesignSurface.draftUnreadable-29148.test.tsx(6): app nav, object and flow, each refused plus control, over the server double ofservedDraftTakenAsIs-10765.DataPillar.draftUnreadable-29148.test.tsx(2): the object-extension load over the Studio: add a field to a read-only base object — written as an extension in <base>.custom named xxx__c, base fields editable only within the display-property whitelist #28575 harness, refused plus control (Add field saves at the pair).ResourceEditPage.draftUnreadable-29148.test.tsx(3): the load refused, the post-publish re-read refused, and the control.Ablation, one per site (
scripts/ablation-replace.mjs, guard turned intofalse && …, restore proven blob == HEAD): each site's refused case goes red, every other case stays green.Acceptance notes
ResourceEditPagewithholds every write for an item whose draft read is refused, discard and publish included: the page cannot show what those would act on.StudioDesignSurface.tsx118, most of its removed lines being the strip that moved;StudioRefusalStrip.tsx72, the moved strip;ResourceEditPage.tsx49), 721 in the three new test files, 12 in the changeset.Verification
Head
816939aa(main239e3a8bmerged in), branched from192c15cf(PR 1). The sweep ran onbb4c4af9; mainee8cf851's merge was then checked with the app-shell type-check, the new and related tests, the 34 derived gates and the ui scripts suite. The last merge brings 11 main commits that touch none of the changed files; the three new files were re-run on it.New tests and ablations
Type-check and nearby suites
Derived gates
34 derived families run on ee8cf85, every one exit 0. dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.
Generated by Claude Code