Repository navigation
feat(web): replace native selects with an animated Select - #61
Merged
kalaspuff merged 5 commits intoOct 18, 2026
Merged
Conversation
The web app chose roles, repository access, effort and projects with native <select> menus, which look like the operating system rather than fctl and can't say what each choice means. Select (components/ui/select.tsx) is a button with the keys of the WAI-ARIA select-only combobox: arrows, Home and End, Page Up and Down, Enter and Space, Escape, Tab and typeahead. Its list opens in the top layer with the Popover API, so it shows above dialogs and outside containers that clip. It grows out of its trigger, a highlight glides after the pointer and the keys, the picked option flashes before the list closes, its check draws itself, and the new value rolls into the trigger in the direction of the list. A mouse press can be dragged onto an option and released to pick it, as with native menus. Motion follows prefers-reduced-motion. Roles, repository access and session sharing describe each choice in a second line, in the words of the roles' definitions; the composer's project picker shows each project's repository. Options people can't choose (making owners, for those who aren't one) are shown disabled instead of hidden, so an owner's row no longer reads "member" to admins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
iOS Safari keeps focus on a button when people tap elsewhere, so the list now also closes on a press outside it. Cancelling pointerdown on the list cancelled taps in WebKit; cancelling mousedown keeps focus on the trigger without that. The list is never wider than the window, for triggers as wide as a phone's screen. Hotkeys treat a focused combobox like a native select, so typing to jump to an option can't trigger them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An option with an empty value stands for no choice, as in HTML, so the trigger shows it in the placeholder color: an unset effort now reads like the unset model beside it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a phone, a long project name made the composer's project picker wider than its row. The trigger may now shrink, truncating its value, when its row runs out of room, as the native select could; rows whose other items take the free space are unchanged. The start button no longer shrinks either, which clipped its label beside long names on main too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kalaspuff
deleted the
fctl/26-we-should-have-a-proper-nice-ui-design-c
branch
October 18, 2026 12:36
kalaspuff
pushed a commit
that referenced
this pull request
Oct 20, 2026
…151) On an iPhone or iPad, tapping the button of an open dropdown (a `Select`) left its list open. A second tap now closes it, as a second click with a mouse already did. ## What was wrong Safari doesn't focus buttons on click. When a tap ends, Safari sends `mousedown` and moves focus from the focused element to the nearest mouse-focusable ancestor of the pressed button, or to nothing. On macOS and iOS, buttons aren't mouse-focusable, so the trigger lost focus even though it was the button tapped ([`HTMLFormControlElement::isMouseFocusable`](https://github.com/WebKit/WebKit/blob/3c91014a71276cef809bb95b8b9ab9ea2a4c9066/Source/WebCore/html/HTMLFormControlElement.cpp#L229-L240), [`EventHandler::dispatchMouseEvent`](https://github.com/WebKit/WebKit/blob/3c91014a71276cef809bb95b8b9ab9ea2a4c9066/Source/WebCore/page/EventHandler.cpp#L3436-L3505)). A `Select` closes its list when its trigger loses focus. So the second tap closed the list on `mousedown`, and the tap's `click` found it closed and opened it again. Chrome and the other browsers on iOS use WebKit too, so they behaved the same way. A mouse was unaffected: the trigger handles a mouse press on `pointerdown` and cancels it. Cancelling it skips the `mousedown` and its focus change. Chrome on Android focuses buttons on click, so the trigger kept its focus there. ## What changed The trigger cancels `mousedown`, as its list already does. A tap now keeps focus on the trigger, and its click closes the list. Touch still opens the list on click, so a swipe that starts on the trigger still scrolls the page. ## Verification - A new unit test in `select.test.tsx` taps the trigger twice the way Safari on iOS delivers a tap: a `mousedown` that, unless cancelled, takes focus away. It failed before this change (the list stayed open) and passes now. - Playwright drove the real component and the app's styles on a test page, before and after the change. Playwright's WebKit is the Linux port, which focuses buttons on click as Chrome does. That is why the emulated iPhone in #61 didn't show the bug. So the iPhone runs also added Safari's rule: a `mousedown` on a button, unless cancelled, moves focus as Safari would. - Before: tapping twice on an emulated iPhone 15 (WebKit) with Safari's rule left the list open. Pixel 7 (Chromium), and the mouse in desktop Chromium, WebKit and Firefox, closed it. - After: the second press closes the list in all of them. Tapping or clicking an option picks it, and focus stays on the trigger. A press elsewhere closes the list. Pressing another dropdown's trigger closes the first list and opens the second. A trigger opens from a focused text field and takes focus from it. The arrow keys and Enter work after a press, and a mouse can still press, drag onto an option and release to pick it. - `cargo xtask check --quick` passes. There are no screenshots: nothing looks different. The list just closes on the second tap. 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.
The web app chose roles, repository access, Claude's effort and projects with native
<select>menus. They look like the operating system rather than fctl (on macOS: a blue highlight, a tick on the left, the system font), and they can't say what a choice means.What changed
Select(web/src/components/ui/select.tsx) replaces all eight native selects: the project picker in the floor's composer, repository access (when adding one, and per repository), Claude's effort in project settings, project roles (when adding someone, and per member), instance roles in Admin → Users, and access in the share dialog.aria-activedescendant. Arrows, Home and End, Page Up and Down, Enter and Space, Escape, Tab, and typeahead (typing a letter again moves on to the next option with it). Escape in a dialog closes the list, not the dialog. Global hotkeys treat a focused combobox like a native select.prefers-reduced-motion. The list grows out of its trigger while its options settle in one after another; a highlight glides between options after the pointer and the keys; the picked option flashes once, as menus do on macOS, and its check draws itself before the list closes; the new value rolls into the trigger, up or down the way it moved in the list; the chevron's arms swing from down to up while the list is open. Durations are 140–320 ms with the design system'soutandspringcurves.fctl-protoandfctl-domain("Also manages settings, secrets and members"). The project picker shows each project's repository. Labels are in sentence case ("Maintainer", not "maintainer").value=""is a placeholder in HTML: an unset effort now looks like the unset model beside it. On a phone, a long project name truncates in the composer instead of pushing past it, and the start button keeps its width (it was clipped beside long names before too).The component lives with the other primitives in
web/src/components/uiand uses@hyperstructure/design's existing tokens and curves, so the design package doesn't change. AGENTS.md now points agents atSelectfor choices from a list.Verification
select.test.tsx: stepping past disabled options, typeahead, opening on the selection, picking with Enter and with clicks, Escape, presses outside, the muted empty value.npm run check,npm test,npm run buildandcargo xtask checkpass.cargo xtask devand Playwright, on the real pages in Chromium and Firefox: the keyboard flow with a visible focus ring, typeahead, Tab, mouse toggling and outside clicks without a focus ring, press, drag and release, the highlight following the pointer, the list following its trigger as the page scrolls, the share dialog (the list on top, Escape closing the list and then the dialog), and your own role disabled in Admin.__Host-session cookie over plain http, so the same checks ran against the component on a local page in WebKit, Firefox and Chromium, plus touch on an emulated iPhone 15 (WebKit) and Pixel 7 (Chromium).Screenshots
The session can't attach images to pull requests (#40), so here is what they show, taken with
cargo xtask devat 1280 px in both themes:A recording of the motion, in real time at 60 fps, was shared in the session.
Session: https://app.fctl.sh/s/ses_01M57CJ21RDBHCEEA5FWCNKAGW