Repository navigation
fix(app-shell): nav page picker offers a draft page only when its draft body can be a nav target - #26968
Merged
Conversation
…ft body A `_drafts` header names the metadata type, never the page body's own `type`, so the Interfaces nav page picker offered a draft record page and picking it gave a dead entry once the app was published. A draft-only row of a type whose verdict reads the body (page, action) is now judged on its draft body, as a published row is; an unreadable body keeps the row. Claude-Session: https://claude.ai/code/session_01JQwxbYChiSg5184uQo2r5x Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:导航项「页面」选择器对仅草稿的页面读取草稿正文再判定,草稿记录页不再列出;读不到正文时保留,与无
|
9 tasks done
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 Warren · project thread
Fixes #26743
Clause-②: no
Metadata-protocol: none
维护者速读
type判定,与已发布页同一规则(绑定对象的草稿动作同理)。_drafts行只带元数据类型page,不带页面自身的type,原代码对草稿行一律放行,选中草稿记录页、随应用发布后导航项打不开。type的已发布行一致)。回滚即 revert 本 PR。StudioDesignSurface.tsx的isDraftNavTarget与usePackageNavTargets中草稿循环;再看新测试StudioDesignSurface.navPageDrafts-26743.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.navPageDrafts-26743.test.tsx,预期 6 个测试全过。What changes
usePackageNavTargets(Interfaces nav item inspector's target picker): a draft-only row of a type whoseisNavTargetRowverdict reads a body key (page: the body'stype;action:objectName) is now judged on its draft body, read withclient.getDraftand unwrapped byextractDraftBody, the one draft-envelope reader. A draft record page is no longer offered; a draft static page still is.typeis kept: only a confirmed non-target is dropped. Other target types (dashboard,report,doc) read no body.Why
The
_draftsheader (ListDraftsResponseSchema) carries the metadata type name and the draft'slabel, never the body's owntype, so the old loop could not filter and added every draft-only row. Fixed client-side with the existing draft read; no spec or server change.Tests
New
StudioDesignSurface.navPageDrafts-26743.test.tsx(6 tests): a draft record page is not offered; a draft static page is offered; a published record page is still not offered; CONTROL an unreadable draft body is still offered; a draft object-bound action is not offered, a draft global action is; only body-keyed types read drafts, published rows are never re-read.Ablation (commit ca23ec4)
node scripts/ablation-replace.mjsreplaced the anchorif (verdicts[i]) byName.set(row.name, row);with an always-true condition: anchor 1 -> 0, blob 8a30d22bfe30 -> e63569e6a119. Result:a draft record page is not offeredanda draft action bound to an object is not offered, a draft global action isfailed (2 failed, 4 passed). Restored: blob == HEAD (8a30d22bfe30),git diff HEADempty. No dist leg: the test imports the component by relative path.Verification
All local readings at head
ca23ec41(baseaa00362f).Local gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 24 derived families, all run, every one exit 0;--ranreconciliation: 24 derived, 24 run, 0 NOT-MEASURED, 0 UNRUN.node scripts/check-sdui-manifest.mjsexit 0 (and--self-testexit 0).pnpm --filter @object-ui/app-shell run type-checkexit 0.pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ packages/app-shell/src/views/metadata-admin/inspectors/: Test Files 429 passed, Tests 4289 passed, 1 skipped.pnpm --dir ui run check:new-line-citations: 0 new citations, exit 0.node scripts/check-nul-bytes.mjsexit 0.Changeset: none.
@object-ui/app-shellisprivate: true, so nothing publishes;skip-changesetis declared with this PR.Acceptance notes
?state=draftread when the picker opens;getDraftasks the shared_draftsledger read first, so no extra ledger request is sent.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI).main, one pull request.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
Generated by Claude Code