Repository navigation
fix(studio): after Restore package original the rail's customized mark and "only customizations" count refresh without a reload - #30381
Merged
Conversation
…o rail's customization marks
Contributor
Author
|
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2 Waits-on: main-red #30367
|
Contributor
Author
|
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2 维护者速读
席位核对 — ACCEPT · domain:ui#2 · head
|
This was referenced Nov 5, 2026
This was referenced Nov 5, 2026
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 Bill · project thread
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2
Fixes #30238
Clause-②: no
Metadata-protocol: none
维护者速读
GET /api/v1/packages/:id/customizations)的时机,从「只在发布后」改为「每次元数据刷新脉冲」;恢复原版本来就会发这个脉冲,所以恢复后侧栏的定制标记和「仅看定制(n)」立即更新,不用刷新页面。StudioDesignSurface.tsx中一处读取的触发键(含注释 +13/-3 行),外加一个新测试文件和 changeset;不动 spec、服务端或元数据。发布照样只读一次(发布本来就同时发脉冲);AI 助手发布后也会重读。回滚即 revert 本 PR。ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx约 836–849 行(customizationsRefresh那一段)→ 新测试StudioDesignSurface.restoreMarks-30238.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.restoreMarks-30238.test.tsx,预期 2/2 通过(在 main 源码上两条都失败:恢复后定制读取没有再请求)。What changes
StudioDesignSurfacereads the base's customizations once and hands them to every pillar ascustomization.marks: every pillar rail's marks and "only customizations" count come from that read. It was keyed onpublishNonce, so it was read again only after a publish. "Restore package original" (restoreOriginalin the Interfaces pillar, the flow restore in Automations, and the bundle item editor's restore) deletes the pair's draft and row, then callsemitMetadataRefresh(), but never movespublishNonce. So the shipped item read back while the rail kept its mark and its count until a reload.useMetadataRefreshNonce(), the assistant bus pulse that the restores already emit. Both publish paths (setPublishNonceat the two publish sites) emit the same pulse in the same handler, so a publish still reads once. Keying on both would read twice per publish. A copilot publish from the right dock, which the old key missed, now refreshes the marks too.usePackageCustomizations) is unchanged.The card's mechanism held as written:
restoreOriginalmovesservedNonce, the leaf or list-view or nav reload nonces, and emits the pulse, but no key the customization read listened to. I confirmed it on a second type: a dashboard opened from the navigation, besides the page the card measured.Tests
ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.restoreMarks-30238.test.tsx: the REALStudioDesignSurfaceand metadata client over a fetch stub that serves a read-only base with its pair listed, the pair's rows served over the base's items, the customization read (one override per pair row) and the reset door (DELETE, which deletes the pair's row).customizedand "only customizations" reads 1. After the restore the read is asked again, the mark is gone, and so is the filter.3e7cd7f5):Tests 2 failed (2), bothexpected 1 to be greater than 1(the customization read count did not move after the restore). Green after the fix:Tests 2 passed (2). The red-first run on the parent commit is the ablation leg: the fix is the only source change.StudioDesignSurface(60 files):Test Files 60 passed (60),Tests 372 passed (372). The other test files that import the module render single pillars with a host-builtcustomization, which this change does not touch.pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2:Tasks: 68 successful, 68 total.eslinton the two changed ui files: 0 errors.StudioDesignSurface.tsxhas 36 warnings, the same count as on main. The new test file has none.Acceptance notes
DirectoryPage,ResourceListPage) make their own customization read when each one mounts. The area mounts on its tab, and its list and item pages are separate routes, so after a restore made anywhere else they open on a fresh read. This PR does not change them.useServedOverride, keyed onservedNonce, whichrestoreOriginalmoves), not the customization read, so it already cleared after a restore. The count's navigation term is that same mark. The stale part was the off-navigation items (page, dashboard, report, view) and the nav entries' marks, which this PR fixes.Verification
Derived gates (dispatch-gates --commands, final tree `bde46d2b`)
node scripts/check-adr-0087-registration.mjs --base origin/main:: exit 0node scripts/check-adr-0087-registration.mjs --self-test:: exit 0node scripts/check-changeset-no-major.mjs --base origin/main:: exit 0node scripts/check-closing-keyword-parity.mjs:: exit 0node scripts/check-closing-keyword-parity.mjs --self-test:: exit 0node scripts/check-comment-mask-corpus.mjs:: exit 0node scripts/check-empty-changeset.mjs --base origin/main:: exit 0node scripts/check-empty-changeset.mjs --self-test:: exit 0node scripts/check-sdui-manifest.mjs:: exit 0node scripts/check-sdui-manifest.mjs --self-test:: exit 0node scripts/pm/release-rehearsal-clone.mjs --self-test:: exit 0node scripts/release-pending-publish.mjs --self-test:: exit 0pnpm --dir ui exec vitest run scripts/:: exit 0pnpm --filter @objectstack/spec run check:duration-unit-keys:: exit 0pnpm check:changeset-gate-self-tests:: exit 0pnpm check:closed-ceremony-text:: exit 0pnpm check:cross-package-test-inputs:: exit 0pnpm check:dispatcher-error-vocabulary:: exit 0pnpm check:driver-memory-census:: exit 0pnpm check:engine-double-contract:: exit 0pnpm check:gitlink-declared:: exit 0pnpm check:nul-bytes:: exit 0pnpm check:published-files:: exit 0pnpm check:query-options-erasure:: exit 0pnpm check:refd-timer-probe:: exit 0pnpm check:registry-log-declared:: exit 0pnpm check:rest-log-spy-declared:: exit 0pnpm check:skill-identifier-liveness:: exit 0pnpm check:test-source-alias:: exit 0pnpm check:tier-file-adoption:: exit 0pnpm check:type-check-coverage:: exit 0pnpm check:type-check-debt:: exit 0pnpm check:undeclared-dep-imports:: exit 0pnpm check:watch-hint-literal:: exit 0pnpm check:where-matcher:: exit 0node scripts/pm/dispatch-gates.mjs --ran: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.check:type-check-debtran under the verify lock (VERDICT command-exit 0).check:sdui-manifest(standing ui gate) is in the list.Generated by Claude Code