Skip to content

Restore recipient avatars beside the composer mention tool - #162

Merged
wesbillman merged 2 commits into
mainfrom
brain/fix-composer-mention-avatars
Sep 23, 2026
Merged

wesbillman merged 2 commits into
mainfrom
brain/fix-composer-mention-avatars

Conversation

@wesbillman

@wesbillman wesbillman commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Opened by Brain on Wes's behalf.

Summary

Restore selected-recipient avatars beside the @ composer tool, including remembered-agent drafts. Keep the inline identity chips and namesake public-key qualifiers introduced by #147.

Introducing PR: #147, “Show selected mentions as inline identity chips,” merged as 877ae2a6749221dd6850d5695b5c8de023a239e3. Its MessageComposer.tsx diff explicitly deleted RecipientAvatars, its host toolbar grouping, and the associated CSS. This was a UI replacement, not failed image loading.

Scope

  • Selectively restore the three avatar/layout sections removed by Show selected mentions as inline identity chips #147: MessageComposer.tsx, ComposerTools.tsx, and Messages.module.css, with truthful removal labels and the existing library-aware agent-classification hook.
  • Reuse shared Avatar/IconButton and session-owned profile/media data. One removal control per exact public key, live profile updates, and existing person/agent shapes.
  • Avatar removal clears that identity's explicit mention intent while preserving authored text. Sessions can still route to the selected or sole agent. Controls remain available without the optional Mentions plugin and disable with the composer.
  • No changes to identity resolution, remembered-agent preferences, editor serialization, signing, or plugin contracts. Docs now describe both inline chips and avatar controls.

Review follow-up (b9ca5e469714eb480c5cfd861bf37a16e69de6e5)

  • Addressed both review comments. Tooltip now says “Remove explicit mention”; the region is “Explicit mentions”. Documentation explicitly preserves selected/sole-agent Sessions routing. No routing changes.
  • Reuse useKnownAgentPubkeys(session, profiles) for both artwork layers. Mounted coverage exercises late library-only hints, clearing those hints, retained profile isAgent, and no library fetch initiated by rendering.
  • Extended mounted Sessions cases: remove an explicit mention → send/reply still reaches the sole agent; removal of a remembered mention returns to the picker-selected agent; new standalone/child Sessions return to the selected agent after removal. Tooltip assertions exercise the actual shared tooltip, not a nonexistent native title attribute.
  • At the follow-up head, required hooks passed: formatting/lint, TypeScript, 162 tests in 14 complete files, design types and guards. Initial push was blocked by new test assumptions about tooltips and remembered prefills; corrected those assumptions without altering production behavior or bypassing hooks.
  • Complete mentions.spec.mjs: 4 passed across Chromium/WebKit at 4c4158b64339a573cac1444489b051538e46726a; only the two unit-test files changed afterward. Production, browser and fixture bytes are identical at the pushed head. Zero browser cases added/removed.
  • Hosted CI and reviewer recheck remain pending; native desktop not exercised.

Initial restoration validation

  • At dc03a2b9f03cf81f2e152a4a691f563f3e9a71db, mandatory commit/push hooks passed: formatting/lint, TypeScript, 158 related tests in 14 complete files, design-system types and guards. No hooks bypassed.
  • 54 browser cases passed across Chromium and WebKit: complete mentions, typeahead, completion-work, and mention-edit files. Run at c0d4f52824a04659ccf643b13e0cdd4bde70567a; the only subsequent delta fixes the new unit-test fixture's types and DOM query. Browser/fixture/production bytes are unchanged.
  • Existing browser journey extended for loaded avatar pixels, person/agent shapes, visual placement at 360/768/1440px in both themes, keyboard order, plugin disable, disabled controls, and exact signed recipient tags after removal. Zero browser cases added or removed. Geometry, image loading, focus order and signed-publication wiring justify the browser assertions; duplicate, delayed-profile and remembered-draft behavior stays in mounted component tests.
  • A fresh Chromium screenshot at dc03a2b shows the actual composer with synthetic fixture identities; no live relay mutations.

Command: bin/pnpm test:browser tests/browser/mentions.spec.mjs tests/browser/typeahead.spec.mjs tests/browser/completion-work.spec.mjs tests/browser/mention-edit.spec.mjs --project chromium --project webkit --no-deps --workers=2

Initial validation caught two fixture issues (profile URLs must be HTTPS; publication trims trailing spaces) and unit-fixture type errors; corrected without weakening production validation.

Remaining gates: current-head hosted CI/DCO and reviewer recheck. Native desktop not exercised; no native code changed. Initial independent read-only review found no blockers; later Carl review identified the two issues addressed above.

Originating Buzz conversation: buzz://message?channel=cab6451c-1cb7-4951-8582-a90917313ad2&id=b9b703ac7e471e9cb5cd0950aadcc1750672759a40cad61d4caef134df58eb3c

Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman
wesbillman requested review from a team and comp615 as code owners September 23, 2026 14:39

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

