Skip to content

fix(activity): keep code blocks in row previews from rendering as scroll boxes - #25410

Merged
Jinwoo-H merged 1 commit into
mainfrom
activity-row-code-block-preview
Oct 5, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
activity-row-code-block-preview

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​31
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

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.

Before After

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • New test in activity-thread-hover-card.test.tsx renders 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

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…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.
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a6d3d1f-c35f-4b55-b3dd-55ee44f1058d
📥 Commits

Reviewing files that changed from the base of the PR and between 16d937d and ec492ce.

📒 Files selected for processing (2)
  • src/renderer/src/components/activity/activity-thread-hover-card.test.tsx
  • src/renderer/src/components/activity/activity-thread-row.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Markdown 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 ec492

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)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: preventing code blocks in activity-row previews from appearing as scroll boxes.
Description check ✅ Passed The description covers the required sections with clear user impact, implementation details, rationale, linked-issue status, visual proof, testing, and checklist responses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Flatten code blocks/tables in the row preview — activity-thread-row.tsx adds descendant overrides on the row's CommentMarkdown wrapper ([&_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 the line-clamp-2/3 on the row.
  • Regression test — appends a case to activity-thread-hover-card.test.tsx that 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.json on the row file: 0 errors, so Tailwind v4's @shadcn/lint accepts the :is() variants and the ![font:inherit] important-arbitrary-property classes.
  • The PR's test file passes (7/7); check-changed-code-quality.mjs reports 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's max-h-32/overflow-x-auto and the table wrapper's overflow-x-auto are the only behaviors undone.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit d279adc into main Oct 5, 2026
31 checks passed
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