refactor(web): chat markdown tables and details live in their own components#22692

merged1
refactor/chat-markdown-mermaid
refactor/chat-markdown-tables
opened2d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2d ago

ChatMarkdown.tsx was a 3,560-line file that held every markdown renderer. This stack splits it into focused modules so each piece is readable on its own.

MarkdownTable moves to chat/MarkdownTable.tsx, with its clipped-cell measuring and copy menu. The collapsible details block moves to chat/MarkdownDetails.tsx.

This is a pure move. Each renderer was already its own component, so no render boundary changes. Behavior is unchanged.

BeforeAfter
ChatMarkdown.tsx lines29922776
New fileschat/MarkdownTable.tsx (167), chat/MarkdownDetails.tsx (65)
Rendersunchanged: no component, subscription or context boundary movedunchanged

Renders were not measured for this layer. It changes no render boundaries: the components, their props, and the two contexts stay exactly as they were.

Tests run:

  • vp test run --project browser src/components/ChatMarkdown.browser.test.tsx src/components/ChatMarkdown.permissions.browser.test.tsx (11 passed)
  • vp test run --project unit src/reactCompilerCoverage.test.ts for every touched file (0 bailouts)
  • tsc --noEmit for apps/web, and vp lint on changed files

🤖 Generated with Claude Code

Checks

All checks passed
Synced from GitHub

Approvability

Verdict: Approved at deaa444

Macroscope's review found this PR approvable — This PR extracts the existing markdown table and details implementations into dedicated component files without changing their behavior or renderer wiring. It does not alter product defaults or add static-analysis suppressions.

No code changes detected at a29a8ee. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b496256c-492c-4d41-8aea-3cd8fe480d9f
📥 Commits

Reviewing files that changed from the base of the PR and between deaa44462acc287c5960b75def7307bdc4ef3615 and a29a8ee9b496e3489fa3127b38f26a24acf88a64.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 5dcee507-b31a-4a19-a0d2-119f6c20b04e
📥 Commits

Reviewing files that changed from the base of the PR and between 839970877ff9a3c68e52165a4443c776ff5993b7 and deaa44462acc287c5960b75def7307bdc4ef3615.

📒 Files selected for processing: 3
  • apps/web/src/components/ChatMarkdown.tsx
  • apps/web/src/components/chat/MarkdownDetails.tsx
  • apps/web/src/components/chat/MarkdownTable.tsx

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

📝 Walkthrough

The Markdown table and details renderers moved from ChatMarkdown.tsx into dedicated modules. The table module contains clipping measurement, wrapping controls, resize handling, and Markdown/CSV copy actions. The details module contains collapsible rendering and find-result reveal behavior. ChatMarkdown imports both components.

Changes: Markdown Renderer Extraction

Layer / File(s)Summary
Extract Markdown renderers
apps/web/src/components/chat/MarkdownTable.tsx, apps/web/src/components/chat/MarkdownDetails.tsx
MarkdownTable contains table measurement, wrapping, resize handling, and clipboard actions. MarkdownDetails contains collapsible rendering and find-result reveal behavior.
Wire renderers into ChatMarkdown
apps/web/src/components/ChatMarkdown.tsx
ChatMarkdown imports both extracted components and removes their local implementations and imports used only by that code.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to deaa4

The table and details renderers remain wired into chat Markdown with their inspected behavior intact. No merge-blocking issue was identified.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description explains the refactor, expected behavior, implementation, and verification results. It does not provide the required Scope and approval information, and it does not use the template he…Add the required Problem, Change, Scope and approval, and Verification sections. In Scope and approval, link the triaged issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. State whether UI screens…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: moving chat Markdown tables and details into dedicated components.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the refactor, expected behavior, implementation, and verification results. It does not provide the required Scope and approval information, and it does not use the template headings or explain why approval evidence is unnecessary.

Resolution

Add the required Problem, Change, Scope and approval, and Verification sections. In Scope and approval, link the triaged issue or maintainer approval, or explain why this focused refactor qualifies for an exemption. State whether UI screenshots are not applicable because behavior and visuals are unchanged, if that is the repository-approved process. Keep the listed test commands and observed results in Verification.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Added 1 commit

  • refactor(web): chat markdown tables and details live in their own componentsa29a8ee
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for a29a8ee.

This comment will update automatically after the next completed run.