Skip to content

fix: default confirm modal to Yes so Enter confirms actions - #27

Merged
jongio merged 1 commit into
mainfrom
fix/modal-confirm-default
Mar 21, 2026
Merged

jongio merged 1 commit into
mainfrom
fix/modal-confirm-default

Conversation

@jongio

@jongio jongio commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Problem

The ModalConfirm dialog initialized with selected=false (No button highlighted). When users pressed Enter on confirmation dialogs like "Switch to branch X?", the second Enter defaulted to No, silently cancelling the action.

This made branch switching (and any other confirm-dialog action) appear broken -- the dialog would flash and nothing would happen.

Fix

Changed ModalConfirm to initialize selected=true (Yes), so Enter confirms by default. This matches standard UX expectations where Enter on a confirmation dialog means "Yes".

Users can still press n, N, Esc, or arrow to No + Enter to reject.

Changes

  • internal/notify/notify.go -- default selected=true for ModalConfirm
  • internal/notify/notify_test.go -- updated 3 tests to match new default

Testing

All 100+ notify tests pass. Full suite (go test ./...) passes.

The ModalConfirm dialog initialized with selected=false (No), so pressing
Enter on confirmation dialogs like 'Switch to branch X?' would reject the
action. Users pressing Enter→Enter (select branch, then confirm) would see
nothing happen because the second Enter defaulted to No.

Change ModalConfirm to default selected=true (Yes), matching user
expectations that Enter confirms the action shown in the dialog.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jongio
jongio merged commit e2a923c into main Mar 21, 2026
2 checks passed
@jongio
jongio deleted the fix/modal-confirm-default branch March 21, 2026 22:08
jongio added a commit that referenced this pull request May 16, 2026
Squash merge of swarm/2026-05-15 branch resolving 55 GitHub issues.

Closes #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54, #55, #56, #57, #58

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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