Skip to content

fix(markdown): align mention chip wrapping - #7501

Draft
tellaho wants to merge 3 commits into
mainfrom
tho/fix-mention-line-height
Draft

fix(markdown): align mention chip wrapping#7501
tellaho wants to merge 3 commits into
mainfrom
tho/fix-mention-line-height

Conversation

@tellaho

@tellaho tellaho commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Category: fix
User Impact: Human and agent mentions now break across lines with the same cloned chip treatment as repository and permalink chips while preserving the conversation text rhythm.

Problem: Profile-backed rendered mentions sat inside an inline-flex popover trigger, unlike entity chips, so the wrapper interfered with true inline fragmentation. The browser-layout test measured text-range rows rather than the painted chip rectangles, allowing touching decorations to pass as “separate” fragments.

Solution: Keep the profile trigger interactive but override its layout to true inline, then give mention fragments 18px computed leading inside the message’s 20px prose rhythm. Chromium paints each fragment at 17px and advances it by 20px, leaving a visible gap between cloned rounded rectangles. The browser test now measures the chip’s own getClientRects() and asserts fragment count, height, gap, and step; entity links retain their existing 22px leading.

File changes

desktop/src/features/profile/ui/UserProfilePopover.tsx
Allows inline consumers to override the trigger wrapper’s layout without changing other profile-popover call sites.

desktop/src/shared/styles/globals/markdown.css
Keeps one shared wrapping-chip mechanic and gives mention decorations enough room to separate visibly within 20px prose.

desktop/src/shared/ui/markdown.test.mjs
Pins both rendered mentions and entity links to the shared wrapping-chip contract.

desktop/src/shared/ui/markdown/MarkdownMention.tsx
Makes the profile-popover trigger truly inline so the nested mention chip can fragment with surrounding prose.

desktop/src/shared/ui/mentionChip.ts
Keeps wrapping-inline-chip as the single contract for fragmenting decorated chips.

desktop/tests/e2e/mentions.spec.ts
Measures the painted chip rectangles, requires a positive fragment gap, and verifies the inline trigger remains mouse- and keyboard-operable.

desktop/tests/e2e/navigation.spec.ts
Keeps a wrapped repository chip as the control, asserting its existing 22px line height and fragment advance.

Reproduction steps

  1. Open a channel in Buzz Desktop using dark theme.
  2. Send a message containing a human mention and another containing an agent mention; both chips should remain aligned with adjacent text on a 20px line.
  3. Render a collision-qualified mention in a narrow message width; it should break into separately decorated fragments exactly like another wrapping chip, while each fragment follows the 20px prose rhythm.
  4. Render a long repository or permalink chip in the same constrained width; it should retain its roomier 22px fragment spacing.

Screenshot

The dark-theme production renderer shows the real qualified label (bob (npub1hv3…tpuc)) at an 8rem width. The two lines now paint as visibly separate rounded fragments rather than one continuous rectangle.

Qualified human mention wrapping into two visibly separate rounded fragments in the dark-theme Buzz timeline

Validation

At commit 2b063e1b4ade30e11f1616269ad4ba4190366885:

  • Pre-push desktop gates — file-size check, Biome/checks, typecheck, and 6,483 unit tests passed
  • pnpm --dir desktop build — passed
  • Focused Playwright coverage for single-line agent mention, single-line human mention, wrapped qualified mention including keyboard profile activation, and timeline mention click — 4 passed
  • git diff --check — passed

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 82656ffea080cc28cec9163ebbf7d1c6be327e43...2b063e1b4ade30e11f1616269ad4ba4190366885.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 2b063e1b4ade30e11f1616269ad4ba4190366885 to authorize a new review.
Any previous review applies only to its recorded range.

Separate fragmentable chip decoration from entity-link spacing so rendered
human and agent mentions keep the conversation's 20px rhythm while long
entity links retain their roomier wrapped-line treatment.

Co-authored-by: Rizz <rizz@agents.buzz>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/fix-mention-line-height branch from fad8050 to f6ad3d4 Compare September 9, 2026 18:30
@tellaho tellaho changed the title fix(mentions): preserve timeline line height fix(mentions): preserve timeline line rhythm Sep 9, 2026
@tellaho tellaho changed the title fix(mentions): preserve timeline line rhythm fix(markdown): separate mention and entity chip rhythm Sep 9, 2026
@tellaho tellaho changed the title fix(markdown): separate mention and entity chip rhythm fix(markdown): separate mention and entity chip line rhythm Sep 9, 2026
Use the shared wrapping chip contract for rendered mentions while keeping their fragments on the conversation text rhythm.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho tellaho changed the title fix(markdown): separate mention and entity chip line rhythm fix(markdown): align mention chip wrapping Sep 9, 2026
Let profile-backed mention chips retain true inline fragmentation and assert the painted gap between wrapped decorations.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.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