Files
buzz/mobile/lib
Tom Brow b80217de32 fix(mobile): end #channel tokens at apostrophes, quotes and dashes (#8860)
Mobile renders `#channel` tokens as chips, but a token followed by an
apostrophe, quote, ellipsis or dash stayed plain text: `#general's`,
`"#general"`, `#general…` and `#general—` all lost their chip because
the token only ended at whitespace or `, ; . ! ? : ) ] }`.

This ends channel tokens at those characters too (`' " ‘ ’ “ ” » … –
—`). The message body and the one-line preview each had their own copy
of the channel regex; they now share one `channelTokenPattern`, so they
can't drift apart again.

`@mention` boundaries are unchanged on purpose: on mobile and desktop
the same boundary also decides which mentions are bound and tagged when
sending, so changing it is a separate, cross-surface decision.

### Validation

Added tests:
- Preview table covering each new trailing character (and matching
opening quotes).
- Message body: `#general's` keeps the chip and renders the `'s` suffix.

Both fail with the previous boundary. The full mobile test suite passed
in pre-push.

Simulator render on an iPhone 18 Pro (iOS 27): real message-body and
preview widgets with channels `general` and `eng` loaded, rendered with
both stacked PRs applied.

| Before (`main`) | After
([#8860](https://github.com/block/buzz/pull/8860) +
[#8862](https://github.com/block/buzz/pull/8862)) |
| --- | --- |
| <img
src="https://raw.githubusercontent.com/block/buzz/5afead6a162d5c8554ad17175fc2dccff93bf2af/pr-8862--01-before-main.png"
width="300"> | <img
src="https://raw.githubusercontent.com/block/buzz/5afead6a162d5c8554ad17175fc2dccff93bf2af/pr-8862--02-after-both-prs.png"
width="300"> |

Human app test: not applicable under the mobile-client testing
exception; agent review and simulator validation above.

buzz-review-completed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
2026-10-31 09:30:23 -07:00
..