Skip to content

Switching branches with pending changes does not disable switch button #23030

Closed

Description

@SnakyBeaky

The problem

Switching branch when having pending changes in the current branch, pops up a dialog that prompts the user to either leave the changes or bring them. However, after clicking the Switch branch button, only the radio buttons are disabled, the switch branch button is still clickable (even though it does not do anything), which might be confusing to the user.

Release version

3.6.7

Operating system

Windows 11

Steps to reproduce the behavior

  1. Generate any change in the current branch (add/modify/delete any file)
  2. Switch to a different branch
  3. Click the "Switch branch" button in the popup
  4. The radio buttons are disabled, but not the switch button

Log files

No response

Screenshots

Before clicking (radio buttons, and switch button enabled)

image

fter clicking (radio buttons disabled, but switch button is still enabled)

image

Additional context

No response

Activity

  1. desktop-triage commented on Oct 16, 2026

    @desktop-triage

    Triage summary: This is a confirmed UI/UX bug: after clicking "Switch branch" in the stash-changes dialog, the radio buttons visibly grey out but the "Switch branch" button itself keeps its enabled appearance (and remains focusable), even though it's functionally inert. Suggesting bug with priority-3 since it's cosmetic/confusing but has no data-loss or workflow-blocking impact, and a workaround (simply not clicking twice) exists.

    Initial hypothesis: The dialog (StashAndSwitchBranch in app/src/ui/stash-changes/stash-and-switch-branch-dialog.tsx) sets disabled={isStashingChanges} on the surrounding Dialog, which wraps its children in a native <fieldset disabled> (see app/src/ui/dialog/dialog.tsx#L950-L952). A <fieldset disabled> correctly disables native form controls like the radio buttons, matching the reporter's screenshot, but OkCancelButtonGroup's "Switch branch" button (rendered at lines 73-75) is never passed an explicit okButtonDisabled prop tied to isStashingChanges, and Button's custom onClick/styling logic (app/src/ui/lib/button.tsx#L231-L248) depends on its own disabled prop rather than purely on fieldset inheritance for visual state, which is why it can still appear clickable. A related, already-open fix is tracked in #23028 ("Disable switch branch button while switching branch"), which this issue is linked to as the closing PR — once merged it should resolve this report.

    Duplicate Check: No duplicate issue found. Searched "switch branch button disabled", "stash changes switch button", and related terms — found only tangentially related stash issues (#21904, #12699, #20919) that describe different problems (stash+rebase interaction, multiple-stash support, and a now-closed indicator request), none of which report this specific disabled-button inconsistency.

    Generated by Issue Triage (skills-driven) for #23030 · auto · 58.4 AIC · ⌖ 1.25 AIC · ⊞ 9K · ◷

  2. added
    bug
    priority-3
    on Oct 21, 2026
  3. added
    help wanted
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bughelp wantedpriority-3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions