Repository navigation
fix(activity): keep code blocks in row previews from rendering as scroll boxes - #25410
Conversation
…oll boxes The activity row previews the agent's last reply with the compact markdown renderer, which draws fenced code blocks and tables as their own scrollable boxes. Those boxes escaped the row's line clamp, so a reply with a code block put a tall grey box with scrollbars in the middle of the list. Row-scoped overrides now flatten code blocks and tables into plain wrapping text, so the existing clamp cuts them like any other line. Other markdown surfaces are unchanged.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughMarkdown status styling now removes code-block scroll limits and adjusts table layout in reply previews. A test verifies that code blocks and tables render within the three-line-clamped preview and checks the relevant styling classes. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Reply previews now adapt code blocks and tables to the existing clamp rather than showing scroll boxes. No actionable merge risk is established; the change appears ready for normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Flatten code blocks/tables in the row preview —
activity-thread-row.tsxadds descendant overrides on the row'sCommentMarkdownwrapper ([&_pre]:!max-h-none … ![font:inherit],[&_div]:!overflow-visible,[&_:is(table,…)]:!inline,[&_:is(th,td)]:!border-0/!pr-2,[&_table]:![font:inherit]) so the compact renderer's scroll containers no longer escape theline-clamp-2/3on the row. - Regression test — appends a case to
activity-thread-hover-card.test.tsxthat renders a reply with a fenced block plus a GFM table and asserts the preview carries the flattening classes; fails without the fix.
Verification
oxlint --config config/oxlint-dead-classes.jsonon the row file: 0 errors, so Tailwind v4's@shadcn/lintaccepts the:is()variants and the![font:inherit]important-arbitrary-property classes.- The PR's test file passes (7/7);
check-changed-code-quality.mjsreports 0 new findings across both files. - The overrides are scoped to the row's markdown wrapper only — the hover-card summary and document surfaces keep their scrollable code/table rendering, and the compact
pre'smax-h-32/overflow-x-autoand the table wrapper'soverflow-x-autoare the only behaviors undone.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
The activity list shows the first few lines of each agent's last reply. If that reply had a code block or a table, the list showed a big grey box with its own scrollbars instead of a short preview. Now code blocks and tables read as ordinary text and get cut off after the usual two or three lines.
What Changed
Before: a reply with a fenced code block showed a tall grey box (up to 8 lines) with horizontal and vertical scrollbars in the middle of the list. On Windows, where scrollbars are always visible, both scrollbars were drawn; on macOS it was a grey block. A markdown table showed as a full bordered grid, every row, regardless of the preview's line limit.
After: both read as plain wrapping text (
### p2-first (7 pairs) | metric | base…,metric base head first paint…) and stop at the row's existing two- or three-line limit like any other reply. Row heights stay consistent.Mechanism: the row renders the reply with the shared compact markdown renderer, which styles code blocks as a scrollable box with a max height and wraps tables in a horizontally scrolling container. Scrolling containers start their own layout context, so the row's line clamp could not count or cut their lines. The row's preview now adds a few descendant overrides on its own wrapper: code blocks lose their max height, scrolling, background, and monospace font and wrap as normal text; tables and their rows/cells become inline text with small gaps between cells. The Activity page list reuses the same row, so it gets the fix too.
Why
The fix is scoped to the row preview: workspace cards, comments, and document views keep their scrollable code blocks and tables, which are useful there. Adding a new markdown variant or stripping markdown before rendering would have meant a second rendering path to keep in sync for a preview that only needs a glance; class overrides on the one wrapper that already strips margins and list markers keep the change to one place.
Linked Issue
N/A (internal)
Visual Proof
Sidebar activity list at sidebar width, always-visible scrollbars forced on so the before shot matches what Windows users see. Top row: a reply with a markdown table. Bottom row: a reply with a fenced code block holding a wide table.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New test in
activity-thread-hover-card.test.tsxrenders a row whose reply has a fenced code block and a table, and checks the preview carries the flattening overrides. It fails without the fix.Activity and markdown suites pass (43 files, 294 tests);
pnpm tc,pnpm lint, oxlint, and the changed-code quality gate pass.Rendered on macOS in a background dev build: the code block measured 128px with scrolling before and is now clipped to the 40px two-line preview; tables measured the same 40px.
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Renderer-only styling change; no platform, SSH, mobile, or wire impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)