Skip to content

fix(ui): a disabled control shows official's not-allowed cursor - #1127

Merged
Hona merged 2 commits into
devfrom
cursor-fix/not-allowed
Nov 25, 2026
Merged

Hona merged 2 commits into
devfrom
cursor-fix/not-allowed

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1105. A disabled control shows official's not-allowed cursor where official's source gives one.

Why

#1105 took away the cursors ours had and official lacks. This is the other direction: official keeps cursor: not-allowed on a disabled control, and ours showed the arrow.

  • packages/ui/src/actions/button/button.css:112-344, submit.css:79, icon-button/icon-button.css:74-126, forms/switch/switch.css:146, packages/session-ui/src/components/question-prompt.css:140: not-allowed on :disabled.
  • Desktop's cursor reset (packages/desktop/src/renderer/styles.css:44) is :not(:disabled), so it leaves these alone.
  • A loading button keeps the arrow (button.css:232).

What changes

Each of these was traced to its official twin:

  • A dock's disabled button, and the question dock's progress segments while an answer is being sent.
  • Disabled ghost and icon buttons in Settings (Worktrees' More options and Delete while busy).
  • Home's Add project buttons while the server is down (home/projects/view.tsx:250, :541).
  • A disabled preview control in an Office file, and a plugin's disabled switch.
  • Disabled dialog buttons that are not loading: Continue, Connect, Finished, Save (rename), Delete (worktree), Select folder. They go through one helper, opencode_ui::widgets::not_allowed.

A disabled control has no handler, so it is not a hit target; each one takes the pointer (.hit()) so its cursor shows.

Left as they are, because official shows the arrow there:

  • A disabled question option: a div[data-disabled], which the reset names.
  • Home's disabled project rows: cursor-default.
  • The find bars' step buttons: plain buttons with no cursor rule.
  • Disabled group triggers in Settings › Models: settings.css:1545.

Each new call is listed in scripts/cursor-allow.txt with its official line.

The run

This PR's CI build (Windows x64) beside the published 0.0.0-dev-484 and #1105's build. A real window; the cursor the window's own thread set, read once the pointer has rested on each element. Whether a control is disabled in the scene is read from the tree's accessibility state.

element dev-484 #1105 this PR official
connect dialog: Continue (disabled: no model is picked) arrow arrow not-allowed not-allowed (button.css:224)
composer: Send (disabled: the prompt is empty) arrow not-allowed not-allowed not-allowed (submit.css:79)
question dock: Next (enabled) hand arrow arrow arrow
question dock: Dismiss (enabled) hand arrow arrow arrow
question dock: an option hand arrow arrow arrow
question dock: the custom answer's mark hand hand hand hand (question-prompt.css:390)
question dock: the custom answer's field I-beam I-beam I-beam I-beam
no server: Retry connection (enabled) arrow arrow arrow arrow

47 stops on this build (the session, Home, Settings, the question dock, the connect dialog, the no-server page): 45 the same as official, 1 not read (Home's Add project, the first stop of its window; #1105's build read the arrow there and this PR does not change the enabled button), 1 where official is not settled (an answered question's text). Nothing that #1105 fixed moved.

Not run

  • The other controls this PR touches are by reading only: the scenes at hand do not put them in their disabled state (the question dock while sending, Worktrees while busy, Home with a server down, a disabled preview control, a plugin's disabled switch, the rename, delete-worktree and folder dialogs).
  • macOS and Linux. By reading: NotAllowed is the system's own cursor on each.

Not in this change

Buttons that are disabled only while something runs (Refresh, Open link, Sign in, MCP actions), disabled text fields and selects: not traced to their official twins yet, so they stay on the arrow.

Hona added 2 commits November 25, 2026 14:03
Official keeps cursor: not-allowed on a disabled button, icon button, switch and progress segment (button.css, icon-button.css, submit.css, switch.css, question-prompt.css); Desktop's cursor reset is :not(:disabled). Ours showed the arrow. The traced ones take it now: a dock's disabled button, the question dock's progress segments while sending, disabled ghost and icon buttons in Settings, Home's Add project while the server is down, a disabled preview control, a plugin's disabled switch, and disabled dialog buttons that are not loading (Continue, Connect, Finished, Save, Delete, Select folder).
@Hona
Hona marked this pull request as ready for review November 25, 2026 05:07
@Hona
Hona merged commit 2f86510 into dev Nov 25, 2026
7 checks passed
@Hona
Hona deleted the cursor-fix/not-allowed branch November 25, 2026 05:07
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