Repository navigation
studio: compact the chat composer and add animated expansion - #10863
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d0b2952d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .aui-thread-welcome-center:has([data-writing-expanded="true"]) { | ||
| padding-top: 1rem; |
There was a problem hiding this comment.
Override the welcome padding from the utility layer
When the composer is expanded on an empty thread, this rule does not override the pt-[27.5dvh] utility on .aui-thread-welcome-center: it is declared inside @layer components, while Tailwind's utilities layer has higher cascade priority regardless of this selector's specificity. The welcome content therefore remains over a quarter-viewport down, which can push the expanded editor's toolbar below the viewport; move the override to the utilities layer or remove/conditionally replace the padding utility.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Checked this one and it does not reproduce. index.css opens @layer utilities at line 1066 and does not close it before these rules, so .aui-thread-welcome-center:has([data-writing-expanded="true"]) and Tailwind's .pt-[27.5dvh] sit in the same layer and specificity decides: 0-2-0 against 0-1-0, so the override wins. Measured on a running Studio built from this head, the computed padding-top goes 247.5px to 16px when the composer expands, identically in Chromium, Firefox and WebKit. Leaving the rule as is.
|
The expand and collapse control looks like a self-contained addition, but the same branch also restyles the composer surface and removes the narrow-width padding rules in index.css around the 23.5rem and 16rem container queries, and the body says the final validation was not rerun. Could you split the expansion from the spacing and glyph changes, and confirm the small-window layout still holds? |
|
This drops the composer-shell padding overrides at 30rem, 23.5rem and 16rem in studio/frontend/src/index.css that were added for narrow panes, and bundles the mic and send glyph rework in with the new expand control; could you confirm the narrow-width layout still fits, and split the icon changes out so the expansion feature can be reviewed on its own? |
…rinking it Three fixes on top of the compact composer work. Restore the input's onKeyDownCapture to notePlainPasteChord and move the Escape collapse onto the editor wrapper. The inline handler broke the guard in pasted-text-attachment.test.ts, which asserts that slot belongs to the plain-paste chord; base passes 34/34, this branch was failing 1. React dispatches an ancestor's capture handler first, so the collapse still runs first. Dropped the preventDefault/stopPropagation with it: assistant-ui's cancelOnEscape listens on the document with capture:true and has already run by the time any React handler sees the key, so those two calls read as if they suppressed the cancel while doing nothing. Reset the expansion in armJustSent instead of beside send(). handleSubmit returns before the send on three queueing paths (a run in flight, a queue already active, the Cmd/Ctrl+Enter chord) and all of them empty the composer through armJustSent, which is documented as the shared hook for exactly that. Resetting next to send() alone left a queued prompt behind a tall empty box. Bound the expanded height below by the height the draft already had. On a short window 80svh - 12rem resolves under the twelve-row compact height, so expanding a long draft made the writing area smaller and started clipping text that was fully visible: measured 304px unclipped compact against 192px clipping expanded at 900x480, identically in Chromium, Firefox and WebKit. Also svh rather than dvh, since this height is transitioned and the dynamic viewport tracks mobile Safari's address bar as it collapses. Verified with the frontend suite (7429 pass), tests/studio/playwright_composer_icons.py (1296 icons centered) and a computed-geometry sweep of the shipped bundle over Chromium, Firefox and WebKit at 13 widths: no expand shrinks or clips, and no horizontal overflow in any of 702 cells.
The rename to "Start dictation" broke the Windows UI lane:
tests/studio/playwright_extra_ui.py locates the control with
get_by_role("button", name = "Dictate"), and Playwright's name option is a
case-insensitive SUBSTRING match, so "Dictate" does not match
"Start dictation" ("dictate" is not a substring of "dictation").
The accessible name is a contract for screen readers and for anything
scripting the UI, and refining the glyph did not require renaming it, so
restore it rather than rewriting the test to follow.
|
@codex security review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
pre-commit.ci run |
ComposerPrimitive.Unstable_TriggerPopover registers a composer-input plugin whose handleKeyDown calls preventDefault() and closes on Escape, and assistant-ui runs that plugin from a document listener registered with capture:true. preventDefault does not stop propagation, so the event still reached the wrapper's React capture handler and one Escape both dismissed the @-mention popover and collapsed the composer. Gate the collapse on the event not already being defaulted. Document capture runs strictly before React's root-container capture, so the flag is set by the time this handler sees the key.
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
The toggle appeared on the first keystroke, so every one-line draft got a control next to it. Show it once the draft has actually outgrown the compact box: a hard break from Shift+Enter, or wrapping past row 3. A multi-line paste leaves the same hard break, so it counts too. The row count comes from autosize's onHeightChange, not the live textarea's scrollHeight. The expanded editor sets min-height and max-height to 100% on the input, so scrollHeight reports the expanded box and would pin the count at the row cap once expanded. Autosize measures a detached clone and its SIZING_STYLE copies neither property, so its count stays tied to the text. Also move the toggle 4px up and 4px right, which puts it 10px from the surface edge, matching the surface padding.
|
Pushed a follow-up to this branch (788f392). Toggle visibilityThe expand control appeared as soon as the composer had any text, so a one-line draft got a button beside it. It now shows only once the draft has outgrown the compact box:
It stays visible while expanded, so there is always a way back to collapsed. Where the row count comes fromWorth calling out, because the obvious implementation is wrong here. Reading The count comes from autosize's Icon positionMoved 4px up and 4px right, Checks
I have not re-shot the before and after images, so the third screenshot above still shows the toggle on a short draft, which is no longer when it appears. The description line "when a draft is entered" is stale for the same reason. Neither is re-verified in a browser on my side yet. One open question
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…lish (#15232) ## Studio: control heights, composer fades, API page layout, settings polish A round of UI fixes on top of #15122 (one padding for every main button). ### Fields and pickers line up with buttons - In Settings, every option dropdown (selects and picker-style menus, 55 across the tabs) has one height, a filled Button's, with 14px sides, a pill shape and regular text-sm; they were 32, 34.75 or 36px with some at 11.25px, 12px sides or 16px corners. Scoped to `[data-settings-dialog]`, so other pages keep their pickers; action menus (Export, Delete all) keep the button look. - New `h-control` / `size-control` utilities give a field or picker the filled Button's height (label line + 7px padding + 1px border) at every UI font size. - Applied only where a field or picker shares a row with a filled button: Settings rows (HF token and endpoint, upload cap, idle seconds, sandbox memory, llama.cpp path and backend, LAN port and addresses, first-token timeout, dictation search and sort, embedding model picker), the accounts search, the API key form, Projects and Tasks search, and the Hub folders dialog. Shared `Input`, `SelectTrigger` and icon `Button` defaults are unchanged, so Images, Video and other pages look as before. - Dropdown rows round up to a whole pixel (`min-h-menu-row`), so the last hover pill and the menu's bottom edge no longer sit between pixels. A label pads itself the same way. ### Composer - The circular Stop buttons (Stop generating, research, queued message, dictation) draw their square at about 31% of the circle, up from 26%, and the queue Resume button's play glyph is 1.125x the icon size (18px at the default scale, from 16px), about a third of the circle's height. The send arrow keeps its size. - Stop, Send and Resume glyphs round up to an even pixel size, so their offset in the circle is a whole pixel. At UI scales where the glyph came out fractional (13.125px Stop, 19.5px Send) the browser snapped it up and left; measured at 2x, Stop sat 1px left and 0.5px up, Send 0.5px both ways, and both are now centred. Browsers without CSS `round()` keep the unrounded size. - Text cut off at the bottom fades; the last line of any draft gets a faint fade on its descenders, and lines scrolled past the top fade once you scroll. - The scrollbar sits 8px from the composer edge instead of 14px; text does not move. - On the welcome screen, expanding the composer keeps its bottom edge fixed and grows upward. Before, the whole composer jumped up and grew only to a viewport clamp that, on a short window, barely exceeded a long draft's compact height (#10863). - Attachment tiles are 14px round instead of 16px. The remove X is white in light mode and black in dark mode with a 1px outline. - The scroll-to-bottom button has a 0.5px ring. Its edge came from the outline Button border that #14919 replaced with a fill. ### Chat messages - The context usage popup (Chat header and API page) uses the dropdown surface instead of the black tooltip: popover background and text, the menu radius, the body font, the menus' soft shadow in light mode and page-coloured glow in dark mode. - The Response stopped bar's Resume icon sits on its label's centre line instead of 3.4px above it. As the button's last element (the label was bare text), the icon lost its bottom margin to the message's trailing-margin reset, so its box centred off-axis, and the button took the trailing-icon padding. The label is a span now. - The composer's solid play (Resume queue) is optically centred in its circle: its box was exactly centred, which left the triangle's weight 1.7px left of the middle; it moves right by 1/12 of its width. - Numbered list markers stay inside the message column. A fixed 1.25rem gutter let "10." (and "1." at a larger chat font) hang past the composer's edge; the gutter is now in em and widens at 10 and 100 items. ### API page - The model picker sits in the top-left bar like Chat, Images and Video, with Chat's label size and font. With nothing loaded it reads Load models, since the page can serve several. - The Base URL card lists every served model the same way, one or many ("1 model answering requests", "No models loaded"). Each row has the code example beside its name and Run settings, Reload and Eject at its end. - Card buttons read Reload / Eject for one model and Reload all / Eject all for several. Reload all reloads every served model, kept ones first so the primary stays primary; with nothing served it reloads the last local load as before. The reload logic moves to `use-api-model-reload.ts`. A row reloads by its checkpoint (not a kept slot's public alias), an MLX precision folder reloads as a model rather than a GGUF quant, and an AMD NPU model goes through the NPU loader, as the picker does. - Each row shows Context with Chat's context chip, its ring in front of the count and sized like the row's other icons: the latest request's prompt plus reply against that request's window. Hover shows the usage, prompt and completion split; a click pins it until a click elsewhere or Escape (`pinOnClick`, opt-in, so Chat's chip is unchanged). Only requests since the model's latest load count, and requests logged as `<id>:<quant>` match their model. - The row icons and the Context chip share one hover: the icons take the chip's colour in dark mode, the chip takes the icons' colour in light mode, and on this page the chip hovers as a full pill (`hoverClassName`, opt-in, so Chat's chip is unchanged). - A row's code example icon shows only while that row is hovered or the icon has keyboard focus (always on touch). Rows are subgrids rather than `display: contents`, so the whole row, gaps included, is the hover target. - After Context each row shows Speed (generation tok/s), Total time (average per request: queue wait, prompt processing and generation) and Requests (with errors in red), over requests since the model's latest load. Icons stand in for the labels (the lightning and timer from the request log, arrows for requests); the label stays in the hover title and for screen readers. - The page works at every width down to phones. Under a narrow card a model row stacks: the name on its own line (wrapping, never cut), then the facts and its buttons. The summary tiles go 2, 3 or 6 across by the page's own width rather than the window's, so the sidebar no longer squeezes six tiles into cut-off labels, and the settings button stays beside the title. - The rows drop the Slots fact. It only existed for the primary model, read "0/4 busy" nearly always, and opened the same Run settings as the gear; queued requests still show under In flight. - Fixed: after the code example dialog closed, the Context popup never opened again. The shared Tooltip latched every controlled tooltip shut when a modal opened, until its owner next said false; one that was already shut never says it again. The latch now applies only to a controlled tooltip that was open. - Empty-state icons are borderless circles; the saved load settings forget button is red. - The page fades into the sticky picker bar with Chat's 24px header fade instead of cutting off under it. ### Hub - The Run button's label and play icon are white in both themes (they used the success foreground, which is dark), and it has 15px of right padding against 12px on the left, since the play glyph's empty side already reads as left padding. ### Audio - The Record button (Clone, Edit and the other pages with an Upload / Record / From history source) uses the composer's microphone instead of Hugeicons `Mic01Icon`. ### Settings and sidebar - Settings > API: Create token uses the dark action button and is never disabled for an empty name. An unnamed token is called New Token N, one past the highest N in use (translated in every locale); the name field reads Token name. The expiry presets and Create token have tooltips (Create token names the token it will make). - Settings > API: access tokens are a table with Name, Token, Created, Last used and Expires columns. The token created panel, its field and the rows use the standard settings card, input and hover styles instead of the green panel, and the field no longer draws a focus ring around the preselected token. - Settings > API: the row menu adds Regenerate token, which makes a token with the same name and expiry period and then revokes the old one, after a confirmation. The new token is created first, so a failed create leaves the old one working. - Settings > API is regrouped: access first (tokens, usage examples, keyless access, MCP access), then the monitor link and model controls (memory, auto-switch, aliases), then the audio, image and video, and decision APIs. - Danger zone draws its divider above the heading, not under it. - Card icons (Remote access, LAN, Keyless API, MCP, Decision API, monitor) are borderless filled circles in both themes. - Sidebar New pills use the API page's green chip (`Badge` variant `accent`); #14938 had turned them grey through the shared secondary fill. - The sidebar More menu has pill hover rows in a matching corner radius. - The remaining lucide trash icons (API saved settings, prompt storage, OpenAI code exec, research panel, generation presets) use the Hugeicons `Delete02Icon` used everywhere else. - Controls that reload something draw Hugeicons' two-arc reload glyph (`Refresh04Icon`, re-exported as `ReloadIcon` from `lib/reload-icon.ts`; the package's own `ReloadIcon` is an older shape with bent arc ends): Images and Video Reapply (reloads the model), the in-app browser's Reload and Run again, and the browser tab menu's Reload (was lucide `RotateCw` / `Refresh01Icon`). Refresh, retry, regenerate and update keep `Refresh01Icon`. - Settings > Resources lists Model memory right after GPU devices, above the inference engine sections. - Settings > API gets a Model memory section with the two rows that decide what the server can answer: Keep model in GPU memory and Keep multiple models loaded. Same controls and saved values as Resources (`ModelMemorySection variant="api"`). A System settings link beside the heading opens System settings scrolled to Model memory for the rest (label in every locale). ### UI parity - The studiobench thread-structure check reports every action's thread scaffolding 84 or 172 characters longer. That is intended: it is the composer's new fade wrappers and control-height classes around the thread, not message content. The PR carries the `affects UI#` label for it. - The startup bundle budget is raised by this PR's measured growth (2,639 B raw / 717 B transfer, mostly the new strings in the eager locales), with the numbers in the comment above `BUDGET`. - The queue Resume glyph is deliberately right of geometric centre (optically centred), so `playwright_queue_localization.py` now asserts that offset instead of exact centring. ## Verification - `npm run typecheck`, `npm test` (13,947 pass, 0 fail), `npm run i18n:check:strict`, `npm run build`. - An isolated Studio from this branch, driven with Playwright: - A scan of every page and Settings tab for a filled button beside a control of a different height found 13 mismatches before and none after, at UI font scales 0.8, 1 and 1.25. - Menus measured at whole-pixel row heights with equal top and bottom gaps (8px / 8px, 6px / 6px). - Welcome composer expansion keeps the bottom edge fixed (650px window: 296-650 to 133-650; 900px window: 376-522 to 144-522). - The API card was checked with one real GGUF model and with three models (two faked in the browser by rewriting the status responses). - The API page at 375, 768, 1024 and 1440px wide: no horizontal overflow, and the row's ring and icons measure 14px on one centre line. - Token regenerate run against a token the script created with a 30 day expiry: the new token kept 30 days, the old one was revoked. ## Not covered here - Reloading several real models at once (keep-models-loaded mode) was not exercised; it was checked with one model and by reading the runtime code. - Desktop (Tauri) builds were not run from this host; the list marker fix was checked in Chromium with overlay scrollbars.
Reduce the chat composer's outer padding from 12px to 10px, tighten the gap between text and controls, and keep proportional spacing around the plus and send buttons. Refine the send arrow and microphone glyphs.
Add an animated expand/collapse control in
thread.tsxwhen a draft is entered. The writing area grows within the chat while keeping the textarea mounted to preserve the draft, selection, and undo history. Escape, sending, or switching chats restores the compact composer.index.cssbounds the expanded height to the viewport and respects reduced motion.Checks
npm run buildpassed and the focused composer icon tests passed (3 tests).Before and after
Both halves are separate Studio installs built from source, BEFORE at the merge base and AFTER at this head, driven through the same scene. The numbers under each shot are read from the live DOM of the server that was photographed, not measured off the image.
Empty composer. Surface padding 12px to 10px, corner radius 32px to 28px.
A wrapping draft, still compact. The expand control appears once there is text; the merge base has no such control.
Expanded. The editor grows from 84px to 528px in place, the welcome column's top padding drops from 247.5px to 16px so the toolbar stays in view, and Escape puts it back with the draft intact.