Repository navigation
fix(components): confirm restart, tag deletion and teardown in-app - #30947
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change swaps three native confirms for the existing Notes
[DESIGN-REVIEWED] 8fb5b9f Description read[DESCRIPTION-READ] f7df3a4e1b47f862eebbd7c38ae150cbe7d9a1f42f4b3bb6a3b412bd42e039bd That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. All three in-app confirmations appear in the attached screenshots. No first-time reader has looked at them, because this fork lane has no blind read; pushing the branch to this repository adds one. Notes
[UX-REVIEWED] 8fb5b9f Description read[DESCRIPTION-READ] a8fffd8a32fc2fb87cad61cb8b0d22e32b5b7d11fe30fd37ba3613106e153d16 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing here should be cut. The one note: the PR ships its own copy of a test helper that another open PR owns. Notes
What this change shipsInventory (9 items) — 8 justifiedIntent: restart, tag deletion and deployment teardown ask for confirmation inside the app window instead of in a native OS dialog, which can leave the Windows keyboard dead (#15976). This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 8fb5b9f Description read[DESCRIPTION-READ] 7b2b8f19c202a9ffc9944dc18328c864f1724db1ef91ad3d22b7a72d0ff2506c That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
3815e44 to
1ac705f
Compare
4cdc056 to
05d095e
Compare
Restart, tag deletion and web-app teardown use native confirm() dialogs. On Windows, closing one can leave the app window ignoring the keyboard until it is reactivated (kirodotdev#15976). Ask through the existing in-app useConfirm dialog instead. Keep the full restart reassurance in the body and use the existing short action label for its title. Restart intentionally uses the neutral style because its question is nondestructive. Translate the tag question with a locale-quoted name, and render teardown resources as list items between the existing warning paragraphs. The page stays live during an in-app question. Capture the tag id and name before waiting, then re-check its cached row and shared pending deletions after approval. Skip a missing or degraded tag or a deletion already in flight. Keep the column-filter question above its popover, and let the modal own its outside presses and keys. Capture the teardown slug and callback before waiting. Cancel unanswered consent when the card switches artifacts, and re-check expiry and pending state after approval. Invalidate the captured artifact on success without notifying or changing a departed or replacement card. Keep the dialog mounted across all card returns and ignore repeated question presses. Add three locale keys across the owning English catalog, translated catalogs and pseudolocale. Convert the behavior tests to answer the in-app dialogs and remove the three migrated paths from the native-dialog allowlist. Leave the theme editor and DisplayPanel migration for a later PR using the nested Radix dialog. Part of kirodotdev#15976
05d095e to
8fb5b9f
Compare
|
HOLD (policy: data-deleting paths) at 8fb5b9f. This PR replaces the native AI notes, none blocking: the duplicated To clear: a human reviewer confirms the delete and teardown consent changes. — crew-pr-reviewer (r148) |
bolichen97
left a comment
There was a problem hiding this comment.
Approving 8fb5b9f. Restart, tag deletion and web-app teardown now ask through the in-app useConfirm dialog instead of a native confirm(), with the existing warnings kept in the body, and the callers leave the shrink-only allowlist in eslint.config.js.
What I checked in the diff: the tag delete re-reads the tag from the query cache after the answer and refuses if the row is gone, the store is degraded or the same delete is already in flight. The teardown captures the slug before the question, ignores a stale card through activeSlug, and re-checks the expired and pending state after the answer. The resource names go into list items, so a name cannot add paragraphs. The two board guards only skip an outside press or key while a modal is open. The tag delete question is now a translated string in every locale file. The change adds no regex in product code and no new restriction, and all 94 checks pass on this head.
…30947) Restart, tag deletion and web-app teardown use native confirm() dialogs. On Windows, closing one can leave the app window ignoring the keyboard until it is reactivated (#15976). Ask through the existing in-app useConfirm dialog instead. Keep the full restart reassurance in the body and use the existing short action label for its title. Restart intentionally uses the neutral style because its question is nondestructive. Translate the tag question with a locale-quoted name, and render teardown resources as list items between the existing warning paragraphs. The page stays live during an in-app question. Capture the tag id and name before waiting, then re-check its cached row and shared pending deletions after approval. Skip a missing or degraded tag or a deletion already in flight. Keep the column-filter question above its popover, and let the modal own its outside presses and keys. Capture the teardown slug and callback before waiting. Cancel unanswered consent when the card switches artifacts, and re-check expiry and pending state after approval. Invalidate the captured artifact on success without notifying or changing a departed or replacement card. Keep the dialog mounted across all card returns and ignore repeated question presses. Add three locale keys across the owning English catalog, translated catalogs and pseudolocale. Convert the behavior tests to answer the in-app dialogs and remove the three migrated paths from the native-dialog allowlist. Leave the theme editor and DisplayPanel migration for a later PR using the nested Radix dialog. Part of #15976 (cherry picked from commit 5718e01)
Problem / Motivation
Goal: Restarting agents, deleting a tag and tearing down a web-app deployment ask for confirmation inside the app window instead of in an OS dialog.
These actions call the browser-native
confirm(). On Windows, closing a native renderer dialog can leave the window ignoring the keyboard until it is reactivated (#15976). #15854 added the lint gate against new native dialogs and exempted these callers in a shrink-only allowlist.Why it matters
Applying saved changes, managing tags and removing a deployment can reach the Windows keyboard problem. Replacing these three native confirmations shrinks that set while keeping each action's warning visible.
Not a goal
themeEditor.tsxorDisplayPanel.tsx. Their nested theme dialog needs the Radix variant and belongs to a later PR in this series.What changed (motivation → approach → change)
The three components ask through the existing in-app
useConfirmdialog. Each title is a short action label soModaldoes not truncate the warning, which stays in the body.RestartButton.tsxTagManagerList.tsxWebAppArtifactCard.tsxThe page stays live during the question. Each component ignores another press while its question is open and keeps its existing pending-action disable. Tag deletion captures primitive id and name values before waiting. After approval, it checks the shared cache and pending mutations, skipping a missing or degraded row or a deletion already in flight in another mounted list. Its existing mutation, error handling and cache invalidation remain.
The column-filter tag question uses the top modal layer above the board popover.
board.tsleaves outside presses to the modal, including its backdrop.boardLane.tsxleaves portaled keys to the modal, so approving or dismissing the question keeps the popover open.Teardown captures the slug and callback before waiting. Switching artifacts or unmounting the card cancels unanswered consent. Approval re-checks current metadata, lifecycle expiry, countdown expiry and pending state. A completed mutation invalidates the captured artifact, while callbacks, success state, errors and the pending label stay with their owning card. A replacement card keeps its normal label and remains disabled until the existing request finishes.
The teardown dialog renders in every card return, including no metadata and not deployed. Resource identifiers remain text inside list items, so embedded newlines cannot create warning paragraphs. Missing or edge-position resource placeholders still open the question without empty paragraphs.
Three keys are added to
website/src/i18n/locales/en.manual.json, eleven translated catalogs and the regenerated pseudolocale. The quoted-operand convention test registers the tag question.website/eslint.config.js``website/eslint.config.jsremoves only the three migrated paths.Shared-file overlaps at
fe40b96e24:website/src/test/confirmAction.tsBackwards compatibility
Compatible: API requests, action controls and existing warnings stay the same. Confirmation stays inside the app, and approval skips a target that has become ineligible while the question was open.
Reader: website/eslint.config.js:native-dialog allowlist for RestartButton.tsx -- release -- the native call is gone, so both error-level restrictions apply and whole-source lint passes.
Reader: website/eslint.config.js:native-dialog allowlist for TagManagerList.tsx -- release -- tag deletion uses the in-app dialog in both modes and passes whole-source lint without its exemption.
Reader: website/eslint.config.js:native-dialog allowlist for WebAppArtifactCard.tsx -- release -- teardown uses the in-app dialog and passes whole-source lint without its exemption.
Reader: website/package.json:lint -- release -- ESLint reads the same config and applies both restrictions to the migrated paths.
Reader: .github/workflows/ci.yml:frontend-lint -- release --
npx eslint src/ --max-warnings 0uses the config without the three exemptions.Tests
RestartButton.cov80.test.tsxchecks the full reassurance, Cancel without an API request, approved success and failure, pending disable andkeeps one question open for repeated restart presses.TagManagerList.test.tsxchecks Cancel, approval, failures, captured identity and name, an empty list and repeated presses. Both co-mounted list directions cover another list's completed or pending deletion. Both manage and column-filter modes cover a store becoming degraded before approval.ChatSidebar.boardColumnTagFilter.test.tsxcovers modal layer order, approval, Escape, Cancel and backdrop dismissal while preserving the popover.chatSlotsDeadKeyInvalidation.test.tsxretainsrefreshes chat-tags and tag-columns, and names no chat-slots keythrough the in-app question.WebAppArtifactCard.test.tsxchecks Cancel, the resource list and warning, repeated presses and all card returns. It covers unanswered consent canceled by an artifact switch, lifecycle or countdown expiry before approval, and late success or failure isolated from a replacement card. Unmount still permits the captured artifact's invalidation without its callback. Resource tests keep blank lines inside one list item and cover missing, leading and trailing placeholders without empty paragraphs. The countdown tests use a fixed Date clock.The converted tests use
website/src/test/confirmAction.ts, identical to the helper #30251 adds.website/src/i18n/destructiveConfirm.test.tsincludes the new locale-quoted tag operand.Proof: not provable -- frontend test (prove.py runs Python only).
Local validation passes the related Vitest set, a repeated touched-test run and a shuffled run with seed 303, TypeScript, touched-file and whole-source ESLint, internationalization, comment history, brand-name and file-line-cap checks. Removing the tag eligibility and teardown expiry checks makes their regression cases fail. The full local gate's backend portion was not run to completion. This PR changes no backend source or tests.
Manual verification
The three existing screenshots below were inspected. They show the full restart reassurance, the quoted tag name and the teardown warning with its resource list. A live Windows desktop build was not run, so keyboard behavior after dismissal still needs desktop verification.
Screenshots / video
Related Issues
Part of #15976
Relates to #15662, which #15854 closed after adding the shrink-only native-dialog allowlist that this PR shrinks.
Sibling sweep
The search covers shared components at base
fe40b96e24000a7f070741966f08e80ea5c8d956. Line numbers refer to that base. Every hit is listed, including comments and locally bound functions that do not call a native dialog.Swept:
git grep -nE '(window\.)?\bconfirm\(' fe40b96e24000a7f070741966f08e80ea5c8d956 -- website/src/components ':!*test*'Sibling: website/src/components/AppConfirmHost.tsx:33 -- not affected -- delegates to the existing in-app useConfirm hook.
Sibling: website/src/components/ArtifactPanel.tsx:137 -- not affected -- draft discard already uses the in-app useConfirm hook.
Sibling: website/src/components/BottomTerminalPanel.tsx:468 -- not affected -- terminal close already uses the in-app useConfirm hook.
Sibling: website/src/components/ConfirmDialog.tsx:46 -- not affected -- comment describing the shared hook, with no native call on this line.
Sibling: website/src/components/DirectDeployFlow.tsx:182 -- not affected -- confirm is the deployment flow's bound action, not a browser dialog.
Sibling: website/src/components/MarkdownPanel.tsx:521 -- not affected -- already uses the in-app useConfirm hook.
Sibling: website/src/components/MarkdownPanel.tsx:640 -- not affected -- already uses the in-app useConfirm hook.
Sibling: website/src/components/MarkdownPanel.tsx:706 -- not affected -- draft discard already uses the in-app useConfirm hook.
Sibling: website/src/components/MarkdownPanel.tsx:1123 -- not affected -- delegates to the existing in-app confirmation callback.
Sibling: website/src/components/RestartButton.tsx:19 -- changed here -- restart uses an in-app question with its existing reassurance.
Sibling: website/src/components/SidePanelLayout.tsx:160 -- not affected -- comment describing a leave-guard callback, with no native call on this line.
Sibling: website/src/components/TagManagerList.tsx:394 -- changed here -- tag deletion uses a translated in-app question with captured identity.
Sibling: website/src/components/WebAppArtifactCard.tsx:442 -- changed here -- teardown uses an in-app question with a resource list.
Sibling: website/src/components/crew/CrewEditorNextDialog.tsx:315 -- not affected -- already uses the in-app useDialogConfirm hook.
Sibling: website/src/components/crew/CrewEditorNextDialog.tsx:448 -- not affected -- already uses the in-app useDialogConfirm hook.
Sibling: website/src/components/themeEditor.tsx:306 -- tracked in #15976 -- native theme deletion belongs to a later PR in this series with the nested Radix dialog and DisplayPanel.
Pattern harvest
Rule candidate: lint
Pattern: renderer calls to native confirm, alert and prompt are already refused outside the shrink-only allowlist by
no-restricted-globalsandno-restricted-propertiesinwebsite/eslint.config.js(#15854). Remove a path when its last native call is gone, then run whole-source lint.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license. See the Licensing section of CONTRIBUTING.md.