Skip to content

fix(components): confirm restart, tag deletion and teardown in-app - #30947

Merged
bolichen97 merged 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m03-shared-confirms
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
kirodotdev:mainfrom
abirkel:fix/native-dialog-m03-shared-confirms

Conversation

@abirkel

@abirkel abirkel commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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

  • Migrating other native-dialog callers, which have separate PRs in this series.
  • Migrating themeEditor.tsx or DisplayPanel.tsx. Their nested theme dialog needs the Radix variant and belongs to a later PR in this series.
  • Changing restart, tag or teardown APIs, tag-cache invalidation, deployment controls or the existing restart and teardown warnings.

What changed (motivation → approach → change)

The three components ask through the existing in-app useConfirm dialog. Each title is a short action label so Modal does not truncate the warning, which stays in the body.

Surface Confirmation inside the app
RestartButton.tsx Keeps the existing Apply & Restart label and full reassurance. Restart is intentionally not red because its question is nondestructive.
TagManagerList.tsx Shows Delete tag with a translated question that quotes the captured tag name using the locale's conventions.
WebAppArtifactCard.tsx Shows Tear down deployment with the existing warning paragraphs and a list of resources to delete. The visible Cancel / Tear down control and tooltip stay the same.

The 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.ts leaves outside presses to the modal, including its backdrop. boardLane.tsx leaves 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.js removes only the three migrated paths.

Shared-file overlaps at fe40b96e24:

Shared file Open PRs
Native-dialog allowlist PR #30250, PR #30515, PR #30516, PR #30517, PR #30734 and PR #30752.
website/src/test/confirmAction.ts PR #30251, #30515, #30516 and #30517. The helper matches #30251 byte for byte.
Locale catalogs Many open PRs, including #30517 and #30752 in this series. This PR adds only its three component keys.

Backwards 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 0 uses the config without the three exemptions.

Tests

RestartButton.cov80.test.tsx checks the full reassurance, Cancel without an API request, approved success and failure, pending disable and keeps one question open for repeated restart presses.

TagManagerList.test.tsx checks 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.tsx covers modal layer order, approval, Escape, Cancel and backdrop dismissal while preserving the popover. chatSlotsDeadKeyInvalidation.test.tsx retains refreshes chat-tags and tag-columns, and names no chat-slots key through the in-app question.

WebAppArtifactCard.test.tsx checks 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.ts includes 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

Restart confirmation with the full reassurance and neutral Apply & Restart action

Tag deletion confirmation with the quoted tag name

Web-app teardown confirmation with the resource list and irreversible-action warning

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-globals and no-restricted-properties in website/eslint.config.js (#15854). Remove a path when its last native call is gone, then run whole-source lint.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license. See the Licensing section of CONTRIBUTING.md.

@abirkel
abirkel requested review from a team and KiroCrewCaptain as code owners November 6, 2026 00:55
@abirkel
abirkel requested a review from chenmingwei23 November 6, 2026 00:55
@github-actions github-actions Bot added the fork Pull request from a fork (external contributor) label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 8fb5b9ff53f85322af1ee803c21e1eacc3660f2e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change swaps three native confirms for the existing useConfirm, the three screenshots are present, and removing the allowlist entries only affects lint readers, which the description lists.

Notes

  • board.ts checks document.querySelector('[aria-modal="true"]'), which matches any open modal on the page, not just the one this popover opened. While any other modal is open, an outside click won't close the column popover and its focus effect won't run. Checking whether the click target is inside the modal would tie this to the popover's own question.
  • WebAppArtifactCard now gets its owning slug and callback from mutation variables plus an activeSlug ref, and re-checks eligibility through a teardownBlocked ref assigned on every render. It works, but a later edit could easily break it. Running the teardown through a mutation keyed per slug, or remounting the card by key={artifact.slug} at the caller, would remove most of that cross-artifact bookkeeping.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 8fb5b9ff53f85322af1ee803c21e1eacc3660f2e via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The delete_tag_confirm body repeats its title: the header says "Delete tag" and the body says "Delete tag “Release review”?" (attachment-02). Make the body add something the header doesn't, for example "“{{name}}” will be removed from every chat and column."
  • No screenshot shows the column-filter case, where the tag dialog sits above the board popover (layer: 'top') and the popover stays open. Attaching that view would confirm the two layers read correctly.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 8fb5b9ff53f85322af1ee803c21e1eacc3660f2e via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (9 items) — 8 justified

Intent: 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.

  1. Apply & Restart asks in an in-app dialog, not a native one — justified
  2. Tag deletion asks in-app; the question is now translated, not hardcoded English — justified
  3. Teardown asks in-app, with resources listed as list items — justified
  4. Tag deletion re-checks the tag's state after approval and skips stale or already-deleting tags — justified
  5. A teardown's result, pending label and error stay with the card that started it; switching artifacts cancels an open question — justified
  6. Pressing again while a question is open does nothing — justified
  7. The column popover leaves outside presses and focus to an open modal — justified
  8. The column popover ignores keys coming from the portaled modal — justified
  9. A new test helper, confirmAction — duplicate of fix(dashboard): settle useConfirm asks when their dialog disappears #30251's helper

[FIRST-PRINCIPLES-REVIEWED] 8fb5b9f

Description read

[DESCRIPTION-READ] 7b2b8f19c202a9ffc9944dc18328c864f1724db1ef91ad3d22b7a72d0ff2506c

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 8fb5b9ff53f85322af1ee803c21e1eacc3660f2e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8fb5b9f

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 8fb5b9ff53f85322af1ee803c21e1eacc3660f2e via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8fb5b9f

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m03-shared-confirms branch from 3815e44 to 1ac705f Compare November 6, 2026 03:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
@abirkel
abirkel force-pushed the fix/native-dialog-m03-shared-confirms branch 2 times, most recently from 4cdc056 to 05d095e Compare November 6, 2026 04:37
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
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
@abirkel
abirkel force-pushed the fix/native-dialog-m03-shared-confirms branch from 05d095e to 8fb5b9f Compare November 6, 2026 12:36
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD (policy: data-deleting paths) at 8fb5b9f.

This PR replaces the native confirm() in front of tag deletion and cloud deployment teardown, and it changes how the target is captured and re-checked before the delete call. That is a data-deleting path, so it is reserved for a human reviewer. I found no concrete defect. Switching or unmounting the card cancels an unanswered question (WebAppArtifactCard.tsx#L311-L320). Teardown uses the slug captured at the press and is skipped when the card has expired or a teardown is already running (#L461-L484). Tag deletion re-checks the row and any in-flight delete after approval (TagManagerList.tsx#L396-L411). CI is green and all fork lanes passed.

AI notes, none blocking: the duplicated confirmAction.ts helper (identical to the still-open #30251), the page-wide aria-modal check in board.ts, the ref bookkeeping in the teardown card, and the tag-delete wording.

To clear: a human reviewer confirms the delete and teardown consent changes.

— crew-pr-reviewer (r148)

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 5718e01 into kirodotdev:main Nov 7, 2026
94 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 7, 2026
buluoray pushed a commit that referenced this pull request Nov 9, 2026
…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)
buluoray added a commit that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants