Files
buzz/mobile/lib
Tom Brow 83ec9c0e2b fix(mobile): show hosted community names consistently (#8872)
When a hosted relay has no metadata name, the hosted add paths save its
host (`remote-agent-pilot.communities.buzz.xyz`) as the community name.
Onboarding shortens that fallback to `remote-agent-pilot`. After
joining, though, the community switcher, the remove dialog, the theme
preview and the identity export showed the full host, so the same
community appeared under two names.

This change shortens the name in the model instead of at each call site.
`Community` and `AddCommunityDeepLink` keep the saved value private, and
their public `name` getter returns the display form, using the existing
`HostedEnvironment.communityDisplayName` rule. Existing and future
readers get the short name without opting in. Serialization still writes
the saved value, so stored data is unchanged and no migration is needed.
Custom names and non-hosted hosts pass through unchanged, as before.
Community identity is unaffected because it uses `id` and `relayUrl`,
never the name.

Beyond the captures below, the same getter shortens the name in the iOS
push notification subtitle, onboarding's "Adding …" progress text, the
"You joined …" invite sheet, and the VoiceOver labels for removing and
loading a community.

### Before and after

| | Before (`main`) | After |
|---|---|---|
| Community switcher |
![01a-before-switcher](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--01a-before-switcher.png)
|
![01b-after-switcher](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--01b-after-switcher.png)
|
| Remove dialog |
![02a-before-remove](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--02a-before-remove.png)
|
![02b-after-remove](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--02b-after-remove.png)
|
| Theme preview |
![03a-before-theme](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--03a-before-theme.png)
|
![03b-after-theme](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--03b-after-theme.png)
|
| Identity export |
![04a-before-nsec](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--04a-before-nsec.png)
|
![04b-after-nsec](https://raw.githubusercontent.com/block/buzz/62847164da6a77ae3f60295097d4b4ac8c4f630c/pr-8872--04b-after-nsec.png)
|

### Before merge

- [x] Kenny Lopez reviews the visible changes ([approved in Buzz
#buzz-mobile](buzz://message?channel=9f18f3c6-b5e5-453d-b36d-65487913be0b&id=c8b01eaa3760e44c3b6583f2e02bec576d78679adfb364e5fe718cc0926bdc2d)).

### Validation

- Captures come from iPhone 17 simulators (iOS 27) running `main` and
this branch. Both builds used the same scratch-only seed with two
communities whose saved names are their hosted hosts. The seed is not
part of this PR. The relays were unreachable from the simulator, so the
screens show loading placeholders.
- Changed tests: the community switcher journey now uses a hosted
host-name fallback for one community. It asserts the grid label, the
remove tooltip and the dialog text show the short name, and it fails
when the getter returns the saved value. The onboarding label table now
asserts the model's `name` itself is shortened. The hosted-flow fixture
records relay hosts instead of names, and the auth-domain tests look up
communities by relay URL.
- The full mobile test suite and `flutter analyze` pass. The CI step
that runs with configured authentication domains also passes locally
(113 tests).
- Not captured: the push notification subtitle, onboarding's "Adding …"
text and the invite sheet. Reaching them needs hosted sign-in or push,
which the simulator doesn't support.

🤖 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>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 07:30:09 -08:00
..