Commit Graph

322 Commits

Author SHA1 Message Date
Matt Toohey
099a0bfa7e fix(mobile): show invite sheet while join policy loads
The deep-link dispatcher awaits InviteJoinNotifier.prepare before it
presents the invite sheet, and prepare awaited GET /api/join-policy.
On a slow or blackholed relay, opening an invite did nothing visible
until discovery finished or hit the 30 s request deadline.

prepare now returns once the pending invite and host are established
and loads the policy in the background. A new isLoadingJoinPolicy
state renders a "Loading community policy…" row (the spinner owns the
announcement) and keeps Join disabled until the policy is shown or
confirmed absent. A per-load token fences the result: a re-prepare,
reset, or claim supersedes the load, so a stale success or failure
cannot overwrite a claim that confirmJoin started, e.g. from the iOS
native sheet. confirmJoin still re-reads the policy before it claims.

The dispatcher gains a table with a suspended /api/join-policy
response. Both rows assert that the host, an enabled Cancel, the
loading row, and a disabled Join are visible before the GET resolves,
with no claim. The policy row then claims once with the app-minted
receipt after age confirmation and acceptance. The absent row claims
once without a receipt after Join. The provider claim journey now
claims while discovery is still suspended, then fails that discovery
and asserts the join stays successful.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-11-02 10:15:57 +11:00
Matt Toohey
7a35f29d49 fix(invites): collect native consent for app invite handoff
Co-authored-by: Jitter <d14dfe033ef0f809866f9f984de04821b0d900d7652fd85a54776ee40ca3a68f@buzz.block.builderlab.xyz>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-11-02 10:15:55 +11:00
Tom Brow
f6f6d9a673 chore(mobile): delete dead code with no remaining UI path (#8880)
## Summary

Deletes mobile code that no longer has a user-reachable path and has no
counterpart in buzz-app, so it is unlikely to come back for parity. Net:
104 files, about 5,500 lines removed. No intended behavior change.

- **iOS native message menu and action surface:**
`NativeMessageMenu.swift` and `NativeMessageActionSurface.swift`, the
`message`/`supportsMessage` coordinator branches, and the Dart selection
hook. Dart stopped creating this view in
[#8280](https://github.com/block/buzz/pull/8280). The native reactions
sheet in the same coordinator is kept.
- **Old home quick-actions launcher and `ComposeMorphIcon`:** only
instantiated in tests since the nav-bar creation actions replaced them.
- **Retired local theme stack:** `ThemeNotifier`, `AccentNotifier`,
`SchemeNotifier`, `adaptive_theme.dart`, `AccentPickerPage`, the
appearance-mode sheet and their helpers. These predate per-community
theme sync. The legacy prefs migration in
`community_theme_preference.dart` is kept.
- **Unused widgets:** `ProfileAvatar` and `MaskedAvatarBadge`.
- **Push permission-status plumbing:** the iOS
`notificationAuthorizationStatus`/`openNotificationSettings` handlers,
plus the uncalled strict age-gate snapshot registration and its Swift
`syncAgeGatePushSnapshot` path.
- **Orphaned files** with no importer: `profile_text_edit_sheet`,
`editor_option_button`, `retained_page_transition`,
`tappable_flapping_bee`, `agent_model_info`, `community_bot_profiles`,
`sheet_divider`, `success_haptic`.
- **Uncalled helpers:** the `pickAndUpload*`/camera helpers in
`media_upload.dart`, unused `NostrFilters` builders,
`mediaGetHeadersFor*`, and about 20 other uncalled functions, providers
and styles.
- **Removed-UI leftovers:** the never-wired invite directory providers,
`AuthNotifier.signOut` and `removeActiveCommunityForSignOut` (the Sign
out row is gone), `renameCommunity`,
`HomePage.profilePageBuilder`/`SettingsPage.embedded`, and the
create-forum branches of the create-channel sheet. Forum viewing is
unchanged.

Tests that only covered deleted code are removed. Tests of surviving
code that used deleted helpers as drivers were repointed to the
surviving API.

An audit of `mobile/android` found no dead Kotlin, resources, manifest
entries or Gradle dependencies, so Android code is unchanged.

## Validation

- `flutter analyze`: no issues.
- After rebasing onto main
([93b8b8f](https://github.com/block/buzz/commit/93b8b8febc)), `just
mobile-check` is clean (format and analyze), and `just mobile-test`
passes (4,070 passed, 35 skipped, 0 failed, plus the push-unconfigured
and secp256k1 suites).
- `dart format`: clean.
- Android: `just mobile-build-android` builds the debug APK, and
`./gradlew :app:testDebugUnitTest` passes.
- iOS: `build-for-testing` succeeds and BuzzPushKit `swift test` passes
(65 tests). In RunnerTests, 97 of 98 pass.
`testNativeNavigationTitleExpandsAgainAtTop` fails, but it fails the
same way on unmodified `main` (acf56fff6f) on the same machine (Xcode
27, iPhone 17 Pro simulator), so it is not caused by this change.
- Agent review of the diff ran. Its one blocker (stale `project.pbxproj`
entries for the deleted Swift files) is fixed.
- In-app smoke run at
[66141c1](66141c10b9):
a debug build on a fresh iPhone 17 Pro simulator (iOS 27), signed in to
the internal community. The following flows all worked with no errors:
- Home: the New menu (channel, DM, workspace, chat) and the
create-channel sheet, including its channel-type options.
- A chat, with the message action sheet (reactions row, Reply, Copy
link, Remind me, Mark unread, Copy text, Edit and Delete).
  - Appearance: the previews, and cycling the System and Light modes.
- Settings: the profile header, the display name editor, and Edit photo
(Image and Emoji tabs).
  - The Agents directory.
- Search, including the Channels filter, plus opening a team channel
from the results.
- Tapping a reaction summary, which opens the native iOS Reactions
sheet.
- The recording isn't attached here because it shows internal channels
and messages.

🤖 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: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:09:50 -08:00
Tom Brow
2e0abbcc0c fix(mobile): let slow image downloads finish (#8881)
On a slow link, a large image could never appear. Every image fetch was
aborted 30s after it started, even while bytes were still arriving, and
a failed fetch then sat on a 30s cooldown before it could be retried. At
240 kbps, anything over about 900 KB could not finish. On a shaped
iPhone SE, a 1.45 MB avatar was fetched, aborted at 30s and never shown.

- **Abort stalls, not slow downloads.** A fetch is now aborted when no
headers or body bytes arrive for 20s, so a dead connection still frees
up quickly. A download that keeps making progress can run for up to 5
minutes, so a server that trickles bytes cannot hold a connection
forever. The 20 MiB response cap still bounds its size.
- **Cancel previews scrolled past in the iOS carousel.** The carousel
loads at most four previews at a time, and a preview scrolled past kept
its slot until its download ended. With the longer limit, four slow
previews could block the visible one for minutes. Now the carousel drops
a cancelled preview's pending image-cache entry, and with no one left
listening, the image loader aborts its HTTP request. Scrolling back
starts a fresh download with no failure cooldown. A download that
another consumer, such as the full-screen viewer or a gallery prefetch,
is still listening to keeps going, and its finished image is still
cached. Closing the carousel aborts its pending previews the same way.
- **Cancel gallery prefetches that leave the window.** The message
gallery prefetches a few pages around the current one with two workers.
Each prefetch used to hold its download until it ended, which also kept
the carousel's cancel from aborting it. Now a prefetch that leaves the
window, or whose gallery goes away, lets go and aborts the same way.

### Validation

Added tests (each fails without its fix):

- A body that trickles in for longer than the stall timeout still loads,
and one that never ends is aborted at the overall cap.
- In the iOS carousel, previews scrolled past abort their stalled
downloads (before headers and mid-body), the next preview loads, and
scrolling back starts a new download. The test fails if the carousel
doesn't evict, if the loader doesn't abort, or if the abort leaves a
cooldown.
- Closing the carousel aborts its stalled previews.
- In a message gallery, jumping to the end and back aborts both
in-flight prefetches and moves the workers to the new window.
- Abandoning a load another consumer still waits for keeps the finished
image cached with no second fetch; abandoning one nobody else waits for
aborts it.
- Rapid scrolling releases each cancelled carousel load at once, and
cancelled loads never reach UIKit.

The full mobile suite passes.

🤖 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 13:57:11 -08:00
klopez4212
76fd0c6151 fix(mobile): show Bestie as a continuous conversation (#8890)
Opening Bestie from the mobile shortcut currently presents the agent DM
as a threaded channel. Present that same DM as a continuous
conversation, matching the top-level interaction in desktop Bestie.

Read existing roots and replies in chronological order using the flat
history provider, show typing inline, and keep new sends at the DM top
level. Disable thread-opening taps, swipe replies, and the Reply menu
entry in this view. Preserve the DM identity, history, membership, and
recipient rules; Solo ownership routing remains separate.

Regression coverage exercises the Bestie launcher, existing threaded
answers, reply-target navigation, taps/swipes, and top-level DM sends.
Validation: `just mobile-check` passed; `just mobile-test` passed (4,051
Flutter tests, 34 skipped; 4 unconfigured-push tests; 27 crypto-package
tests). The mobile file-size check and `git diff --check` also passed.

Manual app check before readiness:
1. Open the bottom-corner Bestie shortcut for an agent whose DM already
contains threaded replies.
2. Confirm those answers appear inline with the original messages,
without a separate thread screen or reply-count links.
3. Tap and swipe a message; confirm neither opens a thread. Long-press
should retain reactions and other actions without Reply.
4. Send another message, then close and reopen Bestie. Confirm it
remains in the same DM and conversation history.
5. Open an ordinary channel and confirm its existing thread behavior
still works.

Native app walkthrough and human confirmation are pending, so this PR
remains draft under AGENTS.md's readiness requirements.

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-01 21:56:45 +00:00
Tom Brow
53ca047cd3 fix(mobile): keep mention rows still and cache directory searches (#8875)
Typing `@s` in a stream showed the matching channel members, then about
half a second later added people from outside the channel. The chooser
sits on the composer and grows upward, so each late row pushed every
shown row up and a tap could land on the wrong person. It happened every
time, even for a query typed moments earlier, because each new `@`
started its directory search from nothing.

### Changes

- **Search cache.** Finished directory searches are kept per community
and signer, in a small LRU keyed by query (`MentionSearchCache`). A
query searched before shows its people at once while a fresh search runs
in the background. A query not searched yet starts from the longest
searched query it extends (`@si` starts from `@s`), since a name-prefix
search for a longer query finds no one the shorter one missed (up to the
search's result limit). This replaces the per-opening "last search" that
reset on every new `@`.
- **Rows hold still.** While a query's directory search can still add
people or a retry row (`mentionSearchPendingProvider`), the chooser
reserves its full height with rows at the top, so late rows fill empty
space instead of moving shown rows. This includes the background refresh
of a cached query. The reservation lasts until the query or the opening
changes, so the panel never shrinks under the finger either.
- **Three rows, with progress.** The chooser has a fixed three-row
height (fewer rows at larger text sizes) before it scrolls, and never
taller than the space above the composer (so a short view, such as
landscape with the keyboard up, keeps its rows on screen). While the
search runs, a thin bar overlays its top edge without changing its
height.

The trade-off: while a query's search runs, the panel is full height
even when it ends with one or two rows.

### Demo

iPhone 18 Pro simulator, local relay. Sam and Sasha are channel members;
Saba, Sierra and Skyler come from the directory search.


https://github.com/user-attachments/assets/efae33ce-ee65-447b-9402-b0741c8dc2da

### 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

- New tests: a cached query reopens with its people at once, stays
pending while it searches again, and clears when that search finishes; a
longer query starts from its prefix's people; an uncached query is
pending until its search finishes; and a compose bar journey step checks
that a late directory person leaves the shown row's position and the
panel height unchanged, both on a new query and on a cached query's
refresh. Other new tests cover the three-row cap, the progress bar, and
an 844×390 landscape view with the keyboard up, where the reserved
chooser previously pushed the only row above the screen. Disabling the
cache lookup fails the two cache tests, and disabling the reservation
fails the layout tests (the cached-refresh case moved a row 59pt).
- `just mobile-check` and `just mobile-test` pass.
- Exercised on the simulator against a local relay as shown above.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: mbp <973be878edd6d4f79692a3827f20a6f7fe0ed0362f269ff6b6ba8867033d7d8e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:55:46 -08:00
klopez4212
93b8b8febc Standardize mobile navigation edges (#8895)
Standardizes mobile navigation headers: Android uses Home’s shared
Flutter blur; iOS uses native soft edges, with graduated material
retained during large-title collapse and the iOS 26 fallback preserved.

Preserves Home’s upward title motion with a soft boundary and keeps the
avatar crop title visible.

Validation: 4,112 Flutter tests and 111 native tests passed after
merging main. Rendered partial-scroll regression verified on the iOS 27
simulator; removing either review fix fails its regression assertion.
The earlier preview was installed on a physical iPhone with the existing
profile.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-01 21:41:40 +00:00
klopez4212
634f48a8bd Mobile: open Solo chats with Bestie and workspace controls (#8884)
Mobile New chat now opens directly with the synced Bestie selected. The
first send creates and names the chat; leaving an empty draft creates
nothing. New and existing Solo chats can select or clear a workspace
from the header popover, with a checkmark for the active choice and a No
Workspace option. Workspace and agent controls have separate iOS glass
surfaces, Bestie stays at the far right, and Back uses a chevron. The
agent sheet fits its list, with scrolling for long lists. Workspace
creation stays in the Home New menu.

The New menu groups Solo above Team. Android expands across the full
control row; iOS keeps its native menu while Search and Bestie merge
into New through Liquid Glass, with synchronized icon motion and the
residual glass fading away. Empty workspaces use a compact, muted
message.

Validation: 4,055 mobile tests passed (34 skipped), static analysis
passed, and native menu checks passed. Earlier physical-device previews
and the iPhone New-menu animation were visually approved before this
consolidation.

This PR consolidates the controls previously developed in #8891 into the
existing draft/first-send implementation. The New menu animations,
attachment handling, and durable retries remain in this PR. The combined
controls have widget interaction coverage; the combined build has not
yet had a new physical-device walkthrough.

Current combined controls below are Android Flutter widget renders with
fixture data, not device screenshots. Images are GitHub attachments
only.

| New conversation | Workspace popover | Compact agent sheet |
| --- | --- | --- |
| ![New chat
composer](https://github.com/user-attachments/assets/f9ea2a16-342e-4cea-a436-0777ff5e37aa)
| ![Checked workspace
popover](https://github.com/user-attachments/assets/80eb7a71-e424-4188-86d7-eb6292b148bf)
| ![Content-sized agent
sheet](https://github.com/user-attachments/assets/be608383-0188-4339-b56b-924085137452)
|

Empty workspace widget preview (unchanged):

![Compact empty workspace
message](https://github.com/user-attachments/assets/387c0729-dea3-4250-bb54-afc4e61b54a7)

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-01 21:40:30 +00:00
klopez4212
21a9839826 Fix mobile unread state retaining deleted messages (#8883) 2026-11-01 18:51:20 +00:00
klopez4212
e18d422d72 fix(mobile): fill uploaded avatars on the Agents page (#8882)
Uploaded images on the mobile Agents page now crop to fill the avatar
squircle, matching desktop. Animated avatars and bundled character
posters retain their existing sizing.

Validation: `just mobile-check mobile-test` passed (4,050 Flutter tests;
34 skipped), plus before/after rendering of the production card.
Regression coverage checks uploaded, preset and animated images.

Snapshots use a sample rectangular PNG in a local Flutter widget
preview, not an installed build.

| Before | After |
| --- | --- |
| ![Uploaded PNG leaves gaps in the avatar
frame](https://github.com/user-attachments/assets/8f8591a1-48fd-4496-99e6-fd1c978c79bc)
| ![Uploaded PNG fills the avatar
squircle](https://github.com/user-attachments/assets/c7a3191f-2cd1-43ec-876a-baeb7896bb45)
|

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-01 17:53:41 +00:00
Tom Brow
543ecf2b1f fix(mobile): list the same owned agents as desktop (#8857)
## Summary

Mobile's Agents modal listed agents that desktop does not show. Most
were agents created in the earlier Buzz app (this repository's
`desktop/`), which the owner had not imported into Buzz 1.0
([block/buzz-app](https://github.com/block/buzz-app)). @ completion
offered them as well.

Desktop lists an owned agent only when the owner's newest kind:30177
record for that agent has a `pluginId/typeId` `runtime` tag and a name.
Records written by the earlier app have no `runtime` tag. Importing an
agent on desktop republishes its record with one
([`listingsOf`](662e91800a/src/features/agents/service.ts (L1413-L1460))).
Mobile now applies the same rule:

- **Agents modal:** shows listed owned agents, plus the account's remote
agents that have a verified owner profile here (so one stays listed
while a deletion that already removed its registration is retried).
Owned kind:10100 directory entries no longer add agents on their own.
- **@ completion:** channel members are always offered. Listed owned
agents are offered in streams and forums, where they can be added, as on
desktop. An owned agent that isn't listed is no longer offered from the
directory or from search, because mobile can't import it. The check that
runs before sending a restored draft follows the same rule.

The owned-agent directory moved to `lib/shared/agents` so the channels
feature can use it.

Shared agents owned by other people still come from the kind:10100
directory, which desktop doesn't use for @. That difference is unchanged
here.

### Related issue

None found.

### Validation

iPhone 17 simulator, debug build, against a local relay seeded with one
owner and two owned agents. Both agents have a NIP-OA profile. "Current
Agent" has a desktop runtime tag. "Old App Agent" has a registration
written the way the earlier app writes it, with no runtime tag. The
before captures are `origin/main` with the same data.

| | Before | After |
| --- | --- | --- |
| Agents modal | ![Agents modal before: Current Agent and Old App
Agent](https://github.com/user-attachments/assets/9089a820-9b30-4372-a133-7a0aa00fb6d8)
| ![Agents modal after: only Current
Agent](https://github.com/user-attachments/assets/f0585e0c-1bbf-4605-910f-90f6f9dc033a)
|
| `@` in a stream | ![Mention list before: only the
member](https://github.com/user-attachments/assets/aa88a5d6-5dec-41e9-aebd-07a62d06e48e)
| ![Mention list after: the member and Current
Agent](https://github.com/user-attachments/assets/d4de914d-23a4-4437-83b7-4b23dd641aac)
|
| `@Old` in a stream | ![Search before: Old App Agent
offered](https://github.com/user-attachments/assets/e038eb64-1fed-40f8-960b-18d6fad0a86f)
| ![Search after: nothing
offered](https://github.com/user-attachments/assets/47246f69-e939-402d-acfc-d0c764df967c)
|

Added tests:
- Directory loading: remote, desktop, earlier-app, later-imported, and
reverted agents, plus agents owned by someone else; only the newest
record counts. A table test covers the runtime and name rule.
- Agents modal widget test: an earlier-app agent is not shown.
- Mention candidates: only listed owned agents are offered outside the
channel, including from search.
- Compose bar: a restored draft that mentions an unlisted owned agent
outside the channel is rejected before sending.

I disabled the runtime check and the unlisted-agent filter, and the four
new guarding tests failed. The full mobile suite passes.

Human test: not applicable for this mobile change under the author's
standing exception.

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-11-01 07:36:37 -08:00
Tom Brow
5f98a1fa04 mobile: quiet agent messages and caught-up channel highlights (#8876)
Mobile bolded a channel whenever any reply in one of your threads, or
any mention, was unread. Catching up on the channel itself never cleared
those, so a channel could stay bold with nothing new in its timeline.
Agent progress messages (sent with the `agents` audience) also counted,
so busy agent threads kept channels lit.

This brings the mobile channel list in line with the desktop sidebar
rules in buzz-app's `docs/unread.md`:

- **Quiet agent messages** (`["audience","agents"]`) never count as
unread or earn attention, even when they mention you. They're dropped
where mobile records observed unread events, so the channel list, Solo
chats and app badges all agree, and Activity drops them too (paging past
a mention window they filled). If the bounded catch-up window comes back
full of quiet messages, its oldest one still counts as plain backlog, so
an older unread message hidden behind them keeps the channel unread.
- **Bold means ordinary backlog.** A channel's label bolds only for
unread top-level messages (what channel catch-up reads) or a manual
unread mark. A manual mark doesn't add a dot, but it keeps the dot of
any real attention.
- **A dot means attention.** Unread replies in your threads, mentions
and broadcasts show a small accent dot (the Activity row's unread dot)
without bolding. Opening the thread clears it, as does long-press → Mark
read, which the menu now offers for dot-only channels.
- Unread DMs bold and show the dot, as on desktop. Solo chats keep their
current rule.

Not included: desktop's popover listing the unread threads behind the
dot.

### Before merge

- [x] Kenny Lopez reviews the visible changes ([reviewed in Buzz
#buzz-mobile](buzz://message?channel=9f18f3c6-b5e5-453d-b36d-65487913be0b&id=c8b01eaa3760e44c3b6583f2e02bec576d78679adfb364e5fe718cc0926bdc2d);
his overlap question about #8883 is answered: the two are
complementary).

### Validation

- Added tests:
- A channel-list unit test covering backlog, reply, mention, DM, manual
unread (with and without attention) and Solo.
- Widget cases: a reply-only channel shows a dot, not bold, and clears
on the thread mark or on long-press → Mark Read. A mention after
catch-up is a dot. Backlog plus a mention gives bold plus a dot.
- Provider tests: quiet agent messages, both from catch-up and live, are
never recorded (fails without the fix). A full catch-up window of quiet
messages still counts (fails without the fix). Quiet mentions never
become Activity or Inbox items, even when 50 of them fill the mention
window in front of a real one (fails without the fix).
- Full mobile suite (`just mobile-test`) and `flutter analyze` pass
locally.
- Simulator recording against a local relay (iPhone 18 Pro, iOS 27). Sam
replies in the sim user's thread, which shows a dot without bold. Sam
then posts top-level, which bolds the label. Opening the channel reads
the backlog, so it returns to regular with the dot. Long-press then
offers Mark Read, which cleared the dot. That last step finished just
after the clip ends.
- Not exercised live: the agents-audience exemption, because the CLI
can't set that tag. The provider test covers it.


https://github.com/user-attachments/assets/55f74377-d7f3-4b31-a0c8-b456f4e05770

🤖 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: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 07:31:19 -08:00
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
Tom Brow
e71fbe23df fix(mobile): keep loaded timeline visible while reconnecting (#8864)
Returning to an already-open channel after a few minutes in the
background could replace its messages with the loading skeleton.

The relay session drops its socket five seconds into the background, so
nearly every return to the app reconnects. When that reconnect took more
than two seconds, the channel page covered the loaded timeline with the
connection skeleton until the relay came back. The messages provider
already keeps the cached timeline through a reconnect, so the overlay
was the only thing hiding it.

Now a loaded timeline stays visible while the relay reconnects. The
skeleton still shows when nothing has loaded yet, and forums keep their
existing behavior (skeleton only before any posts load).

To keep a reconnect indicator, the iOS title capsule now shows a thin
bar in the chat color (the Appearance accent) along its bottom edge
while a page with loaded content is not current. For a channel timeline
that covers both the reconnect and the catch-up after it (resubscribing
and fetching the newest window). The wait has no known length, so the
bar sweeps in, pulses until the channel is current, then fades. Reduce
Motion shows a static bar. Forums show it only while reconnecting,
because their posts provider doesn't refetch after a reconnect. The
native navigation view owns the bar, so it survives title rebuilds.
Android has no title capsule and is unchanged.

### Demo

iPhone 18 Pro simulator on a local relay: background the app for more
than 5s with the relay down, return, then let the relay come back. About
8s of relay startup is cut from the middle.


https://github.com/user-attachments/assets/e88d0191-766b-4054-bc00-99ed306cd0cc

### 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

- Updated tests: the reconnect cases in `channel_detail_page_test.dart`
and `loading_review_tests.dart` now assert that loaded messages and
cached media stay visible and in place during a reconnect.
- Added test: the iOS navigation payload sets `titleRefreshing` while a
loaded timeline reconnects and clears it on connect.
- Added test: `isCatchingUp` holds from reconnect until the newest
window merges, and is already false when that state publishes.
- Added test: a failed catch-up after reconnect still notifies listeners
once, with `isCatchingUp` false, so the bar clears.
- `flutter analyze` clean, iOS simulator build succeeds, and the full
mobile suite passes on the final head.
- Checked visually on an iOS 27 simulator (demo above): loaded messages
stay visible on resume, and the bar pulses from foreground until the
reconnect's catch-up finishes, then fades.

🤖 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: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 07:30:05 -08:00
Logan Johnson
2e4aacc9e0 fix(mobile): find open channels in search and stop the stuck spinner (#8764)
## Summary

Mobile search could not find an open channel you had not joined. In the
Channels tab it could also show an empty list with a spinner that never
stopped. This change fixes both and makes mobile rank channel results
the way desktop (buzz-app) does.

**Open channels you have not joined.** Mobile ranked channels from the
loaded channel list, which holds open channels only after Browse
channels has loaded the directory. Desktop search also looks up public
channels (`usePublicChannelSearch`). Mobile now loads the open-channel
directory when a search starts
(`ChannelsNotifier.ensureDirectoryLoaded(maxAge:)`). It reads the
directory again when it is older than 30 s, as buzz-app's
`PUBLIC_CHANNEL_PAGE_TTL` does. Results are ranked again whenever the
channel list or the directory status changes. Unjoined channels already
render with the "Open" badge.

**Directory failure.** If the directory load fails, search shows "Open
channel search couldn't finish." with a Retry channels button, as
buzz-app does, instead of "No results". Screen readers announce the
notice (live region). The next query also retries.

**Stuck spinner.** The message, people and channel lookups shared one
`isLoading` flag. When no messages and no channels matched and the
people lookup finished last, it set `isLoading = messages.isEmpty &&
channels.isEmpty`. That turned the spinner back on, and nothing turned
it off again. Each relay lookup now has its own pending flag. The
spinner shows while any lookup is still running, or while a directory
load is running: one this search started, until its future completes, or
one another caller started in this community. The shared directory
status alone is not enough, because a real refresh marks it loading only
after memberships arrive, and loaded before the new list is installed.
Lookups are fenced by a query generation, so a late reply to an earlier
query, even one with the same text, cannot settle the current search.

**Displaced directory loads.** A membership refresh that starts while
the directory loads retires that load. It used to mark the directory as
failed, so search showed "Open channel search couldn't finish." when
nothing had failed. It now marks the load idle. A refresh that starts
earlier, during the membership round trips, retires the load before it
is marked loading and leaves no status at all. In both cases search
loads the directory again once. If that load is retired too, search
offers Retry instead of looping. A real relay error still shows Retry at
once and is not retried automatically. When a directory refresh starts,
it clears an earlier failure for the same community to idle, so a
failure left from before (for example before a reconnect) cannot be read
as the new attempt's result and skip its retry. The notice follows the
live directory status, so it clears when another caller loads the
directory.

**Directory races.** A community switch drops the cached directory, but
the directory status still said the earlier community was loaded, so
switching away and back within 30 s skipped the reload.
`ensureDirectoryLoaded` now also requires the cached directory to come
from the current community. A search during the first channel load used
to start a directory refresh that retired the pending load; if that
load's reply came last, its stale failure replaced the list.
`retryDirectory` now waits for a pending first load, as `fetchFresh`
does. Both came from the Codex security review of this branch.

**Only the current community's list.** While a community switch reloads
the channel list, Riverpod keeps the previous community's list as the
loading value. Search now ranks only installed data (`asData`), so the
old community's channels cannot match. (The signing identity derives
from the community config, so the existing config watch already resets
search on an identity change.)

The idle marking and the `asData` read come from Wes's
https://github.com/block/buzz/pull/8869, which fixed the same bug in
parallel.

**Same ranking as desktop.** `name_match.dart` ports buzz-app's
`matchName` (`src/features/search/match.ts`). Its ranks, best first:
- exact
- prefix
- word start
- substring
- word runs (`tlp` finds `team-launch-planning`; `buzz community` finds
`buzz-community`)
- letters in order

`SearchNotifier` orders results like buzz-app's `SearchResults.tsx`:
- Joined and open channels share one ranking, and joined channels win
ties. Open channels with the same rank are ordered by name, then id,
like buzz-app's `searchPublic`.
- An archived channel ranks half a step behind a live one and stays
findable only by its members.
- A bare `#` lists joined channels only. Like desktop, it does not load
the open-channel directory, so it shows no directory spinner and no
failure notice.
- The list shows the top 8.

A filter tab with none of its own results now shows "No results" instead
of a blank list.

Plain substring matching on descriptions is removed; buzz-app does not
match descriptions.

**Differences from desktop:**
- Desktop also orders by the viewer's past search choices. Mobile has no
such history yet.
- Desktop shows Solo chats and DMs in their own groups. Mobile keeps
Solo channels in its Channels list.
- `from:`, `in:`, `since:` and `until:` operators and desktop's people
ranking are not ported. Mobile still sends the raw query to the relay.
These can be a separate PR.
- Lowercasing differs for a few letters: JS lowercases `İ` to `i` plus
U+0307 and Dart does not, so `İstanbul` / `istanbul` ranks exact on
mobile and word runs on desktop.
- Desktop ranks channels at each keystroke. Mobile still waits for the
300 ms debounce, so channel rows clear while typing.
- Open channels that tie in rank are ordered with Dart's case-sensitive
`compareTo`; buzz-app uses `localeCompare`. Only names with capital
letters can order differently.
- A directory refresh runs the full channel-list reload
(`retryDirectory`), not only the directory read. With the 30 s TTL this
happens at most once per 30 s of searching.

### Related issue

Reported in Buzz #buzz-bugs: a search for `4things` on mobile found
nothing. No GitHub issue. No duplicate open PRs found.

### Testing

- `search_channels_journey_test.dart` drives the real `SearchNotifier`
through `SearchPage` with held relay lookups. It covers:
- an unjoined open channel that appears when the directory arrives, with
the "Open" badge, ranked above a joined channel with a weaker match
  - the spinner stopping when the people lookup finishes last
  - a letters-in-order query
  - a query with no matches that shows "No results"
- a clear and retype of the same text, where late replies do not stop
the spinner
  - the Channels tab showing "No results" when only People matched
- a bare `#` whose directory finishes last, then failed directory loads
that show the notice instead of "No results", then Retry channels
finding the open channel
- a community switch during a directory load, where the retired load
does not settle the new search
- A third widget test drives the real `ensureDirectoryLoaded` →
`retryDirectory` path, with the membership query held at the relay
boundary. The spinner stays on while that query is held. A failure shows
the notice, and another caller's directory load also keeps the spinner
on.
- The journey fails on main's `search_provider.dart`. It also fails in
each of these mutations:
  - the old loading rule restored
  - the generation fence replaced by the old query-text check
  - membership sorted before match rank
- `name_match_test.dart` checks 20 name/query pairs. Their expected
ranks come from running buzz-app's `matchRank` on the same inputs.
- `search_channel_rank_test.dart` is a table test of
`rankSearchChannels`: joined-wins ties, open ties by name, archived
ordering and membership, private and DM filtering, `#` handling, and the
8-row cutoff.
- `channels_provider_test.dart` checks that `ensureDirectoryLoaded`
reads again only once the directory is older than `maxAge`.
- 17 mutations of the review fixes each fail a test: the archived
filter, the archived penalty, the 8-row limit, joined ties, open ties,
`#` handling (×2), the failure flag, the failure flag while loading,
search-owned pending, the load fence, the rebuild reset, the scoped
status spinner, the search TTL, the TTL check, filter-aware "No
results", and Retry.
- Displaced loads (`efc17a5d4`, `22e52d687`): the journey retires a load
before it is marked loading, then displaces the retry after (one retry,
then Retry channels with no "No results"). It also checks that the
notice clears when another caller loads the directory, and that it is
not shown during the first debounce. A displaced Retry recovers. A
community switch whose held list reload must match neither the old
community's `general` channel nor its name on a message hit. The
production-path test holds the real refresh's membership query, runs
`refresh()`, and asserts the one retry. `channels_provider_test.dart`
expects a displaced load to end idle. Each of 8 mutations fails a test:
no retry, retry only on idle, retry on a relay error, notice only on
error, no attempted flag, `.value` in ranking, `.value` in message
names, and `markError` on displacement.
- Review fixes (`29c74e8c5`, `fe4276538`): both displaced-load journeys
now start from an earlier same-scope failure (asserted) instead of an
artificial idle reset. The notice's live region is asserted. A bare `#`
after a failure, and while another caller loads the directory, makes no
directory request, shows no spinner and no notice. Each of 5 mutations
fails a test: no error reset in `beginRefresh`, no live region, a
directory load for `#`, the notice for `#`, and the spinner for `#`.
- Directory races (`c73b028ac`): `channels_provider_test.dart` switches
A→B→A and expects a new directory read, and starts a directory load
while the first load's member metadata is held, releases it last, and
expects the list with the open channel and no error. Both tests fail on
`fe4276538`, and each fails again when its fix is removed.
- Review hardening (`85042b1a4`): `retryDirectory` clears a same-scope
error before its first await. A test reads `idle` synchronously after
the call; it failed before the fix.
- `just mobile-check`, `just mobile-test` and `just file-size-check`
pass at `85042b1a4` on `origin/main` `b80217de3` (4052 tests, 32
skipped).
- Carl's re-review of `c73b028ac` (via Wes's account): no blockers. Its
optional hardening note is done in `85042b1a4`. The 8-row cap is still
Wes's product call.
- Wes's review (Carl) of `22e52d687`: the blocker (a stale same-scope
error skipped the retry) is fixed in `29c74e8c5`. The optional `#` and
live-region items are done. The 8-row cap is left for the PR author's
product call. The in-app run below is from `3b5521c51`.
- Agent review of `efc17a5d4`: Cerveau found no must-fix or should-fix.
Auto found one should-fix (a load retired before `markLoading` got no
retry and no notice), fixed in `22e52d687` with its optional
notice-liveness and A→B→A items. Cerveau's optional coverage items are
also done there.
- Not covered by a test yet (follow-up): the empty state on the Messages
and People tabs when only channels matched.
- `just mobile-check` and `just mobile-test` pass at `3b5521c51` on
`origin/main` `0c82435ae` (4008 tests, 28 skipped).
- Agent review: Auto and Cerveau reviewed `b8a268e2c` independently.
Every must-fix and should-fix is fixed in `28a0990e5`. Cerveau confirmed
both of its must-fix items at that head. It then found one regression in
my fix, a spinner gap during the real refresh, and that is fixed in
`3b5521c51`. Cerveau re-reviewed `28a0990e5..3b5521c51`, found nothing
new, and confirmed that all three of its blockers are closed. Its own
full mobile suite run at `3b5521c51`: 4008 passed, 28 skipped. Auto
re-checked `b8a268e2c..3b5521c51` and confirmed that all four of its
should-fix items are closed and nothing new is must-fix. Auto's optional
findings on `İ`, per-keystroke ranking and reload cost are listed under
differences above.

#### In the app (Android emulator, debug build of `3b5521c51`)

No Xcode was available, so this ran on the Android emulator against a
local relay. The viewer has joined `general` and `team-4things`. Another
user owns the open channels `4things` and `retro2108`.


https://github.com/user-attachments/assets/f54700c6-c34c-4ded-b7c7-c7e6e07aa43b

1. Channels tab, `4things`: the spinner shows while the open-channel
list loads, then `4things` appears with the Open badge, above the joined
`team-4things`, and the spinner stops.
2. `#`: the joined channels are listed, and the spinner stops.
3. Channels tab, `morty` (a person, no channel name): "No results for
'morty'". The All tab shows Morty under People.
4. The phone is cut off from the relay, and `retro2108` is created
meanwhile. Searching for `retro2108` more than 30 s after the last load
shows "Open channel search couldn't finish." with Retry channels. After
the relay is reachable again, Retry channels finds `retro2108` with the
Open badge.

The local `ws://` relay needed two demo-only edits to the add-community
checks, which are not part of this PR.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Wes <wesbillman@users.noreply.github.com>
2026-11-01 08:28:58 -07:00
Tom Brow
db4478e8d2 feat(mobile): organization sign-in for NIP-FI relays (#8700)
Block is turning on NIP-FI enforcement on the Block relay. Desktop gets
organization sign-in in block/buzz-app#1424. Mobile can already attach
NIP-FI assertions, but only for Builderlab-hosted communities, through
the build's single Builderlab account. The dogfood build needs that
account for public hosted communities, so it can't simply be pointed at
the Block tenant.

This adds a separate **organization realm**, configured at build time:

- `BUZZ_ORGANIZATION_URL`: the tenant's HTTPS origin (for example
`https://block.builderlab.xyz`).
- `BUZZ_ORGANIZATION_RELAYS`: the exact relay hosts that trust that
tenant.

The two must be set together. The app refuses to start if they're
malformed, overlap a hosted community, or reuse the hosted origin.
Without them, nothing changes.

For a configured relay:

- The app keeps its own organization session and signs in through the
browser at the tenant's existing login (`/api/goose/v1/auth/login`).
Block SSO happens there.
- It requests assertions from the same `/v1/buzz/identity/assertions`
route that hosted communities use, and attaches them to the relay
socket, HTTP, media, huddle and remote-agent requests.
- Unlike the hosted path, it doesn't require an identity backup before
the first binding. As on desktop, the tenant binds the member's existing
key on first issuance. A key already bound to a different one is refused
before any request is sent.
- When signed out, it connects without an assertion and lets the relay
decide. A bottom banner offers **Sign in**. After sign-in, the relay
reconnects with a fresh assertion. Hosted communities keep their
existing banner and flow.

The tenant accepts only the registered
`xyz.block.buzz.mobile:/auth/callback` return URL, so both realms share
it. Each `BrowserAuth` owner leaves callbacks whose `state` belongs to
another owner's attempt to that owner.

### Before merge

- [ ] Kenny Lopez reviews the visible changes.

### Validation

Added tests (`organization_relay_auth_test.dart`):

- Configuration parsing and exact host matching.
- An assertion is issued for the exact relay and key, then cached.
- A different bound key is refused.
- Signed out connects without an assertion.
- Other relays never receive the assertion.
- The shared callback is routed between the hosted and organization
owners.

Full `mobile-check` and `mobile-test` pass. RunnerTests pass locally
except `testNativeNavigationTitleExpandsAgainAtTop`, which this PR
doesn't touch.

Added tests (`organization_sign_in_test.dart`,
`relay_auth_isolation_test.dart`, `builderlab_account_test.dart`), each
failing without its fix:

- Concurrent account restores at cold start share one adopted account.
- An exchange from a cancelled attempt never changes a newer sign-in.
- Storage failures while clearing the intent or cancelling leave the
busy state.
- An unreadable saved organization session is replaced by signing in
again.
- A stalled organization issuer never delays a hosted relay's assertion.
This test needs `BUZZ_AUTH_DOMAINS` and skips without it. CI's
configured-auth-domains step doesn't list it yet, because that workflow
change needs a token with `workflow` scope.

Added tests also cover a restore after an offline start (the banner
clears once a relay retry restores the session) and the iOS bridge
allowlist (`/auth/native` and tenant login on Builderlab subdomains;
other hosts, paths, ports, userinfo and fragments refused).

Simulator (iPhone 17, iOS 27) with the dogfood defines against the
production Block relay `buzz.block.builderlab.xyz`, on a WARP Mac:

- The app starts with the organization configuration and connects to the
relay while signed out, showing the organization **Sign in** banner.
- **Sign in** opens the system sign-in session for
`block.builderlab.xyz`, and the banner shows **Finishing organization
sign-in…**. Cancelling returns to **Sign in** with no error. Before the
bridge fix, no browser opened and the banner reported that sign-in did
not finish.
- The bottom banners (organization sign-in, hosted reconnect, and the
sign-in recovery row) now sit above Home's floating Search/New bar,
which used to cover **Sign in**. A journey test checks the banner clears
the bar, and fails without the fix.

![Home with the organization sign-in banner above the floating
bar](https://github.com/user-attachments/assets/c6ab74f4-3d88-4fe0-ae16-042a548056fe)
- The simulator run stopped at the system consent prompt (SSO does not
work in the simulator). The app calls were driven through the VM service
(the same `signIn()`/`cancel()` the banner buttons call) because the
simulator could not be tapped.

Device (iPhone 12 mini) against bb-block staging in enforce mode, where
every probe without an assertion gets 401:

- Signed out, the organization banner shows and the app stays
responsive. Cancel at the consent prompt returns to **Sign in**, and
retry works.
- Block SSO through Okta completes, and the relay admits the reconnect
with the assertion.
- After relaunch the app connects, loads channel history, and shows no
banner for over 60 seconds.
- Before the restore fix, 2 of 4 cold starts showed "cannot use this
community with this key" although the session was valid. With it, 8 of 8
cold starts connected.

Known limitation: adding an enforcing organization relay by community
link is tracked in #8791.

The dogfood build enables this in squareup/buzz-releases
(`tomb/dogfood-organization-sign-in`). App Store builds stay unchanged.

🤖 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:23:12 -08:00
Tom Brow
acf56fff6f fix(mobile): use the desktop agent squircle for every agent avatar (#8873)
On mobile, the Create agent form previewed emoji and image avatars as
circles. Once the agent was created, its avatar showed as a rounded
square, and other surfaces used yet other radii. None of them matched
the agent squircle desktop uses.

This PR makes `lib/shared/widgets/avatar_shape.dart` the single source
of avatar silhouettes. Agents get desktop's squircle (traced from
buzz-app's `avatar-squircle.svg`), and people keep circles.
`avatarShape(isAgent:)`, `avatarPath()` and `AvatarClip` are the only
ways to get either shape, and the squircle border class is private.

Every agent avatar surface now goes through that bottleneck:

- Create agent form and avatar picker previews (previously circles for
emoji and photo avatars, and unclipped for catalog characters;
`PresetAgentAvatar` now owns the clip)
- The avatar picker's camera cutout (`ImageAvatarCapture` with `isAgent:
true`); profile editing keeps the circle
- Agents grid card portrait (previously a 22pt rounded rect)
- `AvatarImage` (message authors, DM rows, member lists), the profile
sheet, `SmallAvatar`, and the native avatar PNG used by iOS Add members
(previously 30% rounded rects)
- Huddle speaking halo, preparing placeholder, and spotlight frame
- The iOS Add members fallback tile (Swift), shown while an avatar
loads, now draws the same squircle instead of a 30% rounded rect

To catch future drift, `avatar_shape_test.dart` adds a source guard. It
fails when code under `lib/` picks an avatar shape inline from agent
identity (for example `isAgent ? BoxShape.rectangle` or `if (!isAgent)
return ClipOval`), hand-rolls the old 30%/60% agent radius, or uses a
person shape (`ClipOval`, `CircleAvatar`, `BoxShape.circle`) under
`lib/features/agents/`. Against main it flags 8 of the 10 old sites. It
is best effort: the native PNG's inline ternary and the card's RRect
didn't match those patterns and are fixed directly here.

The Create agent form also gets 8pt above **Choose avatar**, so the
button and everything below it move down from the preview, as Kenny
requested.

### Before / after

Captured on the iPhone SE (iOS 27) with a release build against a hosted
Builderlab community, using a throwaway agent with an emoji avatar. In
each pair, before (main) is on the left and after is on the right.

**Create agent form** (also shows the 8pt spacing)

![create](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--create.png)

**Avatar picker**

![picker](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--picker.png)

**Agents card**

![card](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--card.png)

**Agent profile sheet**

![profile](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--profile.png)

**Message author avatar** (`AvatarImage`)

![dm-message](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--dm-message.png)

**DM list row** (`AvatarImage`)

![dm-list](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--dm-list.png)

**Add members** (native iOS list, `nativeAvatarImage`)

![add-members](https://raw.githubusercontent.com/block/buzz/f1f6a019c69e245146db761a6344524969275d04/pr-8873--add-members.png)

Not captured on device: `SmallAvatar` (thread reply and search avatars)
and the Huddle halo, placeholder, and spotlight, which need a live agent
thread or huddle. Widget tests cover these.

### Validation

- Device: the before/after captures above. They predate the catalog
preview clip
([355ebca](355ebca27e)),
which only trims the transparent character art at the squircle corners.
The test agent was deleted afterwards.
- Added tests: `avatar_shape_test.dart` pins the squircle geometry to
desktop's mask and runs the source guard. The avatar picker journey now
checks that the catalog preview, emoji preview, and camera cutout use
the agent shape. Existing `AvatarImage` and channel-detail
Huddle/thread-avatar assertions were updated to the new shapes.
- Full mobile format, analyze, and test suite pass locally. The iOS
release build compiles with the Swift change.
- The device build predates a merge of main that brought in
[#8773](https://github.com/block/buzz/pull/8773). That merge touched the
card, create page, and profile sheet without changing any avatar shapes.

Human pre-readiness app testing is not applicable under Tom's standing
exception for Buzz mobile changes. An independent agent review ran, and
its optional findings were addressed in 00b1ec6.

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>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 11:55:47 -07:00
Wes
f59b326568 Fix mobile onboarding policy loading, browser cancellation and pairing feedback (#8874)
Mobile onboarding could reject valid large legal documents, stay busy
after closing Android browser sign-in, and hide pairing-import errors
behind the community-link form. This change bounds join-policy responses
at 4 MiB while retaining 64 KiB for other responses, handles Android
browser cancellation through the native lifecycle/channel, keeps Cancel
sign-in usable, and shows friendly pairing errors on the landing screen
with a live-region announcement. Identity mismatch checks remain intact.

The browser-cancellation implementation incorporates the candidate from
#8847 (`cb241b3f1`); coordinate landing to avoid duplicate work. This PR
consolidates the three fixes exercised together during Android
onboarding acceptance.

## Validation

- Pixel 9 / Android 17, production hosted services, isolated debug
installs. Human acceptance plus native UI, saved public-identity and
restart checks as noted below. No iOS acceptance in this session.
- Latest build and invite-first acceptance: base
`a12ad1cdd29da8b2923eca5408e963a2659777ab` plus these patches.
- Focused tests on that base plus patches: **88 passed** across
hosted_journeys_test, hosted_admission_test, browser_auth_test,
pairing_hosted_handoff_test and pairing_provider_test, with
`BUZZ_AUTH_DOMAINS=communities.buzz.xyz`.
- Earlier baseline: 81 focused cases passed plus one
staging-configuration case passed separately (82 distinct cases across
seven onboarding/recovery files); these are historical, not current-head
certification.
- Earlier policy change: 41 focused tests, changed-file analysis and
isolated mutation check passed on the earlier base. Earlier browser
candidate native instrumentation/mutation evidence was not rerun on this
combined revision.
- Android debug APK built and installed successfully. Mandatory
commit/push hooks passed at `6442e5ff9`: analysis clean; mobile tests
4,047 passed / 34 skipped; additional package runs 4 and 27 passed;
file-size checks passed. These broad tests ran through the required push
hook, not a manually invoked suite. CI remains pending.

## Live testing report — October 31

| Journey | Result and evidence boundary |
|---|---|
| Fresh email signup / identity / hosted invite | Reproduced policy
response exceeding 64 KiB; after fix, admission and restart passed.
Profile/message visible locally; cross-account message receipt remains
unproven. Tested at `cfcaef4e9f` plus policy patch. |
| Browser close → retry → login → existing identity recovery → restart |
Passed at `d14f33a170` plus patches; recovered the expected public
identity and community. |
| Pairing a different identity into an existing install | Rejected
without replacing the original key. Initially hidden error became
visible with friendly copy; Back and restart preserved the community at
`b80217de3` plus patches. |
| Fresh pairing → wait for desktop approval → sign-in → community →
restart | Passed at `20742a236` plus patches; human confirmed approval
gate, saved public identity matched. |
| First-time desktop cancellation → welcome → fresh QR retry → community
→ restart | Passed at `20742a236` plus patches. Cancellation error
remained raw `user_denied`. |
| Android system Back while awaiting pairing approval | Human-confirmed
in already-onboarded Add Community; first-time phone-side Back variation
remains untested. |
| Wrong pairing code → rejection → correction → completion |
Human-confirmed at `a2540fbe3` plus patches. Exact error and
same-session versus fresh-QR retry were not independently captured. |
| Interrupt account onboarding at community picker → process restart →
recovery → admission | Passed at `a2540fbe3` plus patches. Restart
opened Add a community; Find my communities restored choices without
another login. Human completed admission. No destination had yet been
selected. |
| Invite-first into fresh signed-out app → intended community → restart
| Passed at `a12ad1cdd` plus patches; saved identity/destination
matched. Existing member and existing browser session. Initial Android
VIEW intent explicitly targeted the test package; ordinary HTTPS default
app-link resolution and new-member admission remain untested. |
| Malformed community input → error → Back → restart | Passed for `not a
community`; original community preserved. `not-a-community` is a valid
single-label hostname and was not counted as malformed-input evidence. |

## Remaining gaps and findings

Not release certification. Pairing landing-error regression/mutation
evidence is now recorded below. Current combined-revision native
instrumentation has not been rerun; its limited scope is described
below.

Deferred behavior, not implemented here:
- Wrong browser account after fresh pairing is correctly rejected, but
Retry reuses that app account session; in-app account switching must
preserve the transferred identity and destination. The live happy path
used a manual browser-account switch and fresh install.
- Pairing wait has no visible Cancel; tested system Back works.
- Desktop cancellation exposes raw error wording.
- Interrupted community selection requires an extra Find my communities
step.

Master checklist remains partial: seven categories exercised this
session, signup/community creation has historical coverage, seven
categories unexercised. New-member link-first admission, deeper
interruption/server-commit recovery, expiry/revocation/network failures,
key import, organization/self-hosted paths, phone-to-desktop transfer,
eligibility gates, accessibility/app-link variants and iOS require
separate coverage. Channel-discovery work is separate (#8869).

## Review checkpoint

[Carl’s
review](https://github.com/block/buzz/pull/8874#pullrequestreview-5724095754)
found no code blockers at `6442e5ff9`. Carl also reviewed test-only
follow-up `d43958653` and found no issues, accepting both validation
gaps as closed. A subsequent review identified stale callback → resume
cancelling a newer Android login. A narrow native fix and regression
validation are in progress; prior readiness attestation is withdrawn
pending this behavior change.

- **Android stack check passed (Pixel 9, Android 17):** after fresh
account sign-in, the human stopped at the community picker without
closing/restarting. `dumpsys activity activities` showed exactly one
MainActivity in Invite First task 567, with no CustomTab in that task or
the full component list. ChromeTabbedActivity remained in a separate
pre-existing browser task. This rules out a lingering duplicate activity
in this run; it does not independently trace `onNewIntent` or establish
all Android/browser variants. Binary production sources match
`6442e5ff9`.
- **Pairing regression/mutation passed:** extended the existing QR
journey using the real encrypted NIP-AB import and hosted coordinator.
Asserts visible friendly mismatch feedback, live-region wrapper,
unchanged stored community/account identity, and Back to home. Reused
the existing socket fake. Hosted journey + pairing provider files: 70
passed with configured auth domain; opt-out hosted journey file: 3
passed / 21 skipped; changed-file analysis clean. Isolated clone:
control passed, hiding the landing error failed the visible text
assertion, restoration passed. No production source change in this
follow-up.
- **Duplicate landing:** #8847 is superseded by this combined PR; its
Android slice is included here. No merge performed.

BrowserAuthPluginTest manually drives plugin hooks using an unmanaged
Activity and fake browser launcher. It proves the plugin state machine
only, not MainActivity wiring, real lifecycle order, process death, or
duplicate app_links callback delivery. Current CI does not run Android
instrumentation. Android ignores the debug ephemeral-login flag and
shares browser cookies.

Readiness checklist: agent review completed on production changes and
test follow-up; agent exercised the changed behavior; human completed
the documented Android journeys and final sign-in check.



## Stale callback follow-up (`b7aaaa788`)

Addresses [the later Android lifecycle
review](https://github.com/block/buzz/pull/8874#pullrequestreview-5724197312):
a recognized callback now clears browser-dismissal tracking before
rejecting a mismatched state. A stale callback cannot complete or cancel
the newer login. The existing native journey now includes the
intervening resume, successful current callback, and genuine browser
dismissal after a stale callback. Only two native files changed; policy
and pairing fixes are unchanged.

Validation: 88 focused Dart tests passed. Android app and test APK build
passed. On Pixel 9, the native plugin journey passed; in an isolated
source/Git/build clone, removing the reset failed at the newer attempt's
expected-zero-replies assertion; exact restoration passed. This proves
the plugin state machine on Android, not a real late browser callback
through OS lifecycle delivery. Carl reviewed `b7aaaa788` and found the
fix correct and minimal with no blockers. Human browser-close/retry
check remains pending; PR stays draft until that passes. Current-head CI
is also required for merge.

Accepted limitation: if a recognized stale callback arrives after the
current browser tab has already gone, automatic dismissal is suppressed
and the user may need the visible Cancel button. The callback cannot
complete sign-in without matching state; Dart validation remains
authoritative.

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
2026-10-31 12:43:01 -06:00
klopez4212
a12ad1cdd2 feat(mobile): refine agent profiles and model selection (#8773)
## Summary
- Simplify agent profiles with Message/Bestie actions, relay-authored
published instructions (unavailable without a config channel),
management details, public-key copying, and a separate final Delete
section.
- Sort the Agents directory by name and mark the selected Bestie with a
muted filled star.
- Place Model and Thinking together below Name. Use native iOS Liquid
Glass menus and preserve selection callbacks as controls become enabled.

Related: #8685.

## Validation
Full mobile checks passed. Regression coverage includes relay-author
filtering, unavailable instructions, metadata retry, resizing native
pickers, accurate deletion state, selection after loading, and Bestie
switching. Real iOS simulator taps verified both pickers; the user
confirmed the earlier iPhone build works. Review fixes were checked with
widget journeys and the native UIKit resize/selection probe.

<details>
<summary>Previews</summary>

Synthetic fixture renders:

| Profile | Create agent | Bestie card |
| --- | --- | --- |
| ![Profile with separate Delete
section](https://github.com/user-attachments/assets/4b6e7cf5-b152-43a3-99d9-7c1ee65d0c70)
| ![Model and Thinking
settings](https://github.com/user-attachments/assets/c81dc138-d5d3-43bb-873b-a64171155a7d)
| ![Muted Bestie
star](https://github.com/user-attachments/assets/5ce95e3b-2403-41c5-b6d6-52b8b60cc7d6)
|

Native iOS simulator interaction with a synthetic catalog:

![Both picker values updated after native menu
selections](https://github.com/user-attachments/assets/a3ee6d4d-91e0-4df6-b4cf-b66d5c1a2e87)

</details>

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 11:28:14 -06:00
klopez4212
a2540fbe3d Align Android profile setup with iOS steps (#8871)
Android profile setup now matches iOS: choose a display name, then an
optional avatar using the existing dotted-circle placeholder and Image /
Emoji / Animated editor. Back preserves drafts; Skip saves the name
without an avatar, and failed saves retain retry/exit options.

Validated on Pixel 10 and approved by Kenny; analysis clean, 4,064
mobile tests passed (8 skipped). Device preview uses no-write callbacks;
preview-only files are excluded.

| Display name | Avatar |
| --- | --- |
| ![Display name
step](https://github.com/user-attachments/assets/516361ea-2c02-4ed5-8847-f716ed5c0272)
| ![Avatar
step](https://github.com/user-attachments/assets/2a1607e0-59dd-4ff6-9ffa-a1dd13faad3e)
|

buzz-review-completed

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 17:08:39 +00:00
Tom Brow
20742a236d fix(mobile): only render known channels as #channel chips (#8862)
Follows [#8860](https://github.com/block/buzz/pull/8860) (merged).

On mobile, any `#token` rendered as a channel chip, so GitHub-style
references like `#8700` turned into inert chips for channels that don't
exist. Desktop already avoids this by only linking names in the known
channel list.

This makes mobile's message body and one-line preview do the same. With
no known names (channels still loading, or none visible), nothing
becomes a chip. An open channel the reader hasn't joined stays plain
text until the directory has loaded; before this change it was an inert,
untappable chip. messages rebuild with chips once channel names arrive.
Unlike desktop, there's no "any `#token` while empty" fallback, because
an empty map can't distinguish loading from an account with no visible
channels. The known names come from the existing
`channelIdsByNameProvider` (the reader's channels, plus open directory
channels once Browse channels or invite recovery has loaded the
directory), so there is no new fetch, subscription or sync change. When
the list is non-empty, the regex has one alternative fewer than before.

### Validation

Added tests:
- Preview: `#8700`, `#8774's`, a known-name prefix (`#gen` vs `general`)
and `#eng-ios` with only `eng` known stay text, while `#general` and a
longer known `#eng-ios` are chips. With no channel names, nothing chips.
- Message body: `Took over #8700 from #general` renders one chip
(`general`) and keeps `#8700` as text.

- Message body: with no channel names, `#unknown` stays text.

The new assertions fail with the previous always-generic pattern. 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:47:19 -07:00
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
klopez4212
120cbae8e5 fix(mobile): restore inline typing groups and keep working thread links (#8865)
Restores mobile’s shared inline typing bubble and animated avatar
cluster after #8765 replaced them with composer activity. Humans and
agents share the group, including the existing overflow badge and
reduced-motion behavior; fresh replies regain the bubble-to-message
handoff.

Keeps the working-agent reply link from #8754, including its current DM
support: a root message can show working agents and open its thread
before the first reply. Thread timelines now use the same inline typing
group after their last message, so reverting the redesign does not bring
back the old full-width typing bar. Archived and non-member
conversations retain their existing no-typing-indicator behavior.

This intentionally follows the requested mobile presentation rather than
buzz-app’s composer activity layout. VISION_MOBILE.md allows
platform-specific presentation. The composer’s “Working now” list is
removed with the redesign; the root-message thread links remain.

Validation:
- At `5df48ad4b`: `just mobile-install`, `just mobile-check` and `just
mobile-test` passed (4,036 Flutter tests passed, 30 skipped;
unconfigured-push checks and 27 crypto tests also passed). Repository
file-size checks passed.
- Required pre-push hooks passed, including a second full mobile
check/test run and the repository file-size gate. Hosted CI is pending.
- Extended the existing thread journey through opening an empty working
thread, mixed human/agent typing after a reply, clearing typing, and
Back. Existing coverage exercises avatar grouping, overflow, reduced
motion, reply handoff, and followed/detached thread scrolling.
- Agent self-review completed; no additional blockers found after
correcting inventory-only agent avatar shapes and waiting for timeline
layout before following new thread typing.
- Simulator component preview uses synthetic identities in a local,
uncommitted entrypoint. It is not evidence of a live relay exchange.

Human verification pending (draft):
1. In a channel or DM, have an agent work on a threaded reply. Confirm
the root’s working-agent reply link opens that thread before a reply
arrives.
2. Have multiple people/agents type. Confirm one inline avatar group and
dot bubble, including inside the opened thread, with no wide composer
bar.
3. Receive a fresh reply in the main conversation/Solo and check the
typing-to-message handoff. In a long thread, check typing while
following the latest message and while scrolled up, then navigate Back.

Component preview on iPhone 18 Pro (iOS 27.0 simulator). These are
production widgets in an uncommitted preview shell with synthetic
identities; surrounding screen chrome is not a full-app screenshot.

![Inline group together with the retained working thread
link](https://github.com/user-attachments/assets/28f57a27-9319-4d27-a965-24d0dca3b620)

![Five typers use the circular overflow
badge](https://github.com/user-attachments/assets/5912862e-ac5a-48f7-a79c-39c2e2231d24)

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 09:09:30 -07:00
klopez4212
0a46f329c0 Fade welcome bees with the QR scanner transition (#8859)
Fixes the welcome bees remaining visible when the QR scanner opens after
#8853. Bees now share the foreground’s fade and scale progress, pause
while hidden, and return on dismissal. Reduce Motion skips scaling.

Validated scanner open/close in the iPhone simulator,
normal/reduced-motion widget journeys, analysis, and the full mobile
suite. Simulator camera hardware is unavailable; QR decoding was not
exercised. Independent review found no blockers.


https://github.com/user-attachments/assets/1ce046b2-63e3-4441-90e9-9d9ec048bdfa

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 16:09:27 +00:00
klopez4212
2ca77747d1 Fix mobile Add Community loading and membership restoration (#8796)
## Summary
Open Add Community immediately from the post-login picker and return
directly on Back, without membership restoration or repeated discovery
during navigation. Completing Add restores the saved selection while
keeping the newly added community active; failures retain progress and
offer Retry.

Follow-up to #8729. Mobile app update only; no relay deployment
required.

## Testing
`just mobile-install mobile-check mobile-test` passed (4,025 standard
tests), plus 4,049 Builderlab-enabled tests on the merged revision.
Production-path journeys cover hosted and self-hosted completion,
partial restoration and Retry, persisted memberships, and the active
destination. Removing the completion hook makes the new journeys fail.
Independent agent review found no blockers. Native walkthrough and human
verification remain pending.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 16:01:15 +00:00
klopez4212
cfcaef4e9f Update mobile toast animations (#8855)
Updates mobile toast animations and styling.



| Sign in | Retry | Copied |
| --- | --- | --- |
| ![Reconnect to
Builderlab](https://github.com/user-attachments/assets/5298b507-df5b-49da-a021-03f337e997fa)
| ![Save error with
Retry](https://github.com/user-attachments/assets/492c8929-4f91-4342-943b-a72b96547992)
| ![Copied
confirmation](https://github.com/user-attachments/assets/864fd629-7414-415e-81ef-5f7d3d5333a4)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 07:50:00 -07:00
klopez4212
5f13984a19 Bring buzz.xyz branding and animated bees to mobile welcome (#8853)
Replaces the mobile welcome gradient with buzz.xyz’s green and 12
animated bees. The swarm keeps flying through rotation, respects Reduce
Motion, and leaves controls tappable; the primary button label is now
white. The ghost button has an opaque chartreuse fill so bees cannot
show through its text.

Validated in the iPhone simulator, with animation/rotation journeys,
analysis, and the full mobile suite passing. Agent review found no
blockers.


https://github.com/user-attachments/assets/9aa1472c-c8e5-4e8b-a016-a8cba36805e1

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 07:47:25 -07:00
klopez4212
4de1b6aeac Simplify mobile Solo and DM empty states (#8851)
Replace the embedded Solo onboarding block with “No chats yet.” Give
Solo and DM empty states matching left alignment and spacing below their
headings, with softer text at 65% opacity.

Validated with mobile formatting, analysis, the full mobile test suite,
and a Flutter widget preview measuring equal 16-point gaps below both
headings.

### Preview

Actual Flutter widgets with sample data; not a device capture.

![Solo and DM empty states with matching
spacing](https://github.com/user-attachments/assets/f044b7e5-b1ed-4d83-912d-a0fa119055d4)

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 07:46:57 -07:00
klopez4212
9c3ba83adb Simplify signed-in mobile community onboarding (#8852)
Replace the signed-in mobile welcome screen with **Add a community**: QR
scan first, then grey secondary actions for community links, finding
saved communities, and creation. Hide **Find my communities** when none
are known; refresh on entry/resume and every 30 seconds while active,
retaining results on transient failure.

Community switcher → Add keeps its two-action flow and uses the same
grey secondary link button.

Validation: Flutter analysis, full mobile suite (4,014 tests),
Builderlab-enabled full suite (4,036 tests), widget interactions, and
independent agent review. Draft pending native sign-in and human
testing. Snapshots render the production Flutter widgets; native
navigation/status bars are omitted.

| Communities available | No communities | Switcher → Add |
|---|---|---|
| ![Onboarding with
communities](https://github.com/user-attachments/assets/444b05c5-711f-41df-9c50-293ad9e13767)
| ![Onboarding without
communities](https://github.com/user-attachments/assets/db78a490-bd8e-4d78-97b4-a391b52290d8)
| ![Switcher Add with grey secondary
button](https://github.com/user-attachments/assets/de9e42d2-dd53-462b-98c7-da87223e5dd4)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-31 07:46:44 -07:00
Logan Johnson
547de61aa5 fix(mobile): show channel posts before a burst of join notices (#8798)
## Summary

When many people join a channel at once, the mobile app could open that
channel and show only a "… joined" line, with none of the channel's
posts. You had to scroll up before any messages appeared. With this
change, the posts always show first, and the join lines appear among
them in the right places.

The cause: the app loads the newest 50 timeline rows when a channel
opens, and join notices counted toward those 50. A burst of 50 or more
joins filled the whole first page. The app combines a run of joins into
one line only when it draws the screen, so the user saw a single "Guest
10 joined … and 48 others" line. The app loads older rows only after the
user scrolls.

This is the mobile port of the desktop app's fix,
https://github.com/block/buzz-app/pull/1983, which has already merged.
It needs no relay change.

- History pages no longer include join notices, so the first page is all
posts.
- The app reads join notices with a separate read, newest first, 500 per
read. It reads down to the oldest post loaded so far, and continues
after each older page loads. Like desktop, it stops after 2,000 notices.
- Each notice read also reads the reactions on those notices, and any
removals of those reactions. A page brings these back for its own rows,
but notices are no longer on the pages, so they need their own read.
These reads name the channel in `#h`, so a system channel, or an
unlisted channel opened by a non-member, still returns them (NIP-CL).
Deletions are also read without `#h`, because a deletion can be stored
with no channel. Each read names at most 500 target ids, so it stays
under the relay's 1 MiB request limit. A notice's reactions show even
when they sort below the oldest loaded post.
- Posts show as soon as their page loads. The notices follow and are
merged into the timeline, so they do not replace rows that arrived live
in the meantime.
- A notice that is older than the oldest loaded post waits until its
page loads. This prevents a join from showing at the top of the timeline
with a gap of missing posts below it.
- If a notice read fails, the posts still show. The next page load tries
the notices again; if a page loaded while the read was running, the read
runs once more right away.
- The same applies to every system notice (joins, topic changes, channel
created or archived), as they share one event kind.

### Related issue

AIDA-2328. Desktop fix (merged):
https://github.com/block/buzz-app/pull/1983.

### Testing

Before (left, older build) and after (right, this branch) on the Android
emulator, against a local relay. #general and #4things each have 4 posts
followed by 60 joins:


https://github.com/user-attachments/assets/53b80942-d8c3-4604-8b95-cc5ca7ab6946

![Before and after: the old build shows only a joins line; the fix shows
the 4 posts above the joins
line](https://github.com/user-attachments/assets/58e121b9-855c-4844-a73a-c71b54252db2)

- New `channel_messages_provider_test.dart` cases run against the real
channel provider, with only relay responses faked:
- A burst of 500+ joins does not hold posts back. If the first notice
read fails, the posts still show. A later page read retries the notices
and continues the descent.
- Notices in the same second as the oldest loaded post follow the post's
position within that second.
  - The descent stops at 2,000 notices.
- A notice keeps its reactions, and a removed reaction stays removed.
Reactions are read past the relay's 1,000-event page. The fake relay
applies the NIP-CL rule, so a read without `#h` finds no channel
reactions.
  - A page that loads while a notice read fails still gets its notices.
- `just mobile-check` and the full `just mobile-test` pass at
`7a38763af`.

Not yet tested on a physical device, or on iOS.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:34:41 -04:00
Logan Johnson
aa5f3e7bde feat(mobile): show conversation activity by the composer, as buzz-app does (#8765)
## Summary

Stacked on #8754. This brings the rest of buzz-app's conversation
activity to mobile.

buzz-app shows who is active in a conversation in one place, just above
the composer (`src/features/messages/TypingIndicator.tsx`). Mobile had
its own design: a typing bubble at the end of the timeline that turned
into the agent's reply (the "handoff"). This change replaces that design
with buzz-app's indicator in channels, DMs, Me and threads.

What the indicator shows, as in buzz-app:

- **On the right: your agents working here.** Up to four agent avatars,
then "+N". "Your agents" are your agent inventory (kind 30177), as in
#8754. Tapping the avatars opens the "Working now" list.
- **On the left: everyone else typing here.** Typing dots and buzz-app's
text: "Alice is typing", "Alice, Bob are typing", "Alice, Bob and 1
others are typing".
- **"Working now" list.** Each row shows the agent, "Working" and, in a
channel view, where it works: "Channel conversation", or "Thread ·
<first 60 characters of the root>", with "+N more" after two places.
- If the agent works in exactly one thread, the row opens that thread. A
thread whose root is not loaded opens by its ID, as buzz-app's link
does. A button at the end of the row opens the agent's activity.
- Otherwise (in a thread view, in Me, in the channel only, or in several
threads), the row opens the agent's activity. As in buzz-app, work in
the channel does not count as a thread: an agent in the channel and one
thread opens that thread.
  - "Activity" is mobile's existing `AgentActivitySheet`.
  - The list closes when the last agent stops.
- **Scope** (`current-activity.ts`: "Channel views include threads;
thread views do not"):

  | View | Your agents | Everyone else |
  |---|---|---|
  | Channel or DM | Here and in any thread | Here only |
  | Thread | This thread only | This thread only |
  | Me | Anywhere | Anywhere |

- **Me** works like buzz-app's Solo chat: with one agent working,
tapping the avatars opens its activity directly.
- **Spoken status:** buzz-app's live status, for example "Jerry, Morty,
Summer are working. Alice is typing". The button says "Activity: Morty
working" or "Activity: 3 agents working".

Changes you will notice compared with #8754 and main:

- The typing bubble at the end of the timeline and the bubble-to-reply
handoff are removed. #8754's channel typing row goes with them. The root
message's reply row from #8754 stays.
- In DMs, other people's agents typing in a thread no longer show at the
DM level. Only your agents do, as in buzz-app. This reverses part of
#8731.
- With no composer, there is no indicator. This applies when you are not
a member or the channel is archived, as in buzz-app (`ChannelsPage`, and
`ThreadPanel`'s `composerRoot`). Before, mobile showed typing in those
threads.

Less than buzz-app, not in this PR:

- Status is always "Working". buzz-app also uses lifecycle evidence
(local agent state, kind 24200) and tool labels. Mobile uses typing
only, as in #8754.
- No hover preview and no keyboard path (Down arrow) into the list.
- The indicator sits in the composer dock, so it moves the timeline up a
little. In buzz-app it floats over the history.

Code:

- `conversation_activity_state.dart` holds the scope rules, read from
typing and the inventory.
- `conversation_activity.dart` is the indicator.
`working_now_sheet.dart` is the list.
- `channel_detail_page/composer_activity.dart` puts it in the channel
composer dock and opens threads. The thread page puts it above its
composer.
- Removed: `inline_agent_typing.dart`, `agent_reply_handoff.dart`,
`agent_typing_bubble.dart`, `typing_avatar_cluster.dart`,
`typing_motion_preview.dart`, `channel_typing_indicator.dart`, and their
tests.

### Related issue

N/A. Reported in Buzz #buzz-bugs (on iOS you cannot tell whether an
agent is down or typing). Searched issues and PRs for duplicates: none
found.

### Testing

Android emulator, local relay, debug build of `8362d46af`.

**Channel and thread.** Demo User mentions Morty. Morty, Summer and
Jerry (in Demo User's agent inventory) type in the mention's thread.
Rick (not in the inventory) types in the thread and in the channel
itself. In the video:

1. The channel shows three agent avatars on the right and "Rick is
typing" on the left. Rick's thread typing does not show.
2. Tapping the avatars opens "Working now". Each row reads "Working" and
"Thread · …". Tapping Morty's row opens the thread.
3. In the thread, the same three agents show, with "Rick is typing" (his
thread typing). Rows there open activity: tapping Morty's opens his
activity sheet.
4. Back in the channel, Summer, Jerry and Rick stop. Only Morty's avatar
is left. Then Morty replies and the indicator goes away. No typing
bubble shows at any point.


https://github.com/user-attachments/assets/b300e16e-8bec-4489-9ee4-a68c5c2dc30d

**DM.** A DM with Morty (in the inventory) and Rick (not). Demo User
posts. Both type in its thread, and only Morty's avatar shows. Then Rick
also types in the DM itself, and "Rick is typing" shows. Morty replies,
and his avatar goes away.


https://github.com/user-attachments/assets/3614be5f-3a69-4a1a-9290-d1fad16a5445

The UI tree confirmed each state, for example "Summer, Jerry, Morty are
working. Rick is typing", "Activity: 3 agents working", "Morty is
working" (agents only), and "Morty is working. Rick is typing" (DM).

- Widget tests in `channel_detail_page_test.dart` (Typing indicator
group):
- Scope table: Me, channel and DM, for a person and for your agent.
While the inventory loads, an agent never shows as a person.
- The journey from #8754, extended: the composer status and button, the
list's places, opening the thread, thread-view rows opening activity,
and the list closing when work stops.
- Six agents in several places: four avatars and "+2", "+1 more",
scrolling to the last row, opening a thread that is not loaded, and
opening activity.
- Me opens a lone agent's activity directly. People typing: 1, 2 and 3.
- Each new check was made to fail on purpose by removing the code it
guards.
- `just mobile-check` and the full `just mobile-test` passed on
`3480ad238` (3983 passed, 28 skipped).
- Typing names use the full foreground, so they stay readable in dark
themes (review feedback). A test checks the color.
- Auto and Cerveau reviewed it adversarially against buzz-app
origin/main. Their findings are fixed: the list did not scroll, unloaded
threads did not open, the Me behaviour, the non-member indicator, and a
double-tap pop. Their last pass on `2c45f3ec0` found nothing. The device
run then showed that, with only agents working, the spoken status had no
size and Android dropped it. `8362d46af` fixes this, and their review of
that fix found nothing.
- Not yet tested on iOS or by a human.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:17:34 -04:00
Logan Johnson
851250524e feat(mobile): show your agents working in a thread on its root message (#8754)
## Summary

When you mention one of your agents in an ordinary channel on mobile,
nothing in the channel showed that the agent was working until its reply
landed. The agent answers in the mention's thread, so its typing (kind
20002) is thread-scoped, and the channel timeline hides thread typing.
The header working dot that used to cover this was removed in #8052,
#8075 and #8082.

This change brings buzz-app's behaviour to mobile. In buzz-app, the
thread summary under a message shows the viewer's own agents while they
type in that thread (`MessageRow.tsx` `useThreadAgents`, described in
`docs/agents.md`). Mobile now does the same. The root message's reply
row shows the working agents' avatars and the typing dots, and the row
appears even under a mention that has no replies yet. It then reads
"View thread". Tapping it opens the thread. When the reply arrives and
the typing ends, the dots go away and the row reads "1 reply".

The details follow buzz-app:

- Only your agents count. buzz-app's "your agents"
(`agentChoices.identities`) are your agent inventory, which is the kind
30177 records you author with archived agents included, plus your local
agents. It does not read the NIP-OA owner tag. Mobile uses the same
inventory. An agent that only names you as owner in its profile does not
count. People and other agents typing in a thread stay inside the thread
view.
- Working agents leave the participant stack for their own group: up to
two agent-shaped avatars side by side, then "+N", then the dots.
- The curved reply branch shows only when the message has replies.
- buzz-app's channel indicator by the composer also includes your agents
working in any thread ("Channel views include threads" in
`current-activity.ts`). Mobile's channel-level surface is the typing row
at the end of the timeline. In ordinary channels, that row now also
shows your agents that are typing in a thread, with the agent avatar
shape. It goes away when the agent's reply arrives.
- The spoken labels use buzz-app's strings: "View thread: Morty is
working", "View thread: 3 agents are working" and "View thread: 1 reply.
Morty working".
- Me and DMs already show thread typing inline, so they are unchanged.

Code changes:

- `TypingDots` is extracted from `AgentTypingBubble`, so the reply row
and the bubble share one animation. It respects reduce motion.
- `ReplySummaryLink` accepts a nullable summary and a list of working
agents with their names. `SmallAvatar` gains an `agent` flag for the
working group, and `InlineAgentTyping` a `knownAgents` set so the
channel typing row gives inventory agents the agent shape.
- `meAgentInventoryProvider` holds the inventory keys. It is read only
while a thread in the channel has typing. Each read, failed ones
included, is reused for 30 seconds, then read again if still watched, or
dropped. So the inventory refreshes every 30 seconds while it is
watched, and a short gap between an agent's messages does not query
again.
- The page selects a "pubkey root" key from channel typing, so typing
expiry refreshes do not rebuild it.

Less than buzz-app, not in this PR:
- buzz-app prefers lifecycle evidence (local agent state and kind 24200
observer turns) and falls back to typing. Mobile uses typing only. So
when an agent stops without replying, mobile keeps its dots until the
typing expires (8 seconds). A second buzz-app device without that
evidence behaves the same way. I found no 24200 publisher in buzz-app
itself. buzz-app publishes typing (kind 20002) for the agents it runs.
- The channel typing row reads "Morty is typing" where buzz-app's
indicator says "working". It has no popover that names the thread and no
tap action. It sits after the newest message, so it scrolls away with
the timeline, while buzz-app's indicator stays by the composer.

### Related issue

N/A. Reported in Buzz #buzz-bugs. Searched issues and PRs for
duplicates: none found.

### Testing

Android emulator, local relay, build of `3caa17a20`. Demo User mentions
Morty. Morty, Summer, Jerry and Rick send thread typing:
- Morty is a channel bot in Demo User's agent inventory.
- Summer and Jerry are in the inventory but are ordinary members, so
only the inventory gives them the agent shape.
- Rick names Demo User as owner in his profile but is not in the
inventory.

In the video:
1. The root message shows Morty and Summer, "+1", the dots and "View
thread", with no reply branch. The channel typing row reads "Morty and 2
others" with three agent avatars. Rick does not show.
2. Tapping "View thread" opens the thread before the first reply. Back
to the channel.
3. Summer and Jerry stop. Their typing expires, and only Morty is left
on both rows.
4. Morty replies. The typing row goes away, the reply branch shows, and
the root row reads "1 reply".

The UI tree confirmed "View thread: 3 agents are working", "Morty and 2
others are typing", "View thread: Morty is working", "Morty is typing"
and "View thread: 1 reply".


https://github.com/user-attachments/assets/2237e565-aa48-405a-84ca-39ab9a06b7a6

- The widget test "an agent working in a thread shows on its root
message" (`channel_detail_page_test.dart`, Typing indicator group)
covers these cases:
- A person, and an agent outside the inventory that names you as owner,
show no row and no channel typing row.
- Inventory agents also show in the channel typing row ("Morty and 2
others are typing", checked in the semantics tree), with the agent
shape. That row goes away when the reply arrives.
- Three inventory agents show two avatars with the agent shape, "+1",
"View thread", no branch, and "View thread: 3 agents are working".
  - The row opens the thread before the first reply.
- After the reply, Morty shows once, the branch shows, and the label is
"View thread: 1 reply. Morty working".
- With Summer still typing, Morty removed from the inventory stops
counting after the 30-second refresh.
- Each check was made to fail on purpose by removing the code it guards.
- `just mobile-check` and the full `just mobile-test` passed on
`3caa17a20` (3996 passed, 28 skipped).
- Auto and Cerveau reviewed it adversarially against buzz-app
origin/main. Their findings are fixed, and their last pass found
nothing.
- Not yet tested on iOS or by a human.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:17:33 -04:00
klopez4212
f3a7bab098 Clarify mobile community onboarding and saved identity selection (#8729)
## Summary

Make community onboarding easier to scan: shorten hosted hostname
fallbacks, clarify Add Community instructions, and replace raw saved-key
buttons with identity cards. Use white pages, grey cards, ghost
secondary actions, standard page transitions, and a “Getting ready”
screen during joining. Native profile setup keeps a horizontal modal
transition. Identity cards load signed name/avatar metadata from saved
communities without switching accounts; unavailable profiles use a
neutral fallback. Cards show only the avatar, a 16px medium-weight name,
and muted npub; community lists are omitted. Retiring profile setup
closes its avatar editor too.

### Related issue

Follow-up to #8687 and #8599; no duplicate PR found.

### Testing

- Formatting and analysis passed. Full suite with hosted-auth defines:
4,019 passed, 5 skipped; includes profile-fetch and cancellation
regressions.
- Prior iOS device preview and native profile tests passed; hosted CI
native Swift checks passed on the preceding head. Latest Dart fixes are
not yet reinstalled on the phone.
- Simulator walkthrough and owner-tested iPhone preview use sample
identities and simulated admission.

Sample-data previews; the identity snapshot shows the
unavailable-profile fallback rendered by Flutter. Media is attached here
only.

| Community picker | Add Community | Saved identity |
| --- | --- | --- |
| ![Shortened community
name](https://github.com/user-attachments/assets/cf0af6aa-3a3d-4ffe-b469-e26f9bb92c30)
| ![White Add Community
page](https://github.com/user-attachments/assets/b2f71c77-1aa0-465a-b302-7eb5f1e92819)
| ![Saved identity card and ghost import
action](https://github.com/user-attachments/assets/47f20f34-f047-4ce5-befa-f56834096e95)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-30 19:00:42 +00:00
klopez4212
c0c606e2e3 Polish mobile navigation and restore community switch animation (#8732)
Removes aggregate unread dots from mobile filters, Inbox, and Solo
section headings. The aggregate-dot removal is an explicitly requested
product change. Solo and Team names match the current `block/buzz-app`
sidebar’s light/dark colours and 400/600 read/unread weights (not this
repository’s older `desktop/` implementation); Solo rows show
owned-agent working dots with reduced-motion support.

Restores the community-switch loading and avatar flight with a leftward
arc to the community menu in its current top-right position.

Mobile uses one fixed light/dark application palette; legacy catalog
theme names do not select navigation palettes. The 600 unread weight
follows [the current desktop sidebar
override](36a283b238/src/bundled/channels/Channels.module.css (L47)).

Working status uses live agent typing; desktop’s local waiting state is
not available on mobile.

Validation: clean analysis; 3,997 mobile tests passed, 28 skipped; four
push-configuration checks passed. Navigation styling visually approved
on iPhone; community-switch regression covers portrait/landscape and
normal/reduced motion; authenticated-shell recovery is covered. Hosted
CI passed at `bfeb0fecd`. Updated Pairing Preview installed on iPhone
for transition testing.

### Snapshots

Actual Flutter widgets with sample conversations; static working dots
for reduced motion.

| Light | Dark |
|---|---|
| ![Light theme: unread chat above read
chat](https://github.com/user-attachments/assets/d83b35d5-ab9b-44e0-b7d6-6527ef10a776)
| ![Dark theme: unread chat above read
chat](https://github.com/user-attachments/assets/45f64291-5d39-4e17-8f72-1aa1271c10b7)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-30 18:03:25 +00:00
Wes
75854111b8 fix(mobile): retain invite keys and reject incomplete onboarding (#8753)
Self-hosted invite claims retain the generated identity in secure
storage before the HTTP request and reuse it after a lost response or
restart. Saving or reopening an existing destination retires the
matching journal. Sign-out/removal deletes all matching pending key
copies before removing the saved community, preserving the community for
retry if cleanup fails.

Pairing verifies that relay authentication completed before
saving/activating a destination or reporting success. On iOS 16, hosted
entry permits recovery and reuse of backed-up identities, including
binding a recovered identity with a confirmed backup receipt. Paths
requiring a new secure backup explain the iOS 17 requirement before
generating or binding a new key. Self-hosted entry remains available.

### Validation

- Initial focused entry/recovery files: 83 passed, 1 skipped. Review-fix
focused storage, community, invite and hosted files: 82 passed, 1
skipped; extended invite journey: 17 passed, 1 skipped.
- Final hosted journey extension: 20 passed, including both bound and
unbound recovery with native sealing unavailable.
- Isolated mutations removing invite retention, pairing validation,
journal removal/re-entry cleanup or restoring the blanket platform gate
fail their intended regressions. Restored controls pass.
- iOS simulator build passed on the original integration base; final
native/device acceptance remains outstanding.
- Carl and three specialist reviewers found no source-review blockers at
`323cec6ea2`. `a55a246857` adds analyzer fixes, copy cleanup and the
recovered-unbound journey coverage. Reviewers did not run tests or the
app.

- Fixed a push-hook timeout in `4564b3562a`: idle serial queues now
release completed futures, avoiding scheduler retention across widget
tests while preserving in-flight ordering and failure isolation. The
existing dispatcher journey fails promptly before the fix and passes
afterward; Carl reviewed this delta with no blockers. Focused
dispatcher/invite/storage checks passed, and all 20 hosted journeys
passed with hosted auth enabled.

- Mandatory pre-push checks passed at `4564b3562a` (scope, branch skew,
file size, mobile analysis/tests and crypto package checks); GitHub head
verified at that commit.

### Remaining acceptance

Draft pending agent/device and human acceptance. Exercise interrupted
one-use invite claim and retry across restart, sign-out then reopen
without restoring the removed identity, rejected self-hosted pairing,
iOS 16 backed-up identity recovery (including binding), and iOS 16 new
setup blocked before key creation. Synthetic network/storage boundaries
do not prove native durability or live server behavior. Hosted CI
results are not claimed here.

Optional follow-ups remain outside this patch: pruning provably
unadmitted journals, malformed-record recovery, avoiding an iOS 16
dead-end device-key selection, and pre-existing removal/push-revocation
ordering.

This PR contains three existing-path fixes. The two organization-login
fixes depend on #8700 and remain separate: its stale parent conflicts
with main in unrelated relay code, and the required branch-skew hook
prevents publishing that stack unchanged. This PR does not refresh that
parent or change deployment policy.

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
2026-10-30 10:38:24 -06:00
klopez4212
aae0081a90 fix(mobile): show agent DM typing and balance reply bubble padding (#8731)
Messages with a reply footer now keep even vertical text padding unless
they have actual overlapping reactions. Agent typing indicators are now
visible in both one-to-one and group DMs when the response is
thread-scoped, regardless of Bestie selection.

The typing fix originated in #8665 and now applies to every agent DM
using the existing agent classification. It retains main's
`visibleTypingProvider` filtering. Ordinary channels and human
thread-typing signals retain their existing scope; voice recording is
not included.

Validation: required pre-push hooks passed, including mobile formatting,
analysis, tests, native crypto package tests, and file-size checks.
Flutter analysis and the full mobile suite pass (3,995 passed, 28
skipped). Widget coverage compares bubble heights with and without a
reply footer and checks typing across Solo, ordinary channels, agent
DMs, human DMs, and group DMs with agents.

Marked ready for review at the owner’s request. Device verification
remains pending. To try: open a DM with any agent, including one not
selected as Bestie, while it handles a thread-scoped response and check
for its avatar and three dots; repeat in a group DM with an agent;
compare equal text in messages with and without a reply footer, with no
reactions, and confirm equal bubble heights.

The broad `just ci` check was stopped during the unrelated desktop Rust
dependency build after the mobile pre-push checks passed; no
full-repository CI pass is claimed.



### Before / after

Flutter widget-harness snapshots with identical synthetic data; not
native device captures. Before: the reply-footer bubble has excess
bottom padding and the thread-scoped Bestie typing signal is hidden.
After: both text bubbles have equal height, and Bestie’s avatar and
three dots are visible.

| Before | After |
| --- | --- |
| ![Before: uneven bubble padding and hidden Bestie
typing](https://github.com/user-attachments/assets/b7b9279d-4b6d-4263-8b4c-91451ee57fd0)
| ![After: balanced bubbles and visible Bestie
typing](https://github.com/user-attachments/assets/c97be4fd-5fc0-47e5-8b78-5b0b9c60254a)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-30 15:09:07 +00:00
Tom Brow
64312fa5be fix(mobile): address #8650 second-pass review (#8691)
Follow-up to #8650. This addresses the items from the [second-pass
review](https://github.com/block/buzz/pull/8650#pullrequestreview-5700660448),
which arrived after #8650 merged.

- **Setting menu semantics.** Options in the shared `BuzzSettingMenu`
(model, reasoning effort, and channel TTL) expose their checked state
again. The trigger is announced as a button with enabled and expanded
state, so a disabled "Reasoning effort" no longer reads as plain text.
The `PopupMenuButton` this menu replaced also provided a named route and
a "Dismiss menu" action. `MenuAnchor` does not provide them, so this PR
does not restore them.
- **Remote listing failures.** "Could not load agents" for a failed
Builderlab listing now appears only in communities that support remote
agents. For example, it no longer appears in a non-hosted community
while signed in.
- **Add agent during a community reload.** No change needed here. #8693
already disables Add while the page has no community.

### Validation

- Added tests: setting-menu checked, button, enabled and expanded
semantics; a failed remote listing stays hidden where remote agents are
off. Both fail without these changes.
- Mobile analysis is clean, and the Agents and shared widget tests pass
locally after rebasing onto #8693.
- Not covered: VoiceOver on a device.

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

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@sprout-oss.stage.blox.sqprod.co>
2026-10-29 15:36:21 -07:00
Tom Brow
a94ebece0e Revert "fix(mobile): push every message in your own Solo chats (#8615)" (#8690)
Reverts [#8615](https://github.com/block/buzz/pull/8615).

Mobile push for Solo chats returns to mention-only, matching buzz-app,
which alerts on every message only in DMs. This also removes the
lease-size guards #8615 added, since they existed to fit Solo chats into
the lease.

### Validation

- Clean revert of bad9d26142 with no conflicts.
- Mobile lint and the full mobile test suite pass.

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

Co-authored-by: Tom Brow <tomb@squareup.com>
2026-10-29 15:36:16 -07:00
Tom Brow
4b21a10c4b fix: don't notify workflow owners through their attribution tag (#8694)
A workflow message names its owner in a marked p tag, ["p", owner, "", "owner"], for attribution. #p live, history and push matching, operator listeners, desktop, mobile and the iOS NSE treat that tag as attribution rather than a mention. A workflow that mentions its owner adds a plain p, so the owner is notified only when actually mentioned. NOSTR.md records the #p exception.

Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Signed-off-by: Tom Brow <tomb@squareup.com>
2026-10-29 15:21:56 -07:00
Tom Brow
050d545264 perf(mobile): skip unchanged message footer layout (#8433)
Rebuilding an unchanged message footer currently schedules another
layout even when its overlap value is identical. Only invalidate footer
layout when that value changes, preserving layout updates for actual
geometry changes.

### Stable release recommendation

Exclude from `mobile-release/conference-2026-10`; defer to the following
release. The regression test demonstrates eliminated redundant layout,
but the effect on navigation latency has not been quantified.

### Validation

The added widget regression checks that unchanged footer rebuilds do not
repeat layout and changed overlap still updates geometry. The
independent footer build passes the full mobile suite, analysis, and
native iOS Simulator build. Channel scrolling, opening an existing
reaction list, and thread navigation were exercised on iOS 26.5
Simulator.

The full local repository gate previously encountered an unrelated,
unchanged desktop subprocess timing test failure; that test passed in
isolation. All PR CI checks pass, including the native iOS suite.

<!-- buzz-review-completed -->

Signed-off-by: Tom Brow <tomb@block.xyz>
2026-10-29 14:41:53 -07:00
Tom Brow
be1ac392e8 perf(mobile): render inbox and search previews as plain text (#8675)
### Summary

Inbox rows and search results show each message as a 2-line preview.
That preview was a capped `MessageContent`, so gpt_markdown parsed and
laid out the whole source (syntax-highlighted code blocks and measured
tables included), even though only two lines are painted. A native trace
on an iPhone 12 mini attributed a 102 ms inbox-open frame mostly to this
work.

Previews now skip Markdown entirely. `messagePreviewSource` takes only
the leading lines a preview can show, and at most the first 4,000
characters of a single long line, so link normalization, mention binding
and emoji lookup never scan the rest of a long message.
`messagePreviewPieces` is then a linear pass over those lines, similar
to desktop's `getMarkdownPreviewText`. It drops block syntax (headings,
quotes, list markers, rules, table dividers, code fences) and unwraps
inline emphasis and `<u>`, honoring backslash escapes and keeping inline
(including multi-backtick) and fenced code as literal text. It also
replaces links with their label. The new `MessagePreview` widget renders
the result as a single `Text.rich` with `maxLines` and an ellipsis.

Tokens keep the look they have in the thread view:
- A bound mention is the same `MessageMentionPill` chip, with the bot
icon for agents. An ambiguous mention stays as text.
- `#channel` tokens and `buzz://channel/...` links are the same channel
token chip.
- A `buzz://message`, repo, PR or issue link that shows its own URL
previews with the thread view's short label, such as `general ·
abcdef01`. Both use the shared `buzzLinkLabel` helper.
- Custom emoji render as inline images. Only shortcodes the message
names are looked up in the palette.
- Media links show as "Image", "Video" or "Audio".

Chips in previews are not tappable, and tapping the row opens the
message. Bold, italic, inline code and link styling are no longer shown
in previews. The timeline and thread view are unchanged, and so is the
profile status line, which still uses `MessageContent`.

This replaces this PR's earlier approach of cutting the Markdown source
before parsing. That approach needed delimiter-balance heuristics, and a
security review found a real case (`**` inside a link label) where the
heuristic misfired.

### Validation

- `preview_text_test.dart` is a table test of the parser: block syntax,
emphasis that must and must not unwrap (`snake_case`, a lone `*`),
inline and fenced code, unpaired backticks, links, tables, the line
limit and the long-line cap. It also covers mentions (bound, ambiguous,
inside emphasis, link labels and code), custom emoji (including adjacent
`🅰️b:`), channel tokens and links, message and repo link labels, and
media. The long-line row also asserts that `messagePreviewSource`
returns a bounded prefix.
- `message_preview_test.dart` checks the widget: no `GptMarkdown`, one
capped and ellipsized paragraph, mention chip, custom emoji image,
channel chip, media label and empty content.
- Existing inbox and search tests updated to find `MessagePreview`,
including the agent-chip test in search.
- `flutter analyze` and the full mobile test suite pass at 8c721ba3a
(with `--dart-define=BUZZ_PUSH_GATEWAY_URL=https://push.example`, as
`just mobile-test` runs it).
- Device A/B on an iPhone 12 mini, using Profile builds against the real
inbox on the internal relay. Each run was a cold launch followed by 6
Inbox opens, in the order main, fix, main, fix:

  | | main eda26b942 | this PR 6661d594a |
  |---|---|---|
| First open, worst frame (run 1 / run 2) | 40.4 / 34.9 ms | 22.4 / 23.2
ms |
| First open, build total (run 1 / run 2) | 77.8 / 91.1 ms | 38.5 / 52.3
ms |
  | All opens, median worst frame | 27.2 ms | 23.3 ms |
  | All opens, median build total | 43.4 ms | 26.6 ms |

First open drops about 40% in build time and about 14 ms in worst frame.
On warm opens, build time also drops about 40%, but the worst frame
barely moves, so what remains in those frames is not the preview parse.

## Codex review status

Codex reviewed this PR over four rounds. Every finding about cost or
correctness is fixed, and those threads are resolved. Later rounds
turned up narrower and narrower preview edge cases, so the author
decided to stop iterating on Codex findings. Any Codex thread still
open, or any finding Codex posts after f538853ed, is a deliberately
accepted preview limitation and doesn't block merging. Example: a [code
span that continues across a line
break](https://github.com/block/buzz/pull/8675#discussion_r4415196032)
can preview a mention as a chip. The full message view is unaffected.
Only the one- or two-line inbox and search previews can differ from it.

buzz-review-completed

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

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:54:32 -07:00
Wes
fffd8ca957 fix(mobile): recover Solo sync silently instead of showing a retry banner (#8701)
## Problem

The mobile Solo section could display "Live updates stopped. Your saved
chats are still available." with a **Retry live updates** button. Any
failed Solo head refresh raised this banner. That includes the refresh
that runs on app resume before the relay has reconnected, and an 8s
history timeout. In those cases the live subscription itself was still
healthy. A later successful refresh did not clear the banner, so it
stayed up until someone tapped Retry.

## Change

- Remove the banner along with `MeSync.syncClosed` and
`meSyncWarningProvider`. Saved chats stay visible the whole time.
- `meGroupsProvider`: on app resume, an interrupted reader (terminal
CLOSED or a failed read) resubscribes on its own while the relay is
connected. Before the relay reconnects, the existing
rebuild-on-reconnect still owns recovery. A healthy reader keeps doing a
plain head refresh.
- Home's pull-to-refresh (`ChannelsPage` with the Solo sliver) now also
restarts the Solo reader. Before this change, that path refreshed
channels only, so in the shipped layout the banner was the only manual
recovery.
- The no-snapshot `_MeRetry` state and the offline-save warning are
unchanged.

## Validation

- `flutter analyze` is clean.
- The pre-push `mobile-checks` passed.
- The journey step in `offline_save_page_test.dart` closes the
subscription, cycles background and foreground, asserts a new
subscription, and checks that a newer event delivered on it is saved.
Removing the `subscriptionClosed` recovery branch fails it.
- The new `channels_page_test.dart` case drags to refresh with a Solo
sliver and asserts the Solo reader restarts. Removing the invalidation
fails it.
- Not yet exercised in the running app. That is checklist steps 2 and 3.

Reviewed by the Royal Court agents (provider lifecycle, recovery/UX,
independent challenge); the one blocker (Home pull-to-refresh) is fixed
here.

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

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
2026-10-29 14:33:35 -06:00
Tom Brow
ccfc1490e4 perf(mobile): verify signatures with native libsecp256k1 (#8657)
The app already verifies signatures in a few places: NIP-OA agent
profiles and owner attestations, Solo `me_*` records (agent inventory,
archived agents, assistants, sync), and pairing events. Each used
`nostr.Event.fromJson`'s pure-Dart BIP-340 verify, about 11.2 ms per
event on an iPhone SE (2nd gen, Profile). This routes them through
`verifiedNostrEventFromJson` and `verifySchnorrHex`, which keep the same
checks (timestamp range, canonical id, Schnorr signature) and the same
`nostr` exception types, with the signature check in libsecp256k1 (40
µs). NIP-OA owner authorizations are now signed with `signSchnorrHex`,
which removes the last pure-Dart Schnorr call in `lib`.

Incoming relay events are still not verified; that stays a separate
decision.

A native trace showed pure-Dart Schnorr verify in `me_sync` and `nip_oa`
costs 100-125 ms per foreground. This PR moves exactly those sites.

### Validation

- Added tests: the native verifier accepts a valid event and rejects
tampered content, a wrong signature, a different pubkey, malformed and
short signatures, and a zero timestamp, each also rejected by the
pure-Dart verifier. Hex Schnorr helpers are checked in both directions
against `nostr.Schnorr`.
- Focused existing validation: crypto, NIP-OA, Solo/me, pairing and
agent tests pass. `just mobile-install mobile-check mobile-test` passes
at f90823cd1.
- Device: a Profile build of the full native stack ran on an iPhone 12
mini against the internal relay.

buzz-review-completed

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

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: george <973be878edd6d4f79692a3827f20a6f7fe0ed0362f269ff6b6ba8867033d7d8e@sprout-oss.stage.blox.sqprod.co>
2026-10-29 12:50:19 -07:00
Tom Brow
ff284d00d3 mobile: stop typing prune ticks from rebuilding channel pages (#8695)
### Summary

Typing in the mobile composer felt slower than a native iOS text field.
A device trace on an iPhone 12 mini showed the cause: while anyone in
the channel is typing, the whole channel page rebuilds once per second,
including the visible message list.

- `ChannelTypingNotifier._prune()` runs on a 1 s timer and assigned a
new list to `state` on every tick, even when nothing had changed.
- `_ResolvedChannelDetailPage` watched the whole list and only filtered
out the current user afterwards, so every tick rebuilt the page and its
`PositionedList` (12 to 35 ms per frame, 8 to 19 ms for the message list
alone).
- Your own typing indicator echoes back from the relay, so the timer
kept running the whole time you typed.

In a 30-key trace, 33 of the 35 frames over 12 ms were these rebuilds,
1.00 s apart.

### Fix

- `_prune()` publishes only when the visible entries change.
`TypingEntry` now compares by value.
- The channel and thread pages watch `visibleTypingProvider`, a
`VisibleTyping` value that already excludes the current user and applies
the page's scope. Your own echo refreshes its expiry every 3 s, which
used to rebuild the page. Now it doesn't.

Other `channelTypingProvider` consumers are unchanged.

### Related issue

None found.

### Testing

- Provider tests: a typing entry held across five prune ticks notifies
listeners once, and the pages' shared `visibleTypingProvider` is not
notified by the user's own refreshed echo but is by another user.
Breaking either guard fails its test.
- `just mobile-check` and `just mobile-test` pass at 8b8a16845.

- Device trace on an iPhone 12 mini: 30 keys typed into a channel
composer, Profile builds with build tracing on both sides. Control is
6661d594a, which has the same page code as main.

  | | control | this PR (5ff754131) |
  |---|---|---|
| Channel page rebuilds while typing | about 1 per second (44 in 40 s) |
0 |
| Largest UI build per key, median / p90 | 4.9 / 29.3 ms | 1.0 / 1.4 ms
|
  | Keys with a build over 16.7 ms | 9/30 | 0/30 |
| Frames with UI work over 12 ms | 35 (33 page rebuilds) | 1 (a
semantics update from the test driver) |
  | ComposeBar frame, median | 10.2 ms | 3.0 ms |

The test driver turns on accessibility, so semantics runs on every frame
in both traces. About 1 key in 4 still has a slow frame with about 1 ms
of build and 2 ms of raster. A Time Profiler capture put that time in
the driver's accessibility queries on the main thread (52% of
main-thread samples while typing, none before the first automated tap),
so it is a test-harness artifact rather than app work.

- Dictation on an iPhone SE (2nd gen): a 15 s paragraph dictated into a
channel composer, Profile builds with build tracing.

  | | main | this PR (5ff754131) |
  |---|---|---|
| UI frame, median / p99 / max | 0.9 / 10.4 / 26.1 ms | 0.9 / 5.3 / 10.8
ms |
  | Frames over 16.7 ms | 10 | 0 |
| Channel page rebuilds | 26 (once a second) | 6 (composer growth, none
over budget) |

Each dictation update costs about 1 ms. The caret stayed at the end and
nothing flickered on either build.

buzz-review-completed

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

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:14:55 -07:00
klopez4212
0cde1fe2f4 Make mobile Agents a full-page owned-agent directory (#8693)
Replace the mobile Agents sheet with a full-page directory of verified
owned agents. Add dedicated creation and avatar pages with
catalog-backed model selection, reuse the profile emoji/photo/camera
controls, and expose Builderbot model settings while labeling desktop
agents “Manage on desktop.” Share one account-scoped model catalog
across editable cards and retries. Choose Bestie from the agent profile
using the shared encrypted main-agent record (text-only action, filled
star once selected), and move confirmed deletion to a top-left trash
control with native iOS glass. Include uploaded avatars in owner
registrations so desktop can display them.

Validation: mobile analysis and all 3,958 hosted-enabled app tests
passed; default-build tests run by the push hook. Earlier iPhone build
installed and iterated with the user; the current iOS build succeeds,
but final changes still need a device pass. Independent review found no
new blockers. Actual camera capture and live Bestie sync remain
unconfirmed; the existing shared `main-agent` wire format and Bestie
terminology are retained.

### Snapshots

Widget-harness captures with test data (not native iOS chrome).

| Agents directory | Image avatar editor |
| --- | --- |
| ![Agents
directory](https://github.com/user-attachments/assets/c68a0505-90a5-41db-980f-e3197cac63ac)
| ![Image avatar
editor](https://github.com/user-attachments/assets/9b126186-1e7c-4169-9a74-8f7f252cfa93)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-29 18:30:17 +00:00
klopez4212
e922dc08ff Unify mobile onboarding and community entry screens (#8687)
## Summary

Use consistent fullscreen screens for identity setup, community
selection, joining, and Add Community. Restore all memberships and open
the selected community; share the community grid with the switcher.

Add QR-first choices, animated link entry with 12px keyboard clearance,
a two-finger double-tap pairing toggle, and the centered reversing bee
loader. Preserve cancellation, Back, and reduced-motion behavior.

Add intentionally omits community creation and Builderlab sign-in: this
route follows sign-in and the existing-community picker.

### Related issue

Related: #8628 (native profile setup). No duplicate fullscreen
onboarding PR found.

### Testing

- Full standard and hosted-authentication mobile suites, static
analysis, and required push checks passed.
- iPhone preview iterated with Kenny; final simulator walkthrough below
uses synthetic data and does not authenticate or save account changes.
- Independent review completed; regressions cover cancellation during
loading, Add recovery after failed/conflicting memberships, retrying
skipped communities, and explicit picker stages.

Walkthrough recorded before the copy and recovery followups:


https://github.com/user-attachments/assets/bfea3ad3-1dde-40c4-8748-44c84226c292

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-29 16:12:31 +00:00
Tom Brow
8161a7cad0 perf(mobile): derive public keys with native libsecp256k1 (#8655)
Follows #8654.

Deriving an x-only public key from a secret key with
`nostr.Keys(secret).public` costs about 5.6 ms in pure Dart on an iPhone
SE (2nd gen, Profile). The app does it in 10 places, including relay
config, the signed-event relay's `pubkey` getter, push lease checks,
status updates, and the settings identity row's `build` method. This
routes all of them through `derivePublicKeyHex` from #8654, which takes
16.5 µs on the same device.

Behavior is unchanged for valid keys: output is the same lowercase hex.
For a malformed or out-of-range key the thrown type changes from nostr's
`InvalidKeyException` to `ArgumentError`; every affected site either
catches all errors or rethrows its own `FormatException`/`StateError`,
and nothing in `lib` or `test` matches on the old type.

Sites that need a full `nostr.Keys` object (key generation,
`AccountIdentityStore`) are unchanged.

### Validation

- `derivePublicKeyHex` is checked against `nostr.Keys` for 64 random
keys in #8654's `event_signing_test.dart`.
- Full mobile analyze and test suite pass on this branch after rebasing
onto main, including the package's own tests.
- iPhone 12 mini, Profile build of this stack (with #8656 and #8657 on
top): paired to the internal Buzz community through Desktop; relay auth,
identity row, avatar, and channel/DM/inbox loading all worked under the
derived key.

buzz-review-completed (agent review, Codex and security review clean;
device validation above; human app test not applicable under the mobile
testing exception)

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

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: george <973be878edd6d4f79692a3827f20a6f7fe0ed0362f269ff6b6ba8867033d7d8e@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 08:53:58 -07:00
Tom Brow
a7e65c91da feat(mobile): choose remote agent models and gate agents on Builderlab sign-in (#8650)
Follow-up to [#8626](https://github.com/block/buzz/pull/8626). Mobile
remote-agent creation now matches desktop.

- **Model and reasoning effort:** Create agent has Model and Reasoning
effort menus. Their options come from the remote service's catalog, and
nothing is preselected (same as desktop). The server checks the
selection against the catalog again before registering, and saves it on
the agent.
- **Builderlab gate:** creating a remote agent requires a hosted
community and Builderlab sign-in. The Agents directory, community bots
and the Bestie chooser stay available without it. Signing out closes an
open Create agent sheet; the Agents sheet stays open.
- **Enrollment:** `attest-agent` enrolls the agent in the requested
community, as on desktop, so the separate `add-buzz-subscription` call
is gone.
- **Quieter progress:** spinners replace the progress bars and the
"Working…" label. Status and success text ("is ready", "Remote agent
deleted.", setup steps) is gone, and only failures show text. Refreshing
an already-loaded agent list no longer blanks it.
- **Shared setting menu:** `BuzzSettingMenu` is a bordered setting row
that opens a Material 3 menu spanning the row's width. Opening it
dismisses the keyboard. The channel-TTL setting in Create channel uses
it too.

Agent avatars and QR/link-based creation follow in stacked PRs. Editing
existing agents comes later.

| Agents | Create | Model menu |
| --- | --- | --- |
| <img
src="https://raw.githubusercontent.com/block/buzz/d0bee87c45d30b9bdd2163a75966ccd5d64f322a/pr-8650--1-agents.png"
width="240"> | <img
src="https://raw.githubusercontent.com/block/buzz/d0bee87c45d30b9bdd2163a75966ccd5d64f322a/pr-8650--2-create.png"
width="240"> | <img
src="https://raw.githubusercontent.com/block/buzz/d0bee87c45d30b9bdd2163a75966ccd5d64f322a/pr-8650--3-model-menu.png"
width="240"> |

### Validation

- Checked on the staging iOS simulator with a Builderlab account: the
Agents list, the Create sheet, and the model and effort menus (including
with the keyboard open).
- Added tests: catalog-gated model selection (including switching models
clears an unsupported effort), the Builderlab sign-in gate, controller
creation and resume with a model, a failed listing reported instead of
an empty registry, and create sheet busy and failure states (including
the catalog reload after a rejected create).
- The hosted-only agent tests are skipped without Builderlab defines,
which `mobile-test` doesn't pass. They pass locally with the staging
defines (20/20).
- Not covered: Android.

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

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: george <973be878edd6d4f79692a3827f20a6f7fe0ed0362f269ff6b6ba8867033d7d8e@sprout-oss.stage.blox.sqprod.co>
2026-10-29 08:43:45 -07:00
klopez4212
39b8b2b6a6 feat(mobile): unify Messages navigation with Solo and Team filters (#8649)
## Summary

Unify mobile conversations in Messages with All / Solo / Team filters, a
collapsing header, and separate Search, New, and default-agent
shortcuts. Move workspace actions into the community menu and keep
collapsed sections intact across filters.

Align Inbox and list typography, spacing, and muted controls. Preserve
native glass layering through navigation and give every filtered list
enough clearance above the footer. The default-agent shortcut reads the
shared encrypted preference and opens an existing chat immediately. When
unset, it opens Agents; a star action selects the default through a
production signed, self-encrypted preference writer. Save failures
remain visible and retryable.

Android now uses rounded navigation controls and filters, optically
balanced search icons, and expanding New/community menus with leading
Tabler icons matching iOS. Preset avatars retain transparent WebM
animation through an Android WebView renderer, with lifecycle pausing
and poster fallback.

### Related issue

None found in searches for mobile navigation issues and open PRs.

### Testing

- Android follow-up: ARM64 debug build, Dart analysis, and emulator
checks passed for menu placement, selection, icon alignment, search, and
avatar playback/pause/resume. The avatar implementation passed 3,840
Flutter tests and native Android tests before subsequent styling
iterations. Automated tests for the later menu/icon iterations were
skipped at the author’s request; those earlier results do not cover the
final styling changes.

- Mobile formatting/analysis and full test suite (3,838 passed, 23
skipped, plus 4 push-configuration tests); regression journey covers
filtering, collapse retention, and scrolling the last Solo row above the
footer.
- iPhone 18 Pro simulator (Honeycomb): filters, menus, Inbox,
Invite/Back, Switch Community, and default-agent chat/Back exercised.
iOS release build and Pairing Preview install/launch passed during
iteration, preserving the saved profile.
- P1 follow-up: production writer-to-reader widget journey covers
selection, publish failure/retry, and the unset footer opening Agents.
Simulator Agents open/close passes; its saved community has no
selectable agents, so live selection was not verified there.
- Independent agent review completed; its Solo footer-clearance finding
is fixed. The final clearance adjustment is covered by widget tests;
physical-device acceptance of that adjustment and hosted CI remain
pending.

Final Messages layout:

![Messages with All, Solo and Team filters and separate bottom
shortcuts](https://github.com/user-attachments/assets/562ddc3e-945b-4945-bd58-217a2c62b570)

Switcher layering during iteration (before → after):

| Before: filter edge showing through | After: Home hidden behind
switcher |
| --- | --- |
| ![Filter edge visible beside Switch
Community](https://github.com/user-attachments/assets/b32a0157-8b17-4f01-9a23-29b12ce3b1af)
| ![Clean Switch Community
screen](https://github.com/user-attachments/assets/222956e4-9989-4c8f-a162-65de45029845)
|

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-29 14:27:22 +00:00
klopez4212
7c165c3718 Smooth profile avatar editor transitions (#8640)
Smooths profile avatar editing with concurrent 200 ms entry/return
transitions, fixed-size circle movement between tabs, and a crossfade to
the dotted placeholder on cancel. New empty avatars open on Emoji, ready
to save.

Review fixes: keep the suggested emoji separate from the Image fallback,
and preserve native editor transparency across appearance changes.
Regression journeys cover empty Image previews, retained Emoji
selection, and light/dark updates.

Validation: focused Flutter journeys pass; restoring the old baseline
fails both fresh-editor regressions. At `bffb83f5e`: full Flutter suite
and push checks passed; all 107 native tests passed on the iOS
simulator. Prior iPhone visual approval covers the transition work;
these review fixes still need a device check.

Follow-up to #8628.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-10-29 08:16:17 +00:00