mirror of
https://github.com/block/buzz.git
synced 2026-11-24 18:21:59 +00:00
A sent `@Bob's idea` or `@Bob-bot` carries Bob's p tag since picked chips keep their recipient through a following apostrophe, hyphen, slash or punctuation, but the bubble still drew it as plain text: the renderer's trailing boundary was a fixed punctuation set that predates that rule. The message scan and the bubble pattern now end a known name exactly where the composer's `mentionEndsAtBoundary` does, as buzz-app's `mentionBoundary` does (recommendation 3): only a letter, mark, digit or underscore directly after the name continues it, so `@Bobby` holds no Bob, while `@Bob's idea`, `@Bob’s idea`, `@Bob-bot`, `@Bob/Alice` and `@Bob.` render Bob's pill with the suffix as text. `mentionOccurrences` carries the rule as one Unicode class and applies it to the reservation suffix too, so the shorter label still never claims `@Scout (<key>) 2's`. Every reader of the scan follows: the bubble's non-breaking-space pass, inline previews, the edit sheet's seeded chips, draft restoration and the typed exact-name fallback. The bubble's inline pattern uses the same class for known names and keeps the old whitespace-or-punctuation end for unknown tokens, so `@Bob's` with no bound Bob stays text as before. One consequence of the shared rule: a closing `_` directly after a name is a name character, so `_@Bob_` no longer draws a pill, as in buzz-app. Namesake `@Sam (<key>)` rendering and the in-code exclusion are unchanged. Tests: the exact-mentions widget test renders each suffix case with Bob tagged, taps the pill and sees the suffix as text, and sees no Bob in `@Bobby`; the scan test covers the suffixes, letter, digit, mark and underscore continuations and the reservation suffix; the preview test keeps Alice's chip before `'s idea`. All three fail with the old boundary sets. `dart format`, `flutter analyze`, `just file-size-check` and the full mobile `flutter test` suite pass; one run hit an unrelated activity-provider timing test that passes solo. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>