Repository navigation
fix(studio): the Data pillar's Validations and Actions panels and ResourceEditPage keep a CEL hold with the draft (#27629) - #27697
Merged
Conversation
…tPage CEL hold (#27629) Fail on main: leaving the Validations or Actions tab, or clearing or changing the ResourceEditPage selection, releases the hold and the autosave sends the broken predicate. Claude-Session: https://claude.ai/code/session_01Utp6CaJoinvGQSbHeDaWBe Co-authored-by: Claude <noreply@anthropic.com>
… the draft (#27629) Claude-Session: https://claude.ai/code/session_01Utp6CYaLJTMXdChBaqK9KL Co-authored-by: Claude <noreply@anthropic.com>
…he draft; changeset (#27629) Claude-Session: https://claude.ai/code/session_01Utp6CYaLJTMXdChBaqK9KL Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 29, 2026
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe 席位核对ACCEPT · head
Generated by Claude Code |
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
维护者速读
useDraftAutoSave的计时器与单飞;最坏情况是多拦一次(提示行 + Show me 可解),回滚即 revert 本 PR。ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx(panelCelVerdicts一段)、ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx(inspectorVerdicts与selectionSlicePath)、两个新测试文件。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/DataPillar.panelHold-27629.test.tsx packages/app-shell/src/views/metadata-admin/ResourceEditPage.celHold-27629.test.tsx,预期 8/8 通过。Fixes #27629
Clause-②: no
Metadata-protocol: none
What changes
The maintainer's ruling on #27485 (comment 6500685972, letter A) makes a CEL parse-fault hold belong to the draft, not to the open editor. PR #27617 did that for the Data pillar's field inspector; this PR ports the same shape to the sibling surfaces item 3 of that ruling names. One measured repro per surface came first (all failed on
main, see Tests).onCelVerdictsChange, pruned to the items in the draft;onBlockingIssuesChangeis unchanged).DataPillarkeeps each verdict inpanelCelVerdictswith the stamp of what it judged (panelItemCelStamp: the rule or action itself plus the object's field names, the counterpart offieldCelStamp), retaken while the panel is mounted. With the tab left, a kept verdict holds while the draft still carries that stamp; an edit to the item, its removal or the object's next load ends it. While the panel is mounted its own report is the live verdict and wins. The held line names the item (new clausesengine.studio.held.celInvalidRule/celInvalidAction), its "Show me" reopens it (the Validations panel gains thefocusprop the Actions panel already had), and the rail switch's flush-or-ask, the Studio Publish refusal and the held-edit report all read the sameobjHeld, unchanged.ObjectDefaultInspectormounts no CEL editor, so the panel never reports a verdict (its own header says so). It keeps the tab-stamped count it had.ResourceEditPage. Each selection's last live inspector verdict is kept ininspectorVerdictswith the fingerprint of the draft slice it judged:selectionSlicePathreads the selection id as a path (a page block'sregions[0].components[0]), else finds the object whoseid/name/key, or map key, is the id; the default inspector and an unlocatable id fall back to the whole document. The fingerprint isissueSliceFingerprint, the one the server-refusal hold already uses. A kept verdict holds Save, the autosave and the shortcut while that slice is unchanged; the editor shows a held line (engine.studio.held.inspectorInvalid) naming the item, and "Show me" reselects it. Item change and the item's load clear the kept verdicts.useDraftAutoSave.tsis untouched.Tests
DataPillar.panelHold-27629.test.tsx(5 cases): leaving Validations / Actions keeps the hold and the held line names the rule / action; "Show me" reopens it with its text and fixing it releases the hold; removing the rule ends it.ResourceEditPage.celHold-27629.test.tsx(3 cases): clearing or changing the selection keeps Save and the autosave held and names the block; "Show me" reselects it and fixing it releases.DataPillar.panelGate.test.tsx: the case "expires the panel count when the author leaves the Rules tab" pinned the superseded tab stamp; flipped to "keeps the hold when the author leaves the Rules tab, and names the rule", citing the ruling.Readings, all on the final head
7484a827(the work merged withorigin/mainat15b099e7) unless a line says otherwise:Repro on main (before the fix, tree 5d759b1 + the two new test files): 8 failed / 8
Affected suites (pre-merge head efe3f9a): 198 files / 1283 tests passed
Every
DataPillar.*,StudioDesignSurface.*,ObjectValidationsPanel*,ObjectActionsPanel*,ObjectSettingsPanel*test underviews/studio-design/and everyResourceEditPage.*test underviews/metadata-admin/,--reporter=verbose, under the verification lock:Test Files 198 passed (198) · Tests 1283 passed (1283), lock VERDICT command-exit 0. The rest of the ui tree is left to CITest UI.After merging origin/main (head 7484a82)
Ablations (one per surface, restored, blob == HEAD proven by ablation-replace)
StudioDesignSurface.tsx: the kept panel-verdict condition replaced byif (false) {→leaving the Validations tab keeps the hold…andleaving the Actions tab keeps the hold…both red (2 failed); restored,git diff HEADempty.ResourceEditPage.tsx: the kept inspector-verdict condition replaced byif (false) {→ all 3 cases ofResourceEditPage.celHold-27629red; restored,git diff HEADempty.srcdirectly, so no dist build sits between the mutation and the run.Derived gates (dispatch-gates --commands on this diff): 34 run, 34 exit 0, reconciled
dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Alsonode scripts/check-new-cross-file-line-citations.mjs(ui): 0 new citations, exit 0. Families CI runs beyond the derived set are read from this PR's check-runs.Acceptance notes
flush(the Data rail switch) inside that window can still read the previous verdict, and a reopened held item reports nothing for about that long (its kept verdict stands meanwhile, so it stays held). Closing it needs a "lint pending" signal from the editors to the host; no such signal exists on this surface, and adding one reaches into every CEL editor, so it is out of this card's file surface. The timer path stays safe: a rising hold cancels the 1.5 s timer and a falling one re-arms a fresh one.ResourceEditPage's slice locator is best-effort and fails toward release. When a selection id is neither a path nor an item identity in the draft, the kept verdict is stamped against the whole document, so any edit ends the hold early (the old behaviour, narrowed). A wrongly located slice can over-hold; the held line's "Show me" reopens the item and its live verdict then wins, so Save is never wedged with nothing on screen.ResourceEditPageis shared. It carries CEL faults and the required-field refusal in a gated section (ruling 5831744213); both are now kept with the draft, since the count does not tell them apart. The held line's wording is neutral for that reason.MetadataInspectorProps.onBlockingIssuesChangeininspector-registry.tsstill says hosts "must reset their own count when the selection changes"; both hosts now keep it with the draft (the field inspector since fix(studio): a Data rail switch sends the pending edit first; a broken CEL formula stays held after the inspector closes and keeps its returnType (#27511, #27485) #27617). Not edited here (file not in the claim); a doc line for the seat to route.49b01042) carries the dispatching seat's session id in itsClaude-Session:trailer instead of this run's; later commits carry this run's. History is not rewritten (the branch is notclaude/issue-*, so no force push).Verification
Run the two new suites (command in 维护者速读). In a running Console: open Studio, Data, an object, Validations, set a rule's guard to
record.status ==, switch to Form: the draft stays unsaved and the line "Not saved yet: an expression on the rule “…” has an error to fix" appears with Show me.Generated by Claude Code