Commit Graph

2 Commits

Author SHA1 Message Date
morgmart
70bb7b7bec feat(mobile): name blocking agents, leave agents out of DM names (#9875)
## Problem

Two follow-ups to growable DMs (#9153), matching desktop
block/buzz-app#3744:

1. When an agent's add policy blocks a DM, mobile shows a generic error.
The person can't tell which agent blocked it or whose owner to ask.
2. DM names list every member, agents included, so a DM with one person
and their agent reads like a group, and "+N more" mixes agents with
people.

## Change

**Name the blocking agent.** The relay names the agent in that refusal
(#9601). Mobile shows the agent's name: "Only Scout's owner can add it
to a DM." or "Scout can't be added to a DM.", starting with "Couldn't
add them." when adding to an existing DM, and "this agent" when the name
can't be read. Against a relay without #9601, the error is the same as
before.

**Leave agents out of DM names.** A DM's name lists its people and never
its agents, unless no other person is in it (just you and agents), when
it names the agents. "+N more" counts people only. Member counts and
member lists still include agents. The shared DM label feeds the list,
headers, details and Activity. Agent means the profile's existing agent
flag; a profile that hasn't loaded yet counts as a person until it says
otherwise.

## Screenshots

Temporary headless renders with test data, not committed.

### Name the blocking agent

Add people, refused by an agent's owner-only setting:

| | Light | Dark |
|---|---|---|
| Narrow | ![light
narrow](https://github.com/user-attachments/assets/61bfbfe2-5882-456e-8bff-b42f7389aa06)
| ![dark
narrow](https://github.com/user-attachments/assets/d7ac0dca-9081-4cde-a403-cde492d2cf4f)
|
| Wide | ![light
wide](https://github.com/user-attachments/assets/cc9f5a0f-0f3a-4d80-8fc6-0937a2246462)
| ![dark
wide](https://github.com/user-attachments/assets/87b48014-9740-4e17-ad83-f5bac272dda8)
|

### DM names without agents

Ana alone, Ana with two agents (named "Ana", count still 3), and only
the two agents (named by them):

| | Light | Dark |
|---|---|---|
| Narrow | ![light
narrow](https://github.com/user-attachments/assets/b413dbc1-a2bc-4410-8be9-b1a219374349)
| ![dark
narrow](https://github.com/user-attachments/assets/75c9cbc3-432f-45c7-83a4-624f80752b97)
|
| Wide | ![light
wide](https://github.com/user-attachments/assets/ae57c305-f4e4-4e26-8ba0-ecbcd128137e)
| ![dark
wide](https://github.com/user-attachments/assets/a75efc90-6b20-4409-bdd5-682de1f0301f)
|

## Tests

- Blocking agent: an open and an add name the agent, fall back to "this
agent", and leave other refusals as they were.
- DM names: people and agents, only agents, more than three people and
agents, and a profile that hasn't loaded yet.

The lost-reply recovery was taken out after review. It comes back as a
relay change that answers a replayed signed command with its saved
result, so the app can resend the same event instead of guessing from
rosters.

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

---------

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:10:23 -08:00
Tom Brow
cdc2b129c0 fix(mobile): resolve DM display labels once per sort (#8488)
Home's DM sort resolves participant identity names again for every
comparator call. This work appeared in a captured 82.163 ms UI frame
after foregrounding the full app (Debug/JIT iOS simulator, shared host).
Resolve each lowercase display label once per sort, retaining the same
label ordering and channel-ID tie-breaker. Sort keys are
invocation-local, so later viewer, profile, owner, participant, and
community changes cannot reuse stale labels.

No matching open mobile sorting PR or issue found.

### Validation

- Added synthetic regression coverage for bounded contextual resolution
and ordering parity across identity/name/channel changes, ties, unnamed
DMs, and empty/singleton lists. The 80-DM fixture performs 80 contextual
resolutions instead of the original comparator’s 982; restoring that
comparator makes the regression fail.
- 133 focused tests passed, including existing Home scrolling/reconnect
widget tests and identity-name tests.
- Mobile static analysis passed; 3,697 tests passed with 16 existing
skips, plus four no-gateway configuration tests.
- No new full-app or hardware capture. The existing trace establishes
repeated synchronous work, not its release-build magnitude or the cause
of every scrolling stall.

Signed-off-by: Tom Brow <tomb@block.xyz>
2026-10-20 13:13:15 -07:00