Skip to content

feat(ipynb): render notebooks like a notebook, with seamless click-to-edit cells - #22519

Merged
Jinwoo-H merged 16 commits into
mainfrom
improve-ipynb
Sep 23, 2026
Merged

Jinwoo-H merged 16 commits into
mainfrom
improve-ipynb

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​94 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​193
Prod 26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​717 $\color{#cf222e}{\Huge{\mathbf{−}}}$​497 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​220

ELI5

Opening a Jupyter notebook in Orca used to look like a form: serif text, raw markdown next to its preview, code cells that blended into the background, and eight buttons on every cell. Now it reads like a notebook in Jupyter or VS Code. Markdown is rendered, code sits in its own box, and you click a cell to edit it.

What Changed

Before → after, as the user sees it:

  • Fonts: prose was Times because the notebook set the terminal font name with no fallback. Prose now uses the app font (Geist), and code uses the editor/terminal font followed by a monospace fallback stack.
  • Markdown cells: used to show a raw textarea beside the preview. Now they render by default; double-click or press Enter to edit.
  • Code cells:
    • Code sits on its own tinted surface.
    • Clicking a cell opens the editor in the same frame, fully coloured, with the caret where you clicked. There's no "Loading..." flash, no colour flicker, no layout jump, and no highlighting of every occurrence of the clicked word.
    • The execution count [n] is always shown. A run button appears under it on hover (VS Code layout), and [*] shows while a cell runs.
  • Toolbar: the always-visible 8 buttons and native dropdown are replaced by a hover toolbar (move up/down, delete, and a menu to insert cells or change cell type).
  • Outputs:
    • Each output shows its richest format.
    • HTML output (e.g. pandas tables) renders in a sandboxed, script-free frame sized to its content.
    • ANSI colours in tracebacks and streams render instead of showing raw escape codes.
  • Header: the "BETA" and "nbformat 4.5" labels are gone.
  • Theme: code previews re-colour on theme switches, including OS light/dark flips when following the system theme.

How it works:

  • Cell editors: each is created directly with monaco.editor.create in a layout effect, so it's sized, tokenized and has its caret placed before first paint. Monaco places the caret by hit-testing the real click (getTargetAtClientPoint). Previously, @monaco-editor/react mounted asynchronously behind a placeholder, and the caret position was guessed from the preview.
  • Code previews: notebook code cells draw their own preview from the same layout constants the editor uses, so switching into edit mode moves nothing.
  • Shared excerpt component: MonacoCodeExcerpt, used by PR review comment code context, renders as before. Its colouring moved into a useMonacoColorizedLines hook, which now also re-colours on theme change.

Unchanged: cell execution (src/main/ipc/notebook.ts) and its model of re-running earlier cells. A real kernel is a separate follow-up.

Why

This builds on community PR #18542 by @maxidiazbattan. It keeps that PR's shared markdown renderer, richest-MIME selection, extra image formats and sandboxed HTML output, and simplifies the rest.

It drops the global Preview/Edit mode toggle. That flag was threaded through several components and silently disabled Cmd+S. Rendered-by-default with click-to-edit is what Jupyter and VS Code do, and it needs no mode state.

Creating Monaco synchronously was chosen over keeping the preview painted until an async editor was ready. The alternative needs a "painted" state and still gets the caret position by guessing.

Linked Issue

Fixes #17075
Supersedes #18542

Visual Proof

Not attached. The change was reviewed interactively in a dev build against a real 35-cell notebook, in dark and light themes, and compared side by side with Jupyter Notebook and VS Code's notebook editor.

Testing

  • Rendered checks over CDP in dark and light themes, including frame captures across a real click and box measurements. Code box, first glyph, [n] and run button move 0px across idle, hover and editing.

  • The caret lands correctly with real mouse input: on a character, right of a line, on a blank line, and in the padding.

  • Preview and editor token colours match across repeated theme switches and reloads.

  • Edits save as valid notebook JSON; Cmd+S inside a cell works.

  • MonacoCodeExcerpt output was compared against main with the same props and is identical.

  • pnpm tc, pnpm test (editor, github, lib: 7,797 tests), check:code-quality:changed, oxlint, oxfmt, verify:localization-*.

  • Tested on macOS only.

  • I manually tested these changes locally

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

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

  • Scope: renderer-only. Outside the notebook, the changes are the shared MonacoCodeExcerpt refactor (rendering unchanged, plus the theme re-colour fix), a new font-stack helper used only by notebooks, two CSS rules scoped to .ipynb-code-surface, and removal of now-unused notebook i18n strings.
  • Platforms and SSH: no platform-specific code or shortcuts were added, and there are no main-process, IPC or SSH changes.

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)

