Repository navigation
fix(web): keep composer text above its controls and center select icons - #146
Merged
Merged
Conversation
The composers on Home, a project's page and a session's page laid their controls over the bottom of the textarea, which left a bottom padding as tall as them. Once a long text scrolled, the browser brought the caret into view only as far as the textarea's edge, which put the last lines under the attach button, the project select and the Start button (Safari and Chrome alike). The controls now sit in a row of their own under the textarea (TextareaControls), and a press between them still focuses the text. The textarea's height counts its real padding instead of assuming 16 px, and each composer keeps its tallest size: 8, 12 and 10 lines, as many as showed before. The paperclip no longer shrinks on a phone, and a session's key hint truncates instead of running under Interrupt. A Select's icon sat in an inline box, so an avatar sat on the text's baseline: about 3 px high in the trigger, and up to 7 px off in the list. The icon now sits in a flex box, centered in the trigger and on its option's first line.
kalaspuff
approved these changes
Oct 20, 2026
kalaspuff
deleted the
fctl/87-the-text-in-the-composer-box-on-mobile-e
branch
October 20, 2026 16:37
kalaspuff
pushed a commit
that referenced
this pull request
Oct 20, 2026
On Home, pressing a project in the composer's project list didn't pick it. The list closed, the task field took focus, and the project stayed the same. app.fctl.sh has had this bug since #146 was deployed. No release has it yet. ## What was wrong #146 moved the composer's controls into a row of their own, `TextareaControls`. A press between the controls focuses the textarea, as a press in its margins does, but presses on links, buttons, inputs and labels are left alone. Home's project `Select` is in that row. Its list opens in the top layer, over the page, but in the DOM it is still inside the row. So a press on an option counted as a press between the controls. The textarea took focus, the `Select`'s trigger lost it, and the `Select` closed its list on that blur. Once the list starts closing it stops taking the pointer, so the click that followed missed the option. ## What changed `TextareaControls` also leaves presses in a popover alone. A `Select`'s list is a popover. ## Verification - A new unit test in `form.test.tsx` puts a `Select` in `TextareaControls`, opens it, then presses and clicks an option. Before the change, the press moved focus to the textarea. Now the trigger keeps focus and the click picks the option. - On the real Home page with `cargo xtask dev` and two projects, Playwright (Chromium) pressed the project that wasn't selected. It used a mouse, taps at a Pixel 7's size, and taps at an iPhone 15's size, the last with Safari's focus rule added as in #151. WebKit on Linux refuses the dev stack's `__Host-` cookie over http, so these runs used Chromium. On `main`, the picker stayed on Playground and focus moved to the task field in all three. With this change, it picks Notes, closes the list and keeps focus on the picker. - On a page with the same components, Playwright also used a mouse in desktop WebKit and Firefox, and taps on an emulated iPhone 15 in WebKit. Before, a press on an option picked nothing. Now it picks, and a press between the controls still focuses the textarea. - With #151 applied as well, every check of both pull requests passes. On the iPhone, a second press on the picker also closes its list. - `cargo xtask check --quick` passes. There are no screenshots: nothing looks different. Session: https://app.fctl.sh/s/ses_01M5DCMP24RSTE8CGHSVH4A4A9 Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
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.
On a phone, a long task in Home's composer ran under the paperclip, the project select and the Start button. The workspace's logo in the project select also sat higher than the project's name, on phones and on desktop.
What was wrong
The composers (on Home, a project's page and a session's page) laid their controls over the bottom of the textarea and gave it a bottom padding as tall as them. Once the text was long enough to scroll, typing brought the caret into view only as far as the textarea's edge, inside that padding, so the last lines ended up under the controls. Safari and Chrome both do this; a phone shows it sooner, because the same text takes more lines there.
A
Selectput its icon in an inline box, so an avatar (itself an inline box) sat on the text's baseline instead of in the middle: 2.9 px high in Home's project select, 2.5 px low in the new-project page's workspace select, and up to 7 px low beside the options in their lists.What changed
TextareaControlsinui/form.tsx), so text can't scroll under them. A press between the controls still focuses the text, as a press on the old padding did. At rest, every composer keeps its height and its controls their places.Textareacounts its real padding when it grows, instead of assuming the 16 px that only the bordered fields have, sominRowsandmaxRowshold for the bare composers too. With the controls out of the textarea, each composer keeps its tallest size by growing to as many lines as it showed before: 8 on Home, 12 on a project's page, 10 in a session.How I verified it
Textareagrows tomaxRowslines and keepsminRowslines plus its real padding (both fail with the old 16 px);TextareaControlsfocuses the textarea on a press between the controls without letting the focus leave, and leaves presses on a control, and with other mouse buttons, alone.cargo xtask checkpasses.cargo xtask devand Playwright, I typed a long task into each composer at 390 px in WebKit and Chromium, and compared where the last line ends with where the controls start. Onmainit ended under them in all six cases (Home in WebKit: the line ends at 581 px, the controls start at 543 px). On this branch it ends above them in all six: the textarea stops 16, 8 and 6 px above the controls.mainand this branch match pixel for pixel in a session's composer. On Home only the avatar moves (and on a phone the paperclip, now a full 32 px wide), and on a project's page only the paperclip.Screenshots
At bbac36b, with
cargo xtask dev's data.Home on a 390 px phone (WebKit, dark theme), after typing a long task:
A session's composer while its agent works, on a 320 px phone (WebKit, light theme). Before, the text and the key hint both ran under the controls:
Home's composer at rest on desktop (dark theme): nothing moves but the project's avatar.
The project select on a phone, close up:
The workspace select's list on the new-project page (light theme):
Made in the fctl session https://app.fctl.sh/s/ses_01M5CYZK8F3HY8PYV5BNN4ZV89.