Repository navigation
fix(ui): a disabled control shows official's not-allowed cursor - #1127
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1105. A disabled control shows official's
not-allowedcursor 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-allowedon 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-allowedon:disabled.packages/desktop/src/renderer/styles.css:44) is:not(:disabled), so it leaves these alone.loadingbutton keeps the arrow (button.css:232).What changes
Each of these was traced to its official twin:
home/projects/view.tsx:250,:541).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:
div[data-disabled], which the reset names.cursor-default.settings.css:1545.Each new call is listed in
scripts/cursor-allow.txtwith its official line.The run
This PR's CI build (Windows x64) beside the published
0.0.0-dev-484and #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.button.css:224)submit.css:79)question-prompt.css:390)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
NotAllowedis 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.