Restore recipient avatars beside the composer mention tool - #162
Conversation
Signed-off-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
wesbillman
left a comment
There was a problem hiding this comment.
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)})`} |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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"} |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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>
…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>
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. ItsMessageComposer.tsxdiff explicitly deletedRecipientAvatars, its host toolbar grouping, and the associated CSS. This was a UI replacement, not failed image loading.Scope
MessageComposer.tsx,ComposerTools.tsx, andMessages.module.css, with truthful removal labels and the existing library-aware agent-classification hook.Review follow-up (
b9ca5e469714eb480c5cfd861bf37a16e69de6e5)useKnownAgentPubkeys(session, profiles)for both artwork layers. Mounted coverage exercises late library-only hints, clearing those hints, retained profileisAgent, and no library fetch initiated by rendering.mentions.spec.mjs: 4 passed across Chromium/WebKit at4c4158b64339a573cac1444489b051538e46726a; only the two unit-test files changed afterward. Production, browser and fixture bytes are identical at the pushed head. Zero browser cases added/removed.Initial restoration validation
dc03a2b9f03cf81f2e152a4a691f563f3e9a71db, mandatory commit/push hooks passed: formatting/lint, TypeScript, 158 related tests in 14 complete files, design-system types and guards. No hooks bypassed.mentions,typeahead,completion-work, andmention-editfiles. Run atc0d4f52824a04659ccf643b13e0cdd4bde70567a; the only subsequent delta fixes the new unit-test fixture's types and DOM query. Browser/fixture/production bytes are unchanged.dc03a2bshows 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=2Initial 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