Repository navigation
Keep the keyboard where it was through sends, removals, answers and a forming step group - #61
Merged
Merged
Conversation
… question answered or a group of calls forms Four of Solid Glass's own components dropped the keyboard's focus to the page at the moment of a state change: the composer's send mark became disabled as the text went or the turn ended, a tag's x went with the tag, an ask card's choices became disabled on the press that answered, and one call becoming the first of a group remade its row. The context ring's detail button had no focus style at all, the composer's focus-within class pointed at a border the pane does not have, and the lines of text that are buttons showed the keyboard three different ways, one of them invisible. They now share one hairline in the focus line, drawn by the stylesheet. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland@WaylanddeMacBook-Pro.local>
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.
Why
A keyboard pass over Solid Glass's own components found four places where a state change dropped the focus to the page, and three where the keyboard could not be seen:
disabledwhenever there was nothing to send, so sending from the keyboard, or a turn ending while the stop mark had the focus, left the focus onbody. Itsfocus-within:border-ring/60pointed at a border the pane sets to none, so typing showed no focus at all.disabledon the very press that answered, dropping the focus; and the card did not show which choice was taken.StepRow→ group withStepList), so an open row closed and lost its focus. Keep single-step details and focus through status updates #56 covered the same call finishing, not a group forming.childrenwent away between steps the<button>became a<div>, remounting under the keyboard.outline-noneand no focus style; the status line, reasoning summary, tag x and composer picks showed the keyboard as a change of grey alone, which is not visible in either theme; step rows showed the browser's default ring.What changes
solid-glass.css, outside the layers: the lines of text that are buttons (turn status, step row and group, ask card, tag, reasoning summary,context-ring-detail,composer-pick) get a 1px--focus-lineoutline 2px off the words on:focus-visible.Composer: the mark isaria-disabledand inert instead ofdisabled; mousedown on it is prevented so the pointer never takes the focus from the text; sent or stopped from the keyboard, the focus returns to the textarea. The pane draws its hairline in the focus line while the text is focused (focus-within:outline-1 -outline-offset-1).Tag: a layout-effect cleanup, which runs while the tag is still in the page, hands the focus to the next tag's x, else the previous, else the composer's textarea. Merges a caller'sref.AskCard: newchosenprop; answered choices arearia-disabledand stay reachable; the chosen one keeps its pane witharia-current, the others fade to words.StepGroupholds its rows' open state by id and passes it throughStepList/StepRow(openRows,onRowOpenChange;open,onOpenChange). When a second call joins an open single call the group opens with it. A row remade in the same commit for the same call takes the focus back (module-level id, cleared on the next microtask).TurnStatus: once it has had children it stays a button; with none it isaria-disabledwith no chevron.chosen; the tool-steps demo gains "Second call after 2s".Left alone, deliberately: the tag narrowing when an upload ends (the count is gone; nothing to reserve for).
Validation
npm run docs(registry.json unchanged),npm run typecheck,npm run buildpass./dev/examples: 389/389 mounted, 0 failed, dark and light.aria-disabled. Shift+Tab to a tag's x + Enter → focus on the previous tag's x; again → focus on the textarea. Ask card option + Enter → focus stays on it,aria-current="true", the other optionaria-disabledand faded. Context ring detail button:outline: solid 1px. Tool steps: open the single running call, "Second call after 2s" → "Running 2 steps" opens, the row stays open, focus is still on its button.🤖 Generated with Claude Code