Jinwoo-H and others added 11 commits September 23, 2026 02:31
Tracebacks and stream output carry terminal colour codes that the notebook
printed raw. Splits text into styled runs (16/256/truecolor, bold, italic,
underline) and drops non-SGR escapes via the shared stripper.
- Prose inherits the app UI font instead of a bare terminal font name, which
  Chromium could not resolve and fell back to Times (removes the now-dead
  resolveEditorFontFamilyOrInherit).
- Markdown cells render by default; double-click or Enter edits them in the
  same Monaco surface code cells use. Code cells activate on press so a
  collapsing neighbour cannot swallow the click, which also retires the
  root pointer-capture deactivation (Monaco blur already covers it).
- Code sits on its own tinted surface, the active cell gets a ring, and the
  editor sizes to its content so activating a cell no longer jumps.
- The always-on 8-button toolbar and native select become a hover/focus
  toolbar (move, delete, and a menu for insert and cell type); the Jupyter
  [n] prompt turns into the run button.
- Outputs show only the richest MIME representation, HTML renders in a
  script-less, no-network sandboxed frame sized to its content, and ANSI
  colours use the default terminal palettes.

Adopts the MarkdownPreviewBody reuse, richest-MIME selection, extra raster
MIME ranks, and CSP-sandboxed auto-height HTML frame from #18542.

Co-authored-by: maxidiazbattan <[email protected]>
…k header

parseIpynb already rejects notebooks without a v4 cells array, so the label
carried no actionable information; the parsed nbformat field goes with it.
Removes those catalog keys and the stale lowercase code/markdown ones.
The preview and the live editor disagreed on four things, measured over CDP:
- Font: the excerpt painted the bare "SF Mono" name (or --font-mono via its
  row class), while Monaco appended its own fallbacks and landed on Menlo.
  Both now use resolveEditorFontStack, the editor font plus the terminal
  fallback chain.
- Line height: 20px rows vs Monaco's 21px. Both read CODE_EXCERPT_LAYOUT.
- Gutter: a 48px line-number column plus 12px inset vs Monaco's 25px gutter.
  Notebook cells drop line numbers (the Jupyter and VS Code notebook
  default) and Monaco's decorations lane is the same 12px inset.
- Rows: colorized blank lines collapsed to 0px, and a trailing newline had
  no preview row. Rows are fixed-height and a trailing newline opens an
  empty last line, matching the Monaco model.

The [n] prompt and run icon now share one grid cell, so the hover swap keeps
the label's box and centre. The commented-line tint moves to a theme token.
Replaces the in-place [n]/play swap from 172b4f7. The [n] count is always
shown and never moves; the run button sits above it in the same gutter
column, revealed on hover or focus from an invisible slot that keeps its
box. While a cell runs, the slot shows a spinner and the count reads [*].
…xcerpt unchanged

172b4f7 bent the shared MonacoCodeExcerpt (used by PR comment code
context) to the notebook's layout, changing that surface's font, tracking
and highlight tint. The excerpt's rendering is now byte-identical to main;
only its colorizer is extracted as useMonacoColorizedLines. The notebook
renders its own rows from CODE_LAYOUT, the same metrics its Monaco editor
uses, so activation stays pixel-stable.
Monaco mounted with its caret at 1:1 and focus ran occurrence highlighting
on that first token, so clicking any line lit up every 'import'. The press
on the preview now maps to a model position (its rows mirror model lines)
and Monaco opens there before focusing; keyboard and markdown activation
open at the end. Occurrence highlighting stays on, as in VS Code notebooks.
The [n] count now shares the first code line's box (the gutter mirrors the
code surface's border and padding, and the count is one line tall); the
run button slot sits beneath it and stays reserved while hidden.
Monaco's colorizer emits theme-specific token classes, so excerpts colorized
under one theme kept that theme's token colours after a switch (dark-theme
keywords rendered green on the light theme). Affects notebook previews and
PR comment code context.
…essly

@monaco-editor/react waits on an async loader, shows "Loading..." and builds
the editor inside a display:none container. Every click on a cell therefore
painted a placeholder, then an editor laid out at 0x0 (one uncoloured line),
and the caret guess ran against the static preview, falling back to the end
of the cell whenever the press missed a text row (padding, gaps).

The cell editor is now created with monaco.editor.create in a layout effect:
sized, tokenized (restoring its view state marks the visible lines stable)
and placed before the first paint. Monaco hit-tests the press itself with
getTargetAtClientPoint, so the caret lands on the nearest position for text,
trailing whitespace, blank lines and padding; keyboard and markdown
activation open at the start. Indent guides stay off to match the preview.

Word and selection occurrence highlighting are off in cell editors, since
clicking a word lit up every other occurrence like a search.

Also drops wiring the rewrite made dead: the per-editor save shortcut (the
notebook's capture handler already owns Cmd+S), the callback refs, the
onSaveRequest prop, and the toolbar's positioning wrapper.
useMonacoColorizedLines read the theme once from settings, so a 'system'
theme flipping with the OS never re-colorized. It now uses
useDocumentDarkTheme, like the rest of the notebook; rendering is unchanged.
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

Notebook cells now use a unified source component for preview and editing. Output rendering supports ANSI styling, selects one renderable representation, and displays sanitized HTML in a sandboxed iframe. The viewer layout and toolbar controls have changed. Parser metadata, image MIME ordering, theme handling, font-stack resolution, and related tests and translations were also updated.

Merge Risk: 🟡 Moderate · up to b1175

A notebook reload can cause an edit to be saved to the wrong cell. Fix that data-integrity risk before merging; the rendering and font regressions also need correction.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main template sections and provides detailed changes, rationale, issue links, and testing results. It does not provide the required before-and-after visual proof for this UI… Attach before-and-after screenshots or a video that shows the notebook UI and interaction changes. Confirm that pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass, or state that CI will cover the unchecked commands.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.59% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 23 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: rendered notebook cells with seamless click-to-edit behavior.
Linked Issues check ✅ Passed The PR addresses the coding objectives in [#17075]. Markdown cells render in preview mode and activate for editing. Code cells use a distinct preview and Monaco editor surface. Outputs select the rich…
Out of Scope Changes check ✅ Passed The changes stay within the renderer-focused notebook support scope. The font helper relocation supports notebook font-stack behavior and preserves shared terminal behavior with dedicated tests. Local…
Full details: Description check

Explanation

The description covers the main template sections and provides detailed changes, rationale, issue links, and testing results. It does not provide the required before-and-after visual proof for this UI and interaction change, and the lint, typecheck, and build checklist items remain unchecked.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1a2ac6a1-bc9b-48e3-8fa4-349c462e2d5b

📥 Commits

Reviewing files that changed from the base of the PR and between 641a7f3 and 35a4534.

📒 Files selected for processing (25)
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/editor/IpynbCellEditor.tsx
  • src/renderer/src/components/editor/IpynbCellOutputs.tsx
  • src/renderer/src/components/editor/IpynbCellToolbar.tsx
  • src/renderer/src/components/editor/IpynbHtmlOutput.tsx
  • src/renderer/src/components/editor/IpynbRendering.test.tsx
  • src/renderer/src/components/editor/IpynbViewer.tsx
  • src/renderer/src/components/editor/MonacoCodeExcerpt.tsx
  • src/renderer/src/components/editor/ipynb-ansi.test.ts
  • src/renderer/src/components/editor/ipynb-ansi.ts
  • src/renderer/src/components/editor/ipynb-code-cell-lines.test.ts
  • src/renderer/src/components/editor/ipynb-code-cell-lines.ts
  • src/renderer/src/components/editor/ipynb-parse.test.ts
  • src/renderer/src/components/editor/ipynb-parse.ts
  • src/renderer/src/components/editor/use-document-dark-theme.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/technical-literal-catalog-values.test.ts
  • src/renderer/src/lib/editor-font-zoom.test.ts
  • src/renderer/src/lib/editor-font-zoom.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/components/editor/ipynb-parse.test.ts
  • src/renderer/src/i18n/en-runtime-required.json

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

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

Important

IpynbHtmlOutput renders untrusted notebook output in a frame that now carries allow-same-origin — the only untrusted-markup frame in the renderer that does, and the opposite of the invariant PluginPanel.tsx documents and tests. Scripts are stripped (DOMPurify) and blocked (no allow-scripts), so it is not a live exploit, but it is a security-boundary change that deserves a deliberate decision before merge. Exact reasoning and alternatives are inline.

Reviewed changes

  • Rendered-by-default cells — markdown renders as a document (double-click or Enter to edit); code shows a colorized preview that swaps to a synchronously-created Monaco editor, with the caret hit-tested from the activating press.
  • Output rendering — one richest MIME per display bundle, ANSI SGR colors pulled from the terminal theme, and HTML output in a script-free, CSP-fenced frame auto-sized to its content.
  • Hover toolbar and run gutter — the eight always-visible buttons become a hover/dropdown toolbar; [n] sits above a hover run button, [*] while running.
  • Shared refactor — useMonacoColorizedLines extracted from MonacoCodeExcerpt and now re-colors on theme change; resolveEditorFontStack gives notebook code a fallback stack; the nbformat field and BETA label were dropped.

ℹ️ Nitpicks

  • config/scripts/locale-ko-key-overrides.json:890 still carries an override for the removed key auto.components.editor.IpynbViewer.59b6cd874b. It is inert (overrides are only looked up when translating an existing key), but it is dead data that the catalog removal should have retired alongside the key.
  • src/renderer/src/lib/editor-font-zoom.ts:1 now imports buildFontFamily from terminal-pane/layout-serialization, dragging that module's heavy transitive graph (pane manager, replay guard, crash breadcrumbs) into every editor/diff consumer of this shared helper. Moving the pure string helper to its own small module would keep the layering clean.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

text: string
error?: boolean
}): React.JSX.Element {
function isRenderableMime(mime: string): boolean {

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.

isRenderableMime dropped application/javascript, which the old branch rendered as preformatted text, so a display bundle carrying only that MIME now produces no output. Impact is low because kernels normally include a text/plain fallback, but if the removal was incidental, add it back.

The cell's Escape command had no context, so Escape with suggest, find or
parameter hints open closed the whole cell editor. It now only fires when
none of those widgets is visible.
The output frame had allow-same-origin only so the viewer could measure its
content height. Notebook HTML is untrusted, so the frame is now sandbox=""
(opaque origin, no scripts) at a fixed height that fits a pandas head() or
describe() table and scrolls anything larger.
lib/editor-font-zoom imported it from a terminal-pane component module. The
monospace fallback chain now lives in lib, and every importer, including the
terminal, points there. Pure move; the tests move with it.
resolveEditorFontStack quoted a value like "JetBrains Mono, monospace" as
one family name, which no font matches. A comma list is now used as-is;
only a single name gets the quoted fallback chain.

@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

Incremental re-review of the 5 commits pushed since the last Pullfrog review (35a4534..b117538), on top of the full .ipynb notebook redesign. Every change in this delta is a response to prior feedback, plus two follow-up fixes.

  • Restored the opaque frame — IpynbHtmlOutput drops allow-same-origin; same-origin height measurement is replaced by a fixed h-72 scrollable frame, and IpynbRendering.test.tsx now pins sandbox === ''. This closes the security-boundary concern raised last review and re-aligns with the PluginPanel.tsx invariant.
  • Relocated the font helper — buildFontFamily and its tests moved from the heavy terminal-pane/layout-serialization module to a new lib/monospace-font-family.ts, with every importer (terminal options, appearance, editor font stack) updated. Resolves the layering nitpick.
  • Escape dismisses widgets first — the cell editor gates its deactivate command behind !suggestWidgetVisible && !findWidgetVisible && !parameterHintsVisible (all valid Monaco context keys), so a bare Escape leaves the cell while an open suggest/find/signature widget consumes it.
  • Comma-separated font stacks pass through — resolveEditorFontStack returns a user-supplied list unchanged instead of quoting it into a single unknown family name.
  • Dropped the stale Korean override for the removed IpynbViewer key.

One prior inline question remains open and unchanged: isRenderableMime still excludes application/javascript, so a display bundle carrying only that MIME renders nothing (low impact — kernels normally include a text/plain fallback, and the new tests explicitly cover falling back to text for unrenderable MIMEs).

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (3)

🟠 Major · Recreate Monaco when the parsed cell changes. · IpynbCellEditor.tsx:144-239

src/renderer/src/components/editor/IpynbCellEditor.tsx:144-239
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Recreate Monaco when the parsed cell changes.

IpynbViewer passes an index-capturing callback, but IpynbSourceEditor registers it only once. An external content reload can replace the notebook content while the viewer remains mounted. If the reload changes cell order, the editor can retain the old model and index. A later edit can then draft the cell currently at the old index and persist the edit to the wrong cell.

Suggested fix
-  // Mount-once: the props it reads cannot change while the cell is being edited.
+  // Recreate the model when the parsed cell changes, such as after a notebook reload.
+  // Source-draft updates keep the parsed cell object stable, so typing does not recreate Monaco.
   useLayoutEffect(() => {
@@
-    // oxlint-disable-next-line react-hooks/exhaustive-deps -- mount-once; see the Why above.
-  }, [])
+    // oxlint-disable-next-line react-hooks/exhaustive-deps -- source drafts update the existing model; parsed cell changes recreate it.
+  }, [cell])
🟡 Minor · Block file: image sources in notebook Markdown. · IpynbCellEditor.tsx:27-36

