Skip to content

fix(web): use themed confirmation dialogs - #5624

Merged
maria-rcks merged 6 commits into
pingdotgg:mainfrom
StiensWout:t3code/themed-confirmation-dialogs
Aug 10, 2026
Merged

fix(web): use themed confirmation dialogs#5624
maria-rcks merged 6 commits into
pingdotgg:mainfrom
StiensWout:t3code/themed-confirmation-dialogs

Conversation

@StiensWout

@StiensWout StiensWout commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Rebased onto the newest upstream/main (1a003e383ac6) and addressed the review feedback. The shared themed confirmation coordinator now carries an explicit confirmation intent: destructive actions render the existing T3 destructive/red button variant, while normal confirmations keep the standard primary button.

Deletion, worktree removal, project removal, checkpoint revert, settings reset, and SIGKILL confirmations are destructive. Archive, update/install, and informational confirmations remain normal. Native macOS context menus remain unchanged.

Verification

  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/desktop typecheck
  • targeted Oxlint on all changed confirmation files
  • vp fmt --check
  • git diff --check
  • focused Vitest invocations retried after vp i; both still fail before test execution because of the repository's runner/configuration bootstrap errors (zero test bodies run)
  • CI will re-run the full test job for the new head
  • before/after deletion confirmation evidence is inline below
    Before: native Electron confirmation (pre-PR)
    After: destructive delete-thread dialog

Scope

Mobile native alerts, CLI prompts, Electron message/error boxes, and native macOS context-menu behavior remain unchanged. The renderer confirmation path fails closed when no themed host is mounted.

Model/harness: gpt-5.6-luna via Codex.


Note

Medium Risk
Changes how destructive actions (updates, SIGKILL, deletes via LocalApi) are confirmed; fail-closed behavior when no host is mounted could block actions in edge cases.

Overview
Replaces native browser and Electron confirmation flows with a shared in-app AlertDialog so destructive prompts match the rest of the UI on web and desktop.

A new confirmDialog coordinator queues requests, handles close transitions, and exposes ConfirmDialogHost from the root route. LocalApi.dialogs.confirm now goes through requestConfirmDialog when a host is mounted; if none is registered it returns false instead of calling window.confirm or the desktop bridge.

The Electron confirm IPC path is removed (ElectronDialog.confirm, CONFIRM_CHANNEL, preload confirm, and DesktopBridge.confirm in contracts). Call sites that used window.confirm (update install, SIGKILL in diagnostics/telemetry) now await ensureLocalApi().dialogs.confirm, with pending-state guards to avoid double submissions.

Reviewed by Cursor Bugbot for commit 01be733. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Replace native window.confirm with themed in-app confirmation dialogs

  • Introduces a confirmDialog coordinator module (confirmDialog.ts) with a pub/sub state machine that serializes confirmation requests, supports a destructive visual variant, and resolves pending dialogs when the host unmounts.
  • Adds ConfirmDialogHost.tsx, mounted in the app root, which renders an AlertDialog driven by the coordinator state and handles confirm/cancel/close lifecycle callbacks.
  • Updates LocalApi.dialogs.confirm to route exclusively through the coordinator, returning false when no host is registered, and removes the previous window.confirm and desktop bridge fallback paths.
  • Removes the Electron confirm IPC handler, ElectronDialog.confirm, CONFIRM_CHANNEL, and desktopBridge.confirm from the desktop layer entirely.
  • All destructive actions (delete thread, remove project, SIGKILL, install update) now pass { variant: 'destructive' } to dialogs.confirm for consistent styling.
  • Risk: window.desktopBridge.confirm is permanently removed; any external caller relying on it will receive no response.

Macroscope summarized 2e4424a.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26c755d8-2c23-4055-b5a8-a5ca48eac708

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 7, 2026
Comment thread apps/web/src/components/sidebar/SidebarUpdatePill.tsx
Comment thread apps/web/src/components/settings/DiagnosticsSettings.tsx
Comment thread apps/web/src/components/ConfirmDialogHost.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new themed confirmation dialog system with state management and queue handling, replaces the existing Electron IPC-based confirmation flow, and changes user-facing UI behavior across multiple components. The scope and architectural changes warrant human review despite good test coverage.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/components/settings/DiagnosticsSettings.tsx
Comment thread apps/web/src/components/settings/DiagnosticsSettings.tsx Outdated
@StiensWout
StiensWout force-pushed the t3code/themed-confirmation-dialogs branch from d144c50 to c99087a Compare August 7, 2026 19:56
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). and removed vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 7, 2026
Comment thread apps/web/src/components/ConfirmDialogHost.tsx Outdated
@StiensWout
StiensWout force-pushed the t3code/themed-confirmation-dialogs branch from 212b3ff to 01be733 Compare August 8, 2026 05:16
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Aug 8, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 01be733. Configure here.

Comment thread apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx
@StiensWout
StiensWout force-pushed the t3code/themed-confirmation-dialogs branch from 01be733 to bdac288 Compare August 8, 2026 17:34
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 8, 2026
@Bil0000

Bil0000 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This was much needed, but was thinking of making dangerous btns red (e.g confirm deletion, etc)

@StiensWout
StiensWout force-pushed the t3code/themed-confirmation-dialogs branch from bdac288 to 2e4424a Compare August 9, 2026 14:54
@StiensWout

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion. I adapted the confirmation API so intent is explicit instead of inferred from message text: deletion, worktree/project removal, checkpoint revert, settings reset, and SIGKILL now render the red destructive action; update/install, archive, and informational confirmations keep the normal primary action. This is in 2e4424af1, rebased onto the latest main.

@maria-rcks
maria-rcks merged commit 9821bca into pingdotgg:main Aug 10, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants