Repository navigation
fix(plugins): a busy plugin button keeps its look and its words - #1220
Merged
Merged
Conversation
…, with a 14 loader before them
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.
A plugin's busy button keeps its look and its words, as official's does.
The fault
A plugin button with
loadingdrew two ways. A small one kept its look and words with a loader before them, but stayed at full strength. A normal or large one turned into the loading look and held the loader alone: its words went away.Official has one form at every size (
packages/app/src/runtime/plugin/ui.tsx:25-41): the button keeps its look and its words, is disabled, drops its icon and shows a 14 loader before the words. The buttons the SSH plugin draws itself do the same (packages/gui-plugins/src/ssh/cover.tsx:46-59,row.tsx:59-71). A disabled button is at half strength, a contrast one at 0.4 (packages/ui/src/actions/button/button.css).Where a person sees it: the Add beside the link field in the browser's Add extension dialog, the browser's import and clear buttons, the WSL dialog's Add, and the SSH cover's Reconnect, which read "Connecting" in official while it works.
What changes
crates/opencode-plugin-runtime/src/ui_nodes.rs,button: one form for every size. The look stays, the button is disabled, the icon is left out, and a 14 loader stands before the words at the button's own 6 gap (button.css:13). The small button's gap was 4.Run
Pictures, headless at 2x in both themes, of one scratch plugin that opens a dialog of buttons at rest and busy, in five looks and three sizes: on this PR's Windows x64 CI build and on a build without the change. The build without it is another PR's build of
devas it stood two merges before this PR's base (neither merge touches a button). The dialog was pictured twice, at the normal and at the large size, since a row of busy buttons is wider after the change than the normal dialog.A busy button's own pixels are not compared between the builds, since its loader turns: what was compared there is its size, its words, its strength and what the tree says of it.
Not run: the dialogs that hold such buttons themselves (the Add extension dialog, the browser's import and clear rows, the WSL dialog, the SSH cover); a real window; macOS and Linux (compiled only).