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

Fields for someone's handle suggest accounts as they are typed

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:console/typeahead

What changes

Handle fields suggest accounts as they are typed. Typing two letters or more of a handle or a name drops down the matching accounts under the field, with picture, name and handle, from typeahead.waow.tech's searchActors. The arrows move through them, Enter or a click picks one, and Escape closes the list but not the dialog around it. Enter with none chosen sends what is typed, as before. The lookup waits 150ms after typing stops, and a lookup overtaken by more typing is aborted; when the service cannot answer, the field is a plain one. The field is a new molecule, HandleInput, an ARIA combobox over a listbox, and findActors (web/src/lib/typeahead.ts) asks the service.

Where it is used:

  • the sign-in dialog, where picking an account signs in as it at once;
  • the invite dialog's "Their handle";
  • the moderation page's "Label someone";
  • the move page's "The account to move".

Outside sign-in, a pick only fills the field in, and the form still waits for its button. The page resolves the handle on sending, as it did, so an invite is still written to the account's DID. Roles are given from each member's row, with no handle typed, so nothing changes there. A new group's address is not a search, so it does not suggest.

The pages' CSP lets their scripts reach https://typeahead.waow.tech (connect-src). docs/design/signing-in.md names the service and what it is sent; the console has no privacy page.

Why

People mostly know a handle roughly, or know someone by name. Finding the account as they type spares them typing it out whole and right. The service is the one knotless uses, and it knows the whole network, so it also suggests people who are not on this host yet, such as anyone being invited.

How it was checked

  • just e2e: all 29 flows pass. The flows stand in for the service with page.route, answering with the world's accounts, since the real one cannot know the reference PDS's accounts.
  • The signed-out flow checks the field's behaviour:
    • one letter suggests nothing, and two letters suggest;
    • aria-expanded follows the list;
    • an arrow chooses a row;
    • Escape closes the list but leaves the dialog open;
    • typing more lets the arrows' choice go.
  • Two flows pick a suggestion:
    • Signing in from a group's page types alic, then ArrowDown and Enter, and goes on through the PDS.
    • The invite flow types bo and clicks Bob, and the invite is written to his DID.
  • The other handle fields, and the sign-in helper, send with Enter. A list left open now covers the button under it.
  • node harness/layers.mjs, npm run check and node harness/docs.mjs are clean.
  • I looked at the list drawn open in Playwright over the e2e world, for the sign-in dialog, the invite dialog and the label form, on desktop and phone in light and dark. It floats under the field, past the dialog's edge where it runs over, with a shadow, avatars and a highlighted row. The picture attached is the sign-in dialog, desktop light.
  • Looking turned up a bug, now fixed: Enter right after more typing picked the row the arrows had chosen in the earlier list. Typing or closing now lets that choice go, and a flow checks it.

Shortcomings

  • What is typed into these fields goes to typeahead.waow.tech, a third-party service. Proxying it through the host would keep it first-party.
  • Accounts the service cannot see, such as those on a test PLC, get no suggestions, only the plain field.
  • A long list can run past the bottom of a short screen.

🤖 Generated with Claude Code

ta-signin-desktop-light.png

Approved

This adds a HandleInput combobox, backed by findActors against typeahead.waow.tech. It is used in the sign-in, invite, label and move forms. The CSP connect-src is widened for it, and signing-in.md is updated.

I found nothing that must change. I read every changed file, and the CSP is set in one place only (web/vite.config.ts).

  • Keyboard and ARIA: Escape stops propagation so the dialog stays open. Arrow selection resets on typing and on close. Enter with nothing chosen submits what is typed, as before. The e2e flows cover these.
  • Picking with the mouse: it picks on mousedown with preventDefault, so the blur doesn't close the list first. Setting field.value directly before requestSubmit means the form sends the picked handle.
  • Lookups: they are debounced and aborted when overtaken, and any failure falls back to a plain field.

Two small things to consider later, neither blocking:

  • Results from the previous query stay visible and clickable until the new lookup returns. Clearing found when the query drops under two characters would avoid a stale pick.
  • .dialog:has(.handle-input){overflow:visible} removes the dialog's own scrolling on short screens. Your shortcomings section already notes the list can overrun a short screen.

The privacy trade-off, that typed handles go to a third party, is disclosed in the docs and in the pull.

Merged as f81836e