Repository navigation
fix(app-shell): the metadata editor's save-status chip reads "Not saved" while a refused auto-save is held - #29974
Merged
Conversation
The auto-save effect returns early while a server refusal (refusalBlocking) or an inspector fault (inspectorBlocking) holds the draft, yet the chip kept its "Auto-saving…" state for as long as the page stayed dirty. The chip now reads those same two terms and shows a destructive "Not saved" state with the Save button's explanation as its title, returning to the usual states once the hold lifts. Claude-Session: https://claude.ai/code/session_01WGufzhoSygNDE4TgkcqHdD Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#1 · os-support-ai · session_01WGufzjDyeFwq6AuFu3vwTd 维护者速读(席位终稿)
席位核对 · ACCEPT · head
|
This was referenced Nov 3, 2026
This was referenced Nov 4, 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 Yibo Wang · project thread
Fixes #29901
维护者速读
@object-ui/app-shell、@object-ui/i18npatch。回滚 = revert 本 PR。ResourceEditPage.tsx的SaveStatusIndicator(新的held分支)及其渲染处传入的held={inspectorBlocking > 0 || refusalBlocking > 0};测试ResourceEditPage.serverRefusalGate.test.tsx末尾的(#29901)describe。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.serverRefusalGate.test.tsx packages/app-shell/src/views/metadata-admin/ResourceEditPage.celGate.test.tsx,预期18 passed。Clause-②: no
Metadata-protocol: none
What changes
@object-ui/app-shell,ResourceEditPage.tsx→SaveStatusIndicator. The chip gains a sixth state,held. While the page is dirty and a save door is shut on the draft, it readsengine.edit.notSavedHeld("Not saved — fix the errors to save") in the destructive tone, with the Save button's own explanation (saveTitle) as itstitle. It outranks the auto-save promise and the plain "Unsaved" state;savingstill outranks it, and create mode still hides the chip.held={inspectorBlocking > 0 || refusalBlocking > 0}, the same two terms that return the auto-save effect early and disable the Save button and the shortcut. When either term lifts, the chip falls back to "Auto-saving…" / "Unsaved" / "Saved HH:MM" as before.data-testid="save-status"and adata-state(saving,held,autosave-pending,unsaved,saved), so tests read the kind, not the copy.@object-ui/i18n, studio namespace:engine.edit.notSavedHeldinen.tsandzh.ts, besideengine.edit.autoSavingShortly. Nothing underpackages/spec/**moved.Why
Card #29901: after the server refuses an auto-saved draft with
422 INVALID_METADATA, the auto-save effect returns early onrefusalBlocking > 0, so no further PUT is sent, but the chip kept reading "Auto-saving…" for as long as the page stayed dirty, beside the red banners. An author who reads the chip believes the edit is stored and loses it on the next navigation.Which holds are covered, and why (measured on
origin/main8a608d87): the auto-save effect has two validation returns,inspectorBlocking > 0(an author-time fault the inspector reports, e.g. a CEL predicate that does not parse, kept with the draft slice it judged) andrefusalBlocking > 0(the server's 422, document-scoped). Both hold the auto-save the same way, so the chip must not promise a save under either; both are covered. The client's live Zod pass is not a term: per the boundary written in the page (9073cf018), a predicted verdict stays advisory, and the chip follows the save doors rather than gating anything.Acceptance notes
held: []) is not a hold, and the chip does not call it one. By design that refusal gates nothing and Save stays enabled. The auto-save does not re-send the identical snapshot either (lastAutoSaveSnapshotRef), so until the author's next edit the chip still reads "Auto-saving…" while nothing is sent; the next edit of any kind does send. Left as it is: the order scopes this card to the two terms that hold the auto-save, and showing "Not saved" for an unheld refusal would be wrong again the moment an edit re-arms the timer. Noted, not filed.Verification
Head
4c50f374, worktree offorigin/main8a608d87(after #29897's04cbdf78b).ResourceEditPage.serverRefusalGate.test.tsx→the save-status chip while a refusal holds auto-save (#29901):autosave-pending, saves once, then readssaved.client.save(…, { mode: 'draft' })(thePUT …?mode=draftdoor) answers 422INVALID_METADATAthrough the realMetadataClientparser; the chip readsheldwith the server-refused title, stillheldpast the debounce and after an unrelated edit, andclient.savestays at one call.saved.ResourceEditPage.celGate.test.tsx→the save-status chip while the inspector holds auto-save (#29901): a good predicate readsautosave-pending, a dangling operator readsheldwith the inspector title, a parseable one readsautosave-pendingagain.Test Files 2 passed (2) · Tests 18 passed (18).scripts/ablation-replace.mjs, anchorif (held) {→if (false && held) {, x1 → x0, restored to the HEAD blob57cd4216ded4withgit diff HEADempty):3 failed | 15 passed (18), all three new held/recovery tests withexpected 'autosave-pending' to be 'held'; both CONTROLs stayed green.@object-ui/app-shell...closure build (turbo, 68 tasks): exit 0.ResourceEditPage(106 files):Test Files 106 passed · Tests 962 passed. The full app-shell suite is CI's Test UI.@object-ui/i18nsuite (pnpm --dir ui exec vitest run packages/i18n/, includesall-locales-key-parity):95 passed · 1443 passed / 13 skipped.type-check(pnpm --dir ui --filter @object-ui/i18n --filter @object-ui/app-shell run type-check): exit 0 for both.eslintas the packagelintscript runs it, on the three app-shell files: 0 errors; no warning on a changed line.node scripts/check-sdui-manifest.mjs: exit 0 (sdui.manifest.json is present and intact; no registry change).node scripts/pm/dispatch-gates.mjs --commandson head4c50f374: 35 derived commands, all 35 exit 0 (check:type-check-debtran its own full-packages build under the lock).dispatch-gates --ran:35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED.Human Minimum
packages/specholds no runtime logic. (spec untouched)pnpm lintpasses (package lint run on the touched files; the repo-wide run is CI's).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.维护者速读section is the Chinese summary for the maintainer).🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzhoSygNDE4TgkcqHdD