Repository navigation
fix(console): a settings action whose handler declares confirmText asks before invoking - #30470
Merged
objectstack-fleet[bot] merged 2 commits intoNov 5, 2026
Merged
Conversation
…ks before invoking Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUR8Nu4M7tbtgES7q2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUR8Nu4M7tbtgES7q2
Contributor
Author
|
domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2 维护者速读
席位核对 — ACCEPT · head 470a4eb
|
objectstack-fleet
Bot
deleted the
claude/issue-30419-settings-action-confirm
branch
November 5, 2026 13:10
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 Sales · project thread
domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2
Fixes #30419
Clause-②: no
Metadata-protocol: none
维护者速读
action_button)若在 manifest 里声明了confirmText,点击后先弹出确认框显示该文字;取消则什么都不执行,确认才执行一次。未声明的按钮行为不变。SpecifierHandlerSchema的http/action两臂),但控制台从不读取,作者标记为需确认的危险操作一点就跑(声明 ≠ 兑现)。AlertDialog原语与已有actionConfirm.*文案键,不加新组件、不加新 locale 键;回滚即 revert 本 PR。ui/apps/console/src/pages/settings/SettingsField.tsx的action_button分支(declaredConfirm一段);其次新测试SettingsField.actionConfirm.test.tsx。pnpm --dir ui exec vitest run apps/console/src/pages/settings/__tests__/SettingsField.actionConfirm.test.tsx,预期 11 passed。What changes
SettingsField'saction_buttonrow reads the handler's declaredconfirmText(the spec'sSpecifierHandlerSchemahttp/actionarms: "Confirm dialog text before invoking (omit = no confirm)").confirmText != null, the same test the spec's action resolver applies when it decides an action opens a dialog): the button becomes the trigger of the console's existingAlertDialogprimitive from@object-ui/components(the one the Approvals Inbox confirms with). The dialog body is the text resolved the way this file resolves the row's other manifest copy:labels.actionConfirm(actionId, resolveLabel(confirmText)), i.e. the already-existing, until now unreadsettings.NAMESPACE.actions.ID.confirmTextslot with the manifest literal as fallback. Title / Cancel / Continue reuse the sharedactionConfirm.*keysActionConfirmDialoguses, so no locale key is added. Cancel invokes nothing; Continue invokesonActiononce.navigatehandler (which has no such key): the button is rendered exactly as before,onClick={onAction}, no dialog.packages/**change; no change to thetypes.tsmirror.Tests
New
ui/apps/console/src/pages/settings/__tests__/SettingsField.actionConfirm.test.tsx(11 tests):httpand anactionhandler withconfirmText: click opens an alertdialog carrying the text and invokes nothing; Cancel closes it and invokes nothing; Continue invokes exactly once;actions.ID.confirmTexttranslation is what the dialog shows, and the helper is asked with the manifest literal as fallback;confirmText(http,action), anavigatehandler, and no handler: click invokes once, no dialog.Acceptance notes
types.ts) typesconfirmTextas a plain string while the spec declares anI18nLabel(string or inline locale map). The same mirror gap already holds for every specifierlabelhere (resolveLabelreads a string or adefaultValue/keyobject, not an inline locale map). This PR keeps that resolution unchanged; because the dialog opens on the declaration, not on the resolved text, an inline-mapconfirmTextstill asks (with the generic title) rather than running unasked. Not filed: observation, no reach measured.Verification
All readings on
objectstack-ai/objectstack, branch head470a4eb5(tests run at21978cf3; the only later commit adds the changeset).Positive control: the declared-confirm tests fail on main's SettingsField
git restore --source=677ac3bb -- ui/apps/console/src/pages/settings/SettingsField.tsx(trap-restored from HEAD, hash re-compared after), thenpnpm --dir ui exec vitest run --reporter=verbose apps/console/src/pages/settings/__tests__/SettingsField.actionConfirm.test.tsx:The 7 failures are exactly the declared-confirm cases (http x3, action x3, translation); the 4 undeclared cases pass on main, as they must.
With the fix
(The settings directory run includes
settingsPage.noBareLiterals-12821.test.ts, which readsSettingsField.tsxfor bare rendered literals.)Lint
cd ui && pnpm exec eslint apps/console/src/pages/settings/SettingsField.tsx apps/console/src/pages/settings/__tests__/SettingsField.actionConfirm.test.tsx→ exit 0,0 errors, 2 warnings(both pre-existingno-explicit-anylines outside this diff).pnpm --dir ui run check:new-line-citations→VERDICT new-cross-file-line-citations: 0 new citation(s).Derived gates (`node scripts/pm/dispatch-gates.mjs --commands`, 34 commands)
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 --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:test-source-alias→ exit 0pnpm check:tier-file-adoption→ exit 0pnpm check:type-check-coverage→ exit 0pnpm check:type-check-debt→ exit 3pnpm check:undeclared-dep-imports→ exit 0pnpm check:watch-hint-literal→ exit 0pnpm check:where-matcher→ exit 0pnpm check:changeset-fixed→ exit 0pnpm check:type-check-debtexit 3 is the gate's PREREQUISITE NOT MET (it refused to measure), read as NOT MEASURED, not a finding; this diff touches no package ledger.pnpm --dir ui exec vitest run scripts/not run locally (scripts tree untouched); CI runs it.NOT MEASURED
pnpm --filter @object-ui/console run type-check): NOT MEASURED, reason: it needs the@object-ui/*dist closure built; the shared verify lock queue-timed out twice (exit 99, 9 min each) behind another run, and an unlocked attempt without that build answers only TS2307 missing-module noise. CI'sType Check UImeasures it.🤖 Generated with Claude Code