Skip to content

Refuse focus, not just activation, on a click over a disabled control - #57

Merged
flipbit03 merged 1 commit into
mainfrom
worktree-fix-disabled-del-click-focus
Aug 27, 2026
Merged

Refuse focus, not just activation, on a click over a disabled control#57
flipbit03 merged 1 commit into
mainfrom
worktree-fix-disabled-del-click-focus

Conversation

@flipbit03

Copy link
Copy Markdown
Owner

Clicking a disabled detail-pane control (e.g. the greyed-out [Del] on a live Claude session) did not run the action, but it still moved detail focus onto the control. A focused control renders with the full accent style whether or not it is enabled, so the disabled button lit up as if it had activated — a purely visual lie.

A click on a control drawn as disabled is now inert entirely: it neither fires nor takes focus, matching how the Textual build treated disabled widgets. Keyboard navigation is unchanged — the cursor can still pass over and rest on a disabled control, where the legible focused style is deliberate.

The click resolves against the drawn_items snapshot before touching focus, for the same reason activation always did: the snapshot is the frame the user clicked on.

Verified with tu: clicking ↓ Git Pull (No remote) leaves it grey with focus untouched; clicking the enabled Add Worktree still opens the modal. make check passes; the existing a_disabled_control_does_not_activate test now also asserts focus stays put.

A click on a control the frame drew as disabled did not run its action,
but it still moved detail focus onto the control — and a focused control
renders with the full accent style, indistinguishable from an enabled
one. Clicking a live session's greyed-out [Del] therefore lit it up as
if it had activated. A click on a disabled control is now inert
entirely: no focus move, no action, exactly as Textual treated disabled
widgets. The keyboard cursor can still rest on one; only the mouse path
changes.
@flipbit03
flipbit03 merged commit d81f4c3 into main Aug 27, 2026
2 checks passed
@flipbit03
flipbit03 deleted the worktree-fix-disabled-del-click-focus branch August 27, 2026 18:22
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