Skip to content

fix markdown render styles - #214

Merged
Avni2000 merged 4 commits into
mainfrom
style-errors
Apr 2, 2026
Merged

Avni2000 merged 4 commits into
mainfrom
style-errors

Conversation

@Avni2000

@Avni2000 Avni2000 commented Apr 2, 2026 •

Copy link
Copy Markdown
Owner
  • Bug where we treated all cells as code cells and added the <code> wrapper around them. This caused a few other stylistic errors.
  • Fixes regressions in left borders (based on markdown/code)

Summary by CodeRabbit

  • Bug Fixes

    • Fixed markdown cell conflict rendering to properly display content without unnecessary code wrapping.
    • Improved consistency of markdown content display across conflict resolution views.
  • Style

    • Added green left border accent to markdown cells with conflicts for improved visual distinction.
    • Enhanced font consistency for all markdown conflict displays.

Avni2000 added 3 commits April 1, 2026 20:14
…wn or code.

markdown cells no longer have the `<code>` wrapper and fixes font issues from that
Passes `side-` attribute to all cells to apply text-primary styling
@coderabbitai

coderabbitai Bot commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d27710de-946c-47b0-bb83-d945ca615b20

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8136d and 5a4d70d.

📒 Files selected for processing (1)
  • src/web/client/styles.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/web/client/styles.ts

📝 Walkthrough

Walkthrough

Added side-specific cell class, enabled markdown-aware static diff rendering by passing an isMarkdown flag to StaticDiffContent so markdown diffs render without a <code> wrapper, and extended CSS to style markdown conflict-mode and static markdown source.

Changes

Cohort / File(s) Summary
Cell Content Rendering
src/web/client/CellContent.tsx
Added side-${side} to outer cell class list; pass isMarkdown (derived from cellType === 'markdown') into StaticDiffContent to conditionally omit <code> wrapper for markdown diffs.
Static Diff Rendering
(same file) src/web/client/CellContent.tsx
Updated StaticDiffContent signature to accept optional isMarkdown: boolean (default false) and render nodes directly when true, otherwise wrap nodes in <code>.
Styling & Theming
src/web/client/styles.ts
Added rules for markdown conflict-mode (.markdown-cell.has-conflict .cell-content pre) to use cell surface bg and green left border; added .markdown-cell .cell-source-static to force UI font for static markdown content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through code to tweak a class and style,
Markdown diffs now skip the code-wrap mile.
Conflict borders gleam a friendly green,
Cells show sides and render clean.
A little rabbit clap—nice and mild!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix markdown render styles' directly relates to the main change: fixing markdown cell rendering and styling issues by conditionally wrapping markdown cells without the element and applying appropriate CSS rules.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch style-errors

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 and usage tips.

@Avni2000 Avni2000 changed the title Style errors fix markdown render styles Apr 2, 2026

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

🧹 Nitpick comments (1)
src/web/client/styles.ts (1)

519-525: Avoid duplicating output color selectors across two blocks.

These selectors are already defined later in the file for .cell-output-host descendants, so this introduces duplicate maintenance points for the same rule.

♻️ Suggested cleanup
-.cell-output-host .jp-RenderedText,
-.cell-output-host .jp-RenderedHTMLCommon,
-.cell-output-host .jp-RenderedImage,
-.cell-output-host .jp-RenderedSVG,
-.cell-output-host .jp-RenderedLatex {
-    color: var(--text-primary);
-}
+/* Keep a single canonical `.cell-output-host` color block in one place */
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/web/client/styles.ts` around lines 519 - 525, The CSS block starting with
selectors ".markdown-content code, .cell-output-host, .cell-output-host
.jp-RenderedText, .cell-output-host .jp-RenderedHTMLCommon, .cell-output-host
.jp-RenderedImage, .cell-output-host .jp-RenderedSVG, .cell-output-host
.jp-RenderedLatex" duplicates selectors later in the file and should be
consolidated; remove the duplicated .cell-output-host descendant selectors from
this earlier block and keep the canonical rule set that appears later (or merge
any unique declarations into the later .cell-output-host rules), ensuring
".markdown-content code" stays if it is unique and referencing the existing
.cell-output-host rule names to locate where to merge.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/web/client/styles.ts`:
- Around line 519-525: The CSS block starting with selectors ".markdown-content
code, .cell-output-host, .cell-output-host .jp-RenderedText, .cell-output-host
.jp-RenderedHTMLCommon, .cell-output-host .jp-RenderedImage, .cell-output-host
.jp-RenderedSVG, .cell-output-host .jp-RenderedLatex" duplicates selectors later
in the file and should be consolidated; remove the duplicated .cell-output-host
descendant selectors from this earlier block and keep the canonical rule set
that appears later (or merge any unique declarations into the later
.cell-output-host rules), ensuring ".markdown-content code" stays if it is
unique and referencing the existing .cell-output-host rule names to locate where
to merge.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e66ae9e-7475-4a32-81b6-0285c49fb370

📥 Commits

Reviewing files that changed from the base of the PR and between f1ac66e and 9a8136d.

📒 Files selected for processing (2)
  • src/web/client/CellContent.tsx
  • src/web/client/styles.ts

@Avni2000
Avni2000 enabled auto-merge April 2, 2026 19:51
@Avni2000
Avni2000 disabled auto-merge April 2, 2026 19:51
@Avni2000
Avni2000 enabled auto-merge April 2, 2026 19:55
@Avni2000
Avni2000 merged commit ee87feb into main Apr 2, 2026
5 checks passed
@Avni2000
Avni2000 deleted the style-errors branch April 2, 2026 20:02
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