Skip to content

fix: show branch-merged dialog only once, respect cancel - #1016

Open
ittaiz wants to merge 1 commit into
mainfrom
fix/dev3-branch-merged-once
Open

fix: show branch-merged dialog only once, respect cancel#1016
ittaiz wants to merge 1 commit into
mainfrom
fix/dev3-branch-merged-once

Conversation

@ittaiz

@ittaiz ittaiz commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

The "branch merged — complete the task?" confirm dialog could appear multiple times for the same task: both the branchMerged push event (App.tsx) and the 15-second polling loop (useTaskBranchStatus) could trigger it independently, and the per-hook useRef guard reset on every re-mount. Clicking Cancel didn't stop it from asking again.

Fix

A module-level Set (shownMergeDialogTasks) shared between App.tsx and useTaskBranchStatus deduplicates across both paths. The task is marked before the dialog is shown, so cancelling suppresses the dialog for the rest of the session — re-mounts and duplicate events are silently ignored.

Tests

Added App.test.tsx cases: dialog shows on first rpc:branchMerged event, is suppressed on a duplicate event, and stays suppressed after the user cancels. bun run lint and bun run test pass (1952 tests).

🤖 Generated with Claude Code

Add a module-level Set (shownMergeDialogTasks) shared between App.tsx
and useTaskBranchStatus. Both the push-event path and the 15-second
polling path check the Set before showing the dialog and mark the task
immediately on first show. Cancelling now suppresses the dialog for the
rest of the session — re-mounts and duplicate events are silently
ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant