Skip to content

Added dark mode cuz your app is extremely nice (I use it for myself) …#5

Open
msjabata25 wants to merge 3 commits into
beltromatti:developerfrom
msjabata25:Dark-mode
Open

Added dark mode cuz your app is extremely nice (I use it for myself) …#5
msjabata25 wants to merge 3 commits into
beltromatti:developerfrom
msjabata25:Dark-mode

Conversation

@msjabata25

@msjabata25 msjabata25 commented Jun 11, 2026

Copy link
Copy Markdown

Added dark mode cuz your app is extremely nice (I use it for myself) but the lack of a dark mode (and my allergy to light mode) is an ick i needed to fix.

Fix cta buttons, quiz/flashcards feedback colors, added chat markdown support (small change with md suppport but honestly very nice to have). Also added detection for if the user already has dark mode in general or not

  • Added --button-primary-bg CSS var so CTA buttons stay dark in both themes

  • Added --feedback-correct/wrong CSS vars for adaptive green/rose indicators

  • Fixed all CTA buttons (Generate/Reveal/Next/Send/Start) to use --button-primary-bg

  • Fixed quiz option feedback, VerdictBadge, DeckComplete, FeedbackCard colors

  • Darkened flashcard rating tones (50→200, 200→400) for dark mode contrast

  • Fixed chat user bubble background in dark mode

  • Added react-markdown rendering to chat Bubble component

Note: The Feynman session where the bubble thing is is i think still light mode but i'll try and fix it in a later contribution


Summary by cubic

Adds a system-aware dark mode with SSR application and a Settings toggle, with better live theme responses across the app. Updates tokens so panels, PDFs, buttons, and feedback look right in both themes, and adds chat Markdown with preserved line breaks.

  • New Features

    • Dark mode via html.dark tokens and ThemeProvider; follows saved preference or system and re-applies on changes via SETTINGS_EVENT and media queries.
    • Chat bubbles render Markdown using react-markdown, preserve newlines, block images, and sanitize https?:// links.
    • Theme-aware visualizers and PDFs: Graph and 3D views adapt and Graph redraws on theme toggles; right-pane and modals use --surface-* and --shadow-modal.
  • Bug Fixes

    • Fixed theme override edge cases (system change or stale fetch) and removed the Electron white flash on startup.
    • Sandbox hardening: blocked eval and constructor-chain escapes by nulling Function/AsyncFunction/GeneratorFunction before running viz code.
    • Reliability: atomic writes now use unique tmp suffixes; KG build dedup and unhandled rejection fix; guarded UploadCard unmount and added keyboard handling; docId regex widened (e.g. sample-anatomy) while still preventing traversal; VoiceBlob keeps a 1:1 aspect ratio.

Written for commit 34f8341. Summary will update on new commits.

Review in cubic

Greptile Summary

This PR adds a full system-aware dark mode with SSR class injection, a blocking inline script for FOUC prevention, a ThemeProvider that reacts to live settings events and OS preference changes, and a Settings toggle — along with Markdown rendering in chat bubbles, atomic file writes, KG build dedup, and sandbox hardening in the viz runtime.

  • Dark mode tokens & theming: app/globals.css gains a complete html.dark block with surface, ink, feedback, shadow, and button tokens; all hardcoded bg-white / rose / emerald Tailwind classes across the right-pane views, library, PDF viewer, and overlays are migrated to CSS variables.
  • FOUC mitigation: app/layout.tsx reads loadSettings() at SSR time and injects both a server-rendered dark class on <html> and a tiny blocking <script> that applies or removes it based on stored preference or matchMedia, so dark-mode users no longer see a white flash on navigation.
  • Chat Markdown + reliability fixes: ChatView Bubble renders via react-markdown with sanitized links and blocked images; UploadCard, lib/kg.ts, lib/store.ts, and lib/work-context.ts all switch to atomic UUID-suffixed tmp-file writes; lib/paths.ts adds path-traversal validation on every docId.

Confidence Score: 4/5

Safe to merge for most users, but light-mode Electron users will see a dark flash on startup and a mismatched Windows title bar, and the 3D visualiser background won't update after a live theme toggle.

Two issues affect current users on well-travelled paths: the Electron window chrome (backgroundColor and titleBarOverlay) is now hardcoded dark regardless of the saved preference, so anyone running the app in light mode gets a visual regression at every launch; and ThreeDView reads isDark only at mount time with no observer, so switching theme while a 3D scene is open leaves a stale background color. Both are straightforward to fix and do not affect data correctness.

electron/main.js (hardcoded dark window chrome) and components/Visualizer/ThreeDView.tsx (theme not reactive after mount) need attention before the Electron build ships to light-mode users.

Important Files Changed

Filename Overview
components/ThemeProvider.tsx New client component that reacts to live settings events and system preference changes to toggle the html.dark class; avoids the async-fetch FOUC by relying on SSR class injection and inline blocking script instead.
app/layout.tsx Adds SSR dark-class injection from loadSettings(), a blocking inline script for system-preference fallback, and wraps children in ThemeProvider — together eliminating the FOUC for both explicit and system-preference dark mode.
app/globals.css Adds comprehensive dark-mode CSS token overrides under html.dark plus new --button-primary-bg, --feedback-correct/wrong-, and --shadow- tokens; also migrates several hardcoded rgba() usages to theme-aware values.
components/SettingsButton.tsx Adds a theme toggle switch with system-preference fallback and userToggledRef guard to prevent the in-flight settings fetch from clobbering a user-initiated toggle; guard on persist() removed safely since the route merges deltas server-side.
electron/main.js backgroundColor and Windows titleBarOverlay both hardcoded to dark values (#111113), regressing light-mode users who will now see a dark flash on startup and a mismatched dark title bar.
components/Visualizer/ThreeDView.tsx Reads isDark once at effect mount time to set renderer.setClearColor, but has no MutationObserver like GraphView — the 3D background won't update after a live theme toggle.
components/Visualizer/GraphView.tsx Correctly adds a MutationObserver on html.dark to increment themeVersion, which is included in the drawing effect's dependency array so the canvas redraws on every theme change.
lib/viz-runtime.ts Attempts to harden the viz sandbox by nulling Function/AsyncFunction/GeneratorFunction prototype.constructor and shadowing eval; the __origFunc binding is still reachable from model code via closure (flagged in a prior review thread).
lib/paths.ts Adds assertValidDocId validation to all path-building functions; regex widened to allow hyphens (e.g. sample-anatomy) while still blocking path traversal characters.
components/RightPane/KnowledgeGraphView.tsx GraphCanvas background and label colors migrated to CSS tokens; selected-node ring stroke still hardcoded to #111113 which is near-invisible against the dark --surface-canvas.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant SSR as app/layout.tsx (SSR)
    participant Script as Inline blocking script
    participant TP as ThemeProvider
    participant SB as SettingsButton
    participant API as /api/settings

    SSR->>SSR: loadSettings() → theme
    SSR->>Browser: html.dark class + inline script
    Browser->>Script: executes before paint
    Script->>Browser: classList.add/remove(dark) from matchMedia fallback
    Browser->>TP: mount (useEffect)
    TP->>Browser: addEventListener(SETTINGS_EVENT)
    TP->>Browser: matchMedia.addEventListener(change)
    Note over TP,Browser: Live system pref changes → fetch + reapply

    SB->>API: GET /api/settings (on panel open)
    API-->>SB: theme, autoGenerate, maxRetries
    SB->>SB: setTheme(stored value)

    SB->>SB: user clicks toggle
    SB->>Browser: classList.toggle(dark)
    SB->>API: POST /api/settings with theme
    SB->>Browser: dispatchEvent(SETTINGS_EVENT)
    Browser->>TP: SETTINGS_EVENT listener fires
    TP->>Browser: applyTheme(detail.theme)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant SSR as app/layout.tsx (SSR)
    participant Script as Inline blocking script
    participant TP as ThemeProvider
    participant SB as SettingsButton
    participant API as /api/settings

    SSR->>SSR: loadSettings() → theme
    SSR->>Browser: html.dark class + inline script
    Browser->>Script: executes before paint
    Script->>Browser: classList.add/remove(dark) from matchMedia fallback
    Browser->>TP: mount (useEffect)
    TP->>Browser: addEventListener(SETTINGS_EVENT)
    TP->>Browser: matchMedia.addEventListener(change)
    Note over TP,Browser: Live system pref changes → fetch + reapply

    SB->>API: GET /api/settings (on panel open)
    API-->>SB: theme, autoGenerate, maxRetries
    SB->>SB: setTheme(stored value)

    SB->>SB: user clicks toggle
    SB->>Browser: classList.toggle(dark)
    SB->>API: POST /api/settings with theme
    SB->>Browser: dispatchEvent(SETTINGS_EVENT)
    Browser->>TP: SETTINGS_EVENT listener fires
    TP->>Browser: applyTheme(detail.theme)
Loading

Comments Outside Diff (1)

  1. components/RightPane/ChatView.tsx, line 439-451 (link)

    P2 Fenced code blocks without a language tag render as inline code

    isInline is derived from !className. This works for labelled fences (```ts) because react-markdown injects language-ts. For an unlabelled fence (``` with no language), react-markdown passes no className, so isInline is true and the content is wrapped in the small inline <code> span instead of the styled <pre> block. LLM responses frequently omit language labels, so multi-line code will collapse into a single inline chip. A safer guard is to additionally check that the content contains a newline before treating it as inline.

Reviews (3): Last reviewed commit: "review fixes: sandbox, write races, them..." | Re-trigger Greptile

…but the lack of a dark mode (and my allergy to light mode) is an ick i needed to fix.

Fix cta buttons, quiz/flashcards feedback colors, added chat markdown support (small change with md suppport but honestly very nice to have). Also added detection for if the user already has dark mode in general or not

- Add --button-primary-bg CSS var so CTA buttons stay dark in both themes
- Add --feedback-correct/wrong CSS vars for adaptive green/rose indicators
- Fix all CTA buttons (Generate/Reveal/Next/Send/Start) to use --button-primary-bg
- Fix quiz option feedback, VerdictBadge, DeckComplete, FeedbackCard colors
- Darken flashcard rating tones (50→200, 200→400) for dark mode contrast
- Fix chat user bubble background in dark mode
- Add react-markdown rendering to chat Bubble component

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements a dark mode theme across the application by introducing a ThemeProvider, updating global CSS variables, and replacing hardcoded colors with theme-aware design tokens. It also adds a dark mode toggle in the settings panel and integrates markdown rendering in the chat view. The feedback highlights a critical bug in the settings API where updating other preferences wipes out the saved theme, and suggests loading the theme server-side to prevent a Flash of Unstyled Content (FOUC). Additionally, recommendations are made to use Tailwind's dark: modifier for flashcard rating colors and to replace hardcoded code block backgrounds with design system tokens to ensure proper contrast in dark mode.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread app/api/settings/route.ts
Comment thread app/layout.tsx
Comment thread components/RightPane/FlashcardsView.tsx Outdated
Comment thread components/ThemeProvider.tsx Outdated
Comment thread components/RightPane/ChatView.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

8 issues found across 18 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread components/SettingsButton.tsx
Comment thread app/api/settings/route.ts
Comment thread components/RightPane/index.tsx Outdated
Comment thread components/ThemeProvider.tsx
Comment thread components/RightPane/ChatView.tsx Outdated
Comment thread components/RightPane/ChatView.tsx
Comment thread components/RightPane/ChatView.tsx Outdated
Comment thread components/RightPane/ChatView.tsx Outdated
@7Mik 7Mik changed the base branch from main to developer June 12, 2026 00:47
@7Mik

7Mik commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@msjabata25 thanks for your submission.
Could you please look into the issues that the AI reviewers found before pulling again? I will take care of the conflicts with the developer branch afterwards.
Also, please ensure that the dark mode is applied to the whole website, including the feynman session, before applying for review again

@7Mik 7Mik marked this pull request as draft June 12, 2026 16:27
@beltromatti

Copy link
Copy Markdown
Owner

@greptile

Comment thread components/ThemeProvider.tsx Outdated
Comment thread components/PdfViewer.tsx Outdated
Comment thread components/RightPane/FlashcardsView.tsx
Comment thread components/WelcomePopup.tsx Outdated
…rk mode gaps

- lib/viz-runtime.ts: block sandbox escape via Function constructor chain
- lib/work-context.ts, lib/kg.ts, lib/store.ts: atomic write (tmp+rename)
- lib/kg-runner.ts: fix TOCTOU race, catch unhandled promise rejection
- lib/paths.ts: add docId validation regex to prevent path traversal
- electron/main.js: fix dark-mode white flash on startup
- app/api/settings/route.ts: preserve theme on partial settings POST
- app/layout.tsx + ThemeProvider.tsx: SSR dark class via server-side settings read
- components/SettingsButton.tsx: remove hydration guard that dropped toggles
- components/RightPane/ChatView.tsx: block img, hardcoded colors → CSS vars, href sanitize
- components/RightPane/FeynmanView.tsx: gradient/rose → surface/feedback tokens
- components/RightPane/KnowledgeGraphView.tsx: deduplicate API fetch
- components/RightPane/VoiceBlob.tsx: add maxWidth:100% for responsive sizing
- components/Visualizer/GraphView.tsx: canvas/axis colors adapt to html.dark
- components/Visualizer/ThreeDView.tsx: clearColor adapts to html.dark
- components/PdfViewer.tsx: bg-white → surface tokens
- components/UploadCard.tsx: unmount race guard, feedback tokens, keyboard handler
- components/CodexHealthBanner.tsx: rose/amber → feedback/tag tokens
- app/globals.css: refine dark palette surface/ink/border/accents

@msjabata25 msjabata25 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed the issues that were in the ai reviews.
All details in the commit message .
And don't worry I did update the voice blob and made it match the theme

@7Mik

7Mik commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

@greptile-apps
@cubic-dev-ai

@cubic-dev-ai

cubic-dev-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

@greptile-apps
@cubic-dev-ai

@7Mik I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown

The review has been posted above. Here's a quick summary of the key findings:

High priority:

  1. FOUC (Flash of Unstyled Content)ThemeProvider applies the dark class only after an async API fetch, so dark-mode users see a light flash on every page load. The fix is to emit an inline <script> in the document <head> that reads localStorage/a cookie and sets html.dark synchronously before paint.
  2. PDF scroll containerscrollRef div in PdfViewer.tsx still has bg-white; the area around PDF pages stays white in dark mode.
  3. Flashcard rating buttons — still using hardcoded Tailwind shades (-200, -400) instead of the --feedback-correct/wrong-* CSS variables used everywhere else in this PR.

Lower priority:

  • WelcomePopup drop shadow is hardcoded to a light-mode rgba value — nearly invisible in dark mode.
  • Unlabelled fenced code blocks in chat will render as inline <code> chips instead of <pre> blocks because isInline relies solely on !className.

The PR is solid overall — the token design in globals.css is well-structured and the quiz/flashcard feedback migration is consistent. These gaps are the remaining rough edges for the dark-mode experience.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

11 issues found across 29 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread lib/viz-runtime.ts
Comment thread lib/paths.ts Outdated
Comment thread lib/work-context.ts Outdated
Comment thread components/RightPane/VoiceBlob.tsx
Comment thread components/Visualizer/GraphView.tsx
Comment thread components/RightPane/ChatView.tsx Outdated
Comment thread components/ThemeProvider.tsx Outdated
Comment thread components/SettingsButton.tsx Outdated
Comment thread components/UploadCard.tsx Outdated
Comment thread components/AccountButton.tsx Outdated
Comment thread lib/viz-runtime.ts
- lib/viz-runtime.ts: null AsyncFunction/GeneratorFunction constructors
- lib/work-context.ts, kg.ts, store.ts: use unique tmp suffix per write
- lib/paths.ts: widen docId regex to accept non-hex IDs (sample-anatomy)
- components/Visualizer/GraphView.tsx: add MutationObserver for theme
  changes; use ink/inkMuted for grid, axes, legend, axis labels
- components/ThemeProvider.tsx: always reapply() on system pref change
- components/SettingsButton.tsx: guard stale fetch from overwriting
  user theme toggle (userToggledRef)
- components/RightPane/ChatView.tsx: unconditional whitespace-pre-wrap
  so non-pulsing bubbles preserve newlines
- components/RightPane/FlashcardsView.tsx: hardcoded Tailwind shades →
  --feedback-wrong/tag-amber/--feedback-correct/tag-sky tokens
- components/RightPane/VoiceBlob.tsx: add aspectRatio:1 to prevent
  canvas distortion when maxWidth clamps width
- components/AccountButton.tsx: logout hover uses feedback-wrong tokens
- components/WelcomePopup.tsx + globals.css: add --shadow-modal token
- components/UploadCard.tsx: add e.preventDefault() on Space/Enter
@msjabata25

Copy link
Copy Markdown
Author

Fixed the remaining issues (the ai reviewer is pointing out already solved issues) so if it comes out with another similar review report then i suggest you review the codebase with something else to avoid fixing the same issue over and over again

@msjabata25 msjabata25 marked this pull request as ready for review June 17, 2026 12:32

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found across 29 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="components/Visualizer/GraphView.tsx">

<violation number="1" location="components/Visualizer/GraphView.tsx:266">
P2: Theme-triggered redraw can violate the "once per spec" error-callback contract. Toggling theme may repeatedly re-emit runtime errors and retrigger downstream repair/error flows for unchanged graph specs.</violation>
</file>

<file name="components/ThemeProvider.tsx">

<violation number="1" location="components/ThemeProvider.tsx:31">
P2: Fetch-failure fallback overrides explicit theme with system preference. On `/api/settings` error, keep current class instead of calling system fallback.</violation>
</file>

<file name="components/RightPane/ChatView.tsx">

<violation number="1" location="components/RightPane/ChatView.tsx:360">
P3: `code` markdown renderer forwards react-markdown internal props to DOM. Strip `node` before spreading props to `<code>` to avoid React unknown-prop warnings.</violation>
</file>

<file name="components/SettingsButton.tsx">

<violation number="1" location="components/SettingsButton.tsx:90">
P2: Dark-mode switch state is memoized against `theme` only, so follow-system UI can go stale after OS theme changes. This can invert toggle behavior and show incorrect status text until another state change happens.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

// every parent rerender that produces a new function reference.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [spec]);
}, [spec, themeVersion]);

@cubic-dev-ai cubic-dev-ai Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Theme-triggered redraw can violate the "once per spec" error-callback contract. Toggling theme may repeatedly re-emit runtime errors and retrigger downstream repair/error flows for unchanged graph specs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/Visualizer/GraphView.tsx, line 266:

<comment>Theme-triggered redraw can violate the "once per spec" error-callback contract. Toggling theme may repeatedly re-emit runtime errors and retrigger downstream repair/error flows for unchanged graph specs.</comment>

<file context>
@@ -251,7 +263,7 @@ export default function GraphView({ spec, onRuntimeError }: Props) {
     // every parent rerender that produces a new function reference.
     // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, [spec]);
+  }, [spec, themeVersion]);
 
   return (
</file context>
Fix with cubic

fetch("/api/settings", { cache: "no-store" })
.then((r) => r.json())
.then((s: { theme?: string }) => applyTheme(s.theme))
.catch(() => applyTheme(undefined));

@cubic-dev-ai cubic-dev-ai Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Fetch-failure fallback overrides explicit theme with system preference. On /api/settings error, keep current class instead of calling system fallback.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/ThemeProvider.tsx, line 31:

<comment>Fetch-failure fallback overrides explicit theme with system preference. On `/api/settings` error, keep current class instead of calling system fallback.</comment>

<file context>
@@ -0,0 +1,56 @@
+    fetch("/api/settings", { cache: "no-store" })
+      .then((r) => r.json())
+      .then((s: { theme?: string }) => applyTheme(s.theme))
+      .catch(() => applyTheme(undefined));
+  }, []);
+
</file context>
Fix with cubic

const userToggledRef = useRef(false);

// Effective theme — if no explicit preference is stored, follow system.
const effectiveTheme = useMemo<"light" | "dark">(() => {

@cubic-dev-ai cubic-dev-ai Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Dark-mode switch state is memoized against theme only, so follow-system UI can go stale after OS theme changes. This can invert toggle behavior and show incorrect status text until another state change happens.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/SettingsButton.tsx, line 90:

<comment>Dark-mode switch state is memoized against `theme` only, so follow-system UI can go stale after OS theme changes. This can invert toggle behavior and show incorrect status text until another state change happens.</comment>

<file context>
@@ -81,20 +82,33 @@ export default function SettingsButton() {
+  const userToggledRef = useRef(false);
+
+  // Effective theme — if no explicit preference is stored, follow system.
+  const effectiveTheme = useMemo<"light" | "dark">(() => {
+    if (theme === "light" || theme === "dark") return theme;
+    if (typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches) {
</file context>
Fix with cubic

{children}
</pre>
),
code: ({ className, children, ...props }) => {

@cubic-dev-ai cubic-dev-ai Bot Jun 17, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: code markdown renderer forwards react-markdown internal props to DOM. Strip node before spreading props to <code> to avoid React unknown-prop warnings.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At components/RightPane/ChatView.tsx, line 360:

<comment>`code` markdown renderer forwards react-markdown internal props to DOM. Strip `node` before spreading props to `<code>` to avoid React unknown-prop warnings.</comment>

<file context>
@@ -335,13 +336,54 @@ function Bubble({
+                  {children}
+                </pre>
+              ),
+              code: ({ className, children, ...props }) => {
+                const text = String(children);
+                const isInline = !className && !text.includes("\n");
</file context>
Suggested change
code: ({ className, children, ...props }) => {
code: ({ node: _node, className, children, ...props }) => {
Fix with cubic

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.

3 participants