~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Languages are typed and picked from what matches, above them those chosen, in one field

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:web/language-picker

What changes

Languages, in one field. A group's languages are chosen in one box that looks like a field: those chosen sit across its top, each a button that takes it off ("Slovenian ×"), over a full-width field to type into. What matches what is typed drops down, those starting with it first; a click or Enter picks one, the field clears and the list stays open for the next. Enter in it never sends the form. A hint under it says how many it takes ("Choose up to five.", as Topics says its ten); at five the field goes, and the hint says why. A screen reader hears each added or removed, and focus goes back to the field when a language is taken off.

PickMany, a molecule for choosing a few of many, holds this, so another such field (topics, say) can be one too. Its drop-down list shares its rules with the handle field's, now .drop-list and .drop-option, which scroll past --drop-list.

Why

The list to add a language sat to the right of those chosen, pushed further along with each one. Of the ways to choose several, the one that tested best with disabled users in Sarah Higley's study (https://www.24a11y.com/2019/select-your-poison-part-2/) shows those chosen as buttons above a combobox: 98% of tasks done. Buttons inside the field itself did worst of the button kinds: the field shrank under them, which low vision and pointer users struggled with, and screen readers' scan mode missed them. Enter sending the form by accident was its most common trouble, so Enter here only picks.

How it was checked

  • The e2e flow types "pol" and presses Enter, picks English by a click, adds German and takes it off, finding focus back in the field, then finds Polish and English after saving.
  • A fresh agent critiqued the pictures; for it, the list now meets the box's edges, the chips start where its text does, the limit is a standing hint, and each × is darker.
  • Looked at with just look: none chosen (as tall as any field), two, five (the note), and with "en" typed and the list open, on desktop light and phone dark.

🤖 Generated with Claude Code

c-typed.png

c-five.png

c-bare.png

c-typed-phone.png

Approved

This replaces the language select and chips with a new PickMany molecule: chosen items sit as buttons over a combobox, Enter only picks, and the list stays open for the next. HandleInput now shares the renamed .drop-list and .drop-option rules. I read the whole diff and found nothing that must change. The e2e flow covers typing, Enter, click, removal and focus return. Form submission is unchanged: a blank language value plus one per choice, as before. Languages already saved but not in the offered list are still shown through choices.

Two small things to consider, neither blocking:

  • Picking the fifth language removes the input while it has focus, so focus drops to the page. Moving it somewhere sensible, such as the last chip, would help keyboard and screen-reader users. The 'removed' case already restores focus.
  • Enter during IME composition would pick an item. Checking e.isComposing would avoid that.
Approved

Round 2. The only change since my approval is the last commit. The list now opens only on click, typing or arrow keys, not when focus returns after a removal. That is a sound fix: onfocus no longer opens it, drop refocuses the field with the list shut, and the e2e flow now checks both focus and the closed listbox. I found nothing that must change.

My two earlier non-blocking notes are still open, and you can take or leave them:

  • Picking the fifth language removes the focused input, so focus falls to the page.
  • Enter during IME composition still picks. A check on e.isComposing in keydown would stop that.
Merged as dc64028