Repository navigation
Composer: actions and settings in a menu at the bar's left; chips move into it when narrow - #677
Merged
Merged
Conversation
The composer's bar held a button each for attaching files, commands, mentions and the session settings, then a chip each for the mode, model and thinking level. In the chat sidebar, whose composer box is 344 pixels wide by default, the bar wrapped onto three rows, and the placeholder wrapped onto a second line that the one-line box cut off. - `ComposerMenu` is a menu button at the bar's left, with a menu that opens upward from it, after the WAI-ARIA menu button pattern: arrows, Home and End move through the rows, Escape, Tab or a press outside closes it, and focus returns to the button. A row that opens a picker leaves focus on the button, so the picker hands focus back to it. - Attach files, Commands, Mention and Session settings are rows of the menu at every width. A row the composer cannot use yet is disabled. - The mode, model and thinking chips stay in the bar while the composer's box is at least 480 pixels wide. Below that width they are rows of the menu showing their values, and the placeholder reads "Message the agent". `useNarrowerThan` measures the box before the first paint. - The bar no longer wraps: the chips' values shorten when space runs out. - `IconButton` passes a `ref` through to its button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GVjyjkaADPAqLvtnf3xUNs
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.
Problem
Change
One commit.
@labkit/ui's composer has a menu button at the bottom-left of its bar.ComposerMenu(composer/composer-menu.tsx) follows the WAI-ARIA menu button pattern:useNarrowerThan(base/media.ts) measures an element with aResizeObserver, before the first paint. A CSS container query could not change the placeholder text, and Chrome does not applytext-overflow: ellipsisto a textarea's placeholder.IconButtonpasses arefthrough to its button.What a person can see change
Not done
?session=the agent does not hold shows "Session … not found" in the chat. Seen while checking this, on chats that had been opened and never sent a message; the cause was not looked into, and nothing here changes it.Controls
tests/composer-menu.test.tsx, new:aria-haspopup="menu"andaria-expanded, themenuandmenuitemroles,aria-haspopup="dialog"on a row that opens a picker,aria-disabled, the checkbox row, the separator between groups, and no button with no rows;Verification
bun run check: all 28 passed;bun test1125 pass, 0 fail.E2E_PORT_API=9019 E2E_PORT_DEV=8970 E2E_PORT_BUILT=8971 bun run e2e: 180 passed, 0 failed, 14 skipped. All 14 skipped tests are in the built project: the 11 development-only pages as before, and the three new gallery tests.Linked issues
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GVjyjkaADPAqLvtnf3xUNs