src/renderer/src/components/editor/IpynbCellEditor.tsx:27-36
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Block file: image sources in notebook Markdown.

The shared preview preserves file: URLs, and IpynbMarkdownCell uses the default image renderer. Electron file: documents can load local files, so an untrusted notebook can display a user-local image. The top-level navigation policy does not block image subresources. This is a localized privacy regression; the evidence does not support code execution or file exfiltration.

Suggested fix
-const NO_MARKDOWN_COMPONENTS: Components = {}
+const NO_MARKDOWN_COMPONENTS: Components = {
+  img: ({ src, ...props }) => {
+    if (typeof src === 'string' && src.toLowerCase().startsWith('file:')) {
+      return null
+    }
+    return <img {...props} src={src} />
+  }
+}
🟡 Minor · Serialize JSON values before the generic text fallback. · IpynbCellOutputs.tsx:109-127

src/renderer/src/components/editor/IpynbCellOutputs.tsx:109-127
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Serialize JSON values before the generic text fallback.

When a display bundle contains only application/json with an array of objects, parseDisplayItems preserves the array. DisplayItem sends it to valueToText, which converts each object to [object Object]. Keep JSON handling MIME-specific so line-array text output remains unchanged.

Suggested fix
   if (item.mime.startsWith('image/')) {
     const uri = dataUriForImage(item)
     return uri ? (
       <img
         src={uri}
         alt={item.mime}
         className="mx-3 max-h-[520px] max-w-full self-start object-contain"
       />
     ) : null
   }