Verdict: changes required (GitHub prevents requesting changes on a pull request authored by the authenticated account). One P2 user-facing contract defect, detailed inline. Preserve the documented Sessions routing; make the restored removal control truthful about clearing explicit mention intent and cover that interaction before merge. The library-only avatar shape inconsistency is P3/non-blocking.

Reviewed head dc03a2b9f03cf81f2e152a4a691f563f3e9a71db against base/merge-base fdc8a71ede5ead71125d656118ff44fbbee152f8, including shared channel/DM/thread/media composers, existing/new Sessions, draft restoration, plugin disable, and signed recipient construction. Exact-head helper reproduction confirmed empty explicit recipients still resolve to the sole session agent. Source/diff and existing test coverage reviewed; no broad suites or native UI rerun. The initial CI snapshot had JavaScript and browser measurements passing, with other lanes still running.

type="button"
size="toolbar"
data-mention-recipient=""
title={`Don't notify ${recipient.name} (${recipient.pubkey.slice(0, 8)})`}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not promise notification suppression when Sessions still addresses the agent

In a session containing one agent, select that agent as an explicit mention, activate this avatar, then send the unchanged draft. The handler removes all explicit spans for its pubkey (525–531), but send() subsequently falls back to selectedAgent or sessionRecipients() (436–444); the latter returns the sole session agent when the explicit list is empty (features/sessions/recipients.ts:24–41). New-session composition similarly falls back to its selected agent (NewSessionComposer.tsx:108–115). The tooltip says “Don't notify”, yet that exact agent still receives a signed p tag. I reproduced the empty-explicit-list → sole-agent result with the exact-head helpers.

The fallback is intentional per docs/sessions/README.md:25–29; do not change routing to fix this. Label the action as clearing the explicit mention rather than guaranteeing no notification, align the accompanying docs, and add a focused Sessions test for removal followed by the effective recipient. That is enough to resolve this blocker without new routing state.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brain, an automated agent, replying on Wes's behalf. Fixed in b9ca5e4: tooltip now says ‘Remove explicit mention’; the region is ‘Explicit mentions’. Docs explicitly retain Sessions routing. Mounted tests remove the mention and then send through existing Sessions (sole agent, selected agent, and thread reply) and new standalone/child Sessions. Tooltip tests open the actual shared tooltip. No routing state or behavior changed. Required hooks passed: 162 tests in 14 complete files, types and design guards. Leaving the thread open for your recheck.

fallback={recipient.name}
src={session.media(profile?.picture ?? "", "small")}
size="small"
shape={profile?.isAgent ? "squircle" : "circle"}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3, non-blocking] Reuse the existing library-aware agent classification

An agent known through the loaded agentLibrary but lacking profile isAgent renders as a circle here, while its adjacent inline chip is an agent (RichComposerInput.tsx:168–172). docs/profiles.md:48–56 explicitly supports both evidence sources. The new tests supply isAgent, so they do not catch this branch. Reusing useKnownAgentPubkeys(session) for both artwork shapes, with a library-only transition assertion, would keep these avatars consistent. Exact recipient identity and delivery are unaffected.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brain, an automated agent, replying on Wes's behalf. Fixed in b9ca5e4 using the existing useKnownAgentPubkeys(session, profiles) hook for both artwork shapes. The mounted avatar test now exercises library-only arrival without editing, clearing that hint back to a circle, preservation of profile-declared agents, and no library refresh triggered by rendering. Required hooks passed. The complete mentions browser file also passed in Chromium/WebKit (4 cases; production/browser bytes unchanged at the pushed head).

Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
@wesbillman
wesbillman merged commit d3a097a into main Sep 23, 2026
12 checks passed
@wesbillman
wesbillman deleted the brain/fix-composer-mention-avatars branch September 23, 2026 15:11
zrmarley added a commit that referenced this pull request Sep 23, 2026
…search-send

* origin/main:
  Connect attachments to existing message delivery (#176)
  perf: preserve unchanged thread row identities (#171)
  perf: cache markdown preparation by content (#172)
  Add safe attachment upload groundwork (#150)
  feat: add sampling profiler launch modes (#148)
  feat(channels): remove DMs from the sidebar (#157)
  Distinguish namesake agents and selected recipients (#142)
  feat(channels): move diagnostics into Channel Settings (#163)
  Replace warning banners with shared Base UI toasts (#164)
  feat(shortcuts): add keyboard shortcut settings (#155)
  fix(channels): give floating unread cue an opaque panel surface (#153)
  feat(communities): add BUZZ_DEV_OPEN_RELAY to open the default relay on fresh dev ports (#151)
  Restore recipient avatars beside the composer mention tool (#162)
  Fix startup inventory duplication and late panel scroll shifts (#160)
  feat(channels): add channel creation (#138)
  Standardize Button and IconButton with Buzz design tokens (#145)

Signed-off-by: Zach Marley <zmarley@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant