Skip to content

Stop the brief panel running off the right edge - #6

Merged
trotterdylan merged 1 commit into
mainfrom
brief-panel-width
Sep 26, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
brief-panel-width

Conversation

@trotterdylan

Copy link
Copy Markdown
Contributor

Follow-up to #5, which made the panel scrollable but introduced a worse problem: the text stopped wrapping.

Sizing at 100vw assumed the panel starts at the left edge. It is anchored to a trigger near the right edge, so a viewport-wide panel hangs off the screen — its text wraps at a width that is mostly off-screen, which reads as no wrapping at all.

  • Cap the width by --radix-popover-content-available-width: the room Radix measured from where it actually placed the panel, rather than a number I assumed.
  • overflowWrap: anywhere so a long URL or branch name breaks instead of widening the panel past its cap.
  • Every layout-critical property is now an inline style. The plugin's Tailwind output is scoped to its own subtree (:where([data-bb-plugin=thread-briefs], …)) and this content is portalled, so sizing should not depend on those rules reaching it. Cosmetics stay in className, where a miss is only cosmetic.

The tests were the real failure

The previous ones asserted className contained w-[calc(100vw-1rem)] — and passed cheerfully while the panel rendered wrong. A class name being present says nothing about whether a rule reached the element. They now assert the applied inline style, which is the thing that actually determines layout.

I checked the emitted CSS before changing anything, and the arbitrary-value rule was generated — so the class was never the problem, the assumed width was. Worth recording, because it would have been an easy wrong fix.

81 tests passing. Still verified in jsdom rather than on a phone, so this wants a real look on your device — it is the second time this panel has been wrong in a way jsdom happily reported as fine.

🤖 Generated with Claude Code

Sizing the panel at 100vw assumed it started at the left edge. It is anchored
to a trigger near the right, so a viewport-wide panel hung off the screen: text
wrapped at a width that was mostly off-screen, which read as no wrapping at all.

Cap the width by --radix-popover-content-available-width, the room Radix
measured from where it actually placed the panel, and let long unbroken strings
break rather than widen it.

Move every layout-critical property to inline styles. The plugin's Tailwind
output is scoped to its own subtree and this content is portalled, so sizing
should not depend on those classes reaching it. Cosmetics stay in className,
where a miss is only cosmetic.

The tests now assert the applied inline style. The previous ones checked that
className contained w-[calc(100vw-1rem)] and passed while the panel rendered
wrong — a class name being present says nothing about a rule reaching the
element.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@trotterdylan
trotterdylan merged commit c629b00 into main Sep 26, 2026
5 of 6 checks passed
@trotterdylan
trotterdylan deleted the brief-panel-width branch September 26, 2026 23:47
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