+  if (item.mime === 'application/json' || item.mime.endsWith('+json')) {
+    const text =
+      typeof item.value === 'string' ? item.value : JSON.stringify(item.value ?? null, null, 2)
+    return <TextOutput text={text} />
+  }
   if (item.mime === 'text/markdown') {
     return <IpynbMarkdownCell source={valueToText(item.value)} />
   }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 12b89cf5-c0df-4607-ab2a-4b06fa4a6304

📥 Commits

Reviewing files that changed from the base of the PR and between 35a4534 and b117538.

📒 Files selected for processing (15)
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/dashboard-popout/preview-terminal-options.ts
  • src/renderer/src/components/editor/IpynbCellEditor.tsx
  • src/renderer/src/components/editor/IpynbHtmlOutput.tsx
  • src/renderer/src/components/editor/IpynbRendering.test.tsx
  • src/renderer/src/components/settings/TerminalSettingsPreview.lifecycle.test.tsx
  • src/renderer/src/components/settings/TerminalSettingsPreview.tsx
  • src/renderer/src/components/terminal-pane/layout-serialization.test.ts
  • src/renderer/src/components/terminal-pane/layout-serialization.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/lib/editor-font-zoom.test.ts
  • src/renderer/src/lib/editor-font-zoom.ts
  • src/renderer/src/lib/monospace-font-family.test.ts
  • src/renderer/src/lib/monospace-font-family.ts
💤 Files with no reviewable changes (3)
  • src/renderer/src/components/terminal-pane/layout-serialization.test.ts
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/terminal-pane/layout-serialization.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/editor/IpynbCellEditor.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

// Append each fallback unless already present (case-insensitive) to avoid duplicates.
for (const fallback of FALLBACK_FONTS) {
const lower = fallback.toLowerCase()
if (!lowerParts.some((p) => p.includes(lower))) {

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the generic monospace keyword.

When the configured family is monospace, Line 21 quotes it as a named font. This substring check then omits the unquoted generic fallback. The editor can select a different installed font instead of the configured system monospace font. Keep a standalone monospace unquoted, and suppress the generic fallback only when that keyword is already present unquoted. Add a test for monospace and for a font name that contains that word.

Proposed fix
-  const parts = trimmed ? [`"${trimmed}"`] : []
+  const parts = trimmed
+    ? [trimmed.toLowerCase() === 'monospace' ? 'monospace' : `"${trimmed}"`]
+    : []
...
-    if (!lowerParts.some((p) => p.includes(lower))) {
+    if (!lowerParts.some((p) => (fallback === 'monospace' ? p === lower : p.includes(lower)))) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!lowerParts.some((p) => p.includes(lower))) {
if (!lowerParts.some((p) => (fallback === 'monospace' ? p === lower : p.includes(lower)))) {

@Jinwoo-H
Jinwoo-H merged commit 519bde8 into main Sep 23, 2026
30 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.

[Feature] Better jupyter notebook support

1 participant