Files
buzz/mobile/lib
Matt Toohey c4d3f2072b fix(mobile): stop searching the directory while prose is typed
Prose typed after a picked mention no longer runs a name search on every
keystroke. The `@` of a bound chip opens no query wherever the caret is,
so `@Bob please review the notes` sends nothing to the relay after the
pick, and moving the caret through that line sends nothing either. A
name character typed against the chip unbinds it first, so `@Bobby` is a
query again. Before, only a caret inside the chip was excluded, and every
character of the sentence went to `POST /profiles/search`.

A typed, unpicked query stops searching once the directory cannot match
it, following buzz-app's refuted-prefix rule (Mention rules, section 6):
a finished search that found nobody, for a query with a letter or digit,
refutes every longer query that continues it. The relay matches names by
prefix, so none of those can find anyone. The chooser skips their search,
reports nothing pending or failed, and closes. The next finished search
replaces the refutation, re-entering the refuted query searches again, and
an exact public key or npub is never skipped, since a name prefix cannot
refute an author lookup. Searches that found nobody are no longer kept as
cached pages.

Admission is unchanged: a short query with no local match (`@qu`) still
searches so a person outside the channel is found, and a multi-word query
that continues no local name (`@jos mar`) still goes to the directory. The
200 ms debounce and one-character minimum stay as they were.

Tests: a compose bar journey picks Bob, types a sentence and arrows back
through it with zero directory searches, then checks `@qu`, `@jos mar`,
`@alice sm` and the `@z` refutation; the search cache test covers the
refuted prefix, the key exemption and a later search clearing it. Both
guards were shown to fail under mutation. `dart format`, `flutter
analyze` and the full mobile `flutter test` suite pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-11-19 15:07:03 +11:00
..