Files
buzz/mobile/lib/features
Matt Toohey 38e8f2e1e0 fix(mobile): let closing punctuation select an exact mention name
A comma typed straight after `@Bob` or `@Quinn` became part of the query
and closed the chooser: `@Bob,` was notified only through the typed-name
fallback, and `@Quinn,`, a person outside the channel, was sent with no
recipient and no prompt (scenario 06). Closing punctuation typed directly
after the query now selects the exact, unique name exactly as Space does
(portable mention rules, section 5; recommendation 7), and the typed
character stays after the chip in place of the space: `@bob,` becomes a
bound Bob chip followed by `,` with no extra space.

The selecting characters are buzz-app's `mentionTerminator` set, Space,
`.` `,` `!` `?` `;` `:` `)` and the closing quotes `'` `’` `"` `”`, plus
`]` and `}` for the brackets a query opens after. `mentionTerminator` in
`mention_rules.dart` holds the set; the composer listener applies the same
exact-and-unique check it already ran for Space, through the folded name
matching, so an ambiguous `@Sam,` and an inexact `@Bo,` are not selected
and the character joins the query, and a hyphen is never a terminator.
`insertMention` takes the separator to keep after the label, defaulting
to the space. A directory-only person goes through the existing chip and
outside-channel prompt flow exactly as a tapped pick does: `@Quinn,` is
a Quinn chip, and sending meets the prompt. The edit sheet and focus
handling are unchanged.

Tests: the chip journey selects Bob with each terminator and sends the
chip text with Bob tagged, and keeps `@bo,` and `@bob-` unselected; the
search journey selects a found Quinn with a comma and sends through the
outside-channel prompt as a reference; the namesake tests check that a
comma never selects a shared name. Both journeys fail when the terminator
set is reduced to Space. `dart format`, `flutter analyze` and the full
mobile `flutter test` suite pass; two full runs each hit one unrelated
timing flake (relay socket liveness, community snapshot cleanup) that
passes solo and alongside the changed tests.

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