Skip to content

fix: pass theme to register_formatters in pyodide and script runner#9553

Merged
mscolnick merged 1 commit into
mainfrom
ms/missing-theme
May 16, 2026
Merged

fix: pass theme to register_formatters in pyodide and script runner#9553
mscolnick merged 1 commit into
mainfrom
ms/missing-theme

Conversation

@mscolnick

Copy link
Copy Markdown
Contributor

Both call sites had user config in scope (or via context) but were
defaulting formatters to the light theme.

Both call sites had user config in scope (or via context) but were
defaulting formatters to the light theme.
Copilot AI review requested due to automatic review settings May 15, 2026 01:26
@vercel

vercel Bot commented May 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 15, 2026 1:27am

Request Review

Copilot AI 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.

Pull request overview

Passes the user-configured display theme to register_formatters in the script runner and the Pyodide kernel launcher, which were previously defaulting to the light theme despite having access to the user config.

Changes:

  • In script_runner.run, read marimo_config["display"]["theme"] from the runtime context and pass it to register_formatters.
  • In _launch_pyodide_kernel, pass user_config["display"]["theme"] to register_formatters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
marimo/_runtime/app/script_runner.py Resolves theme from runtime context and forwards it to register_formatters.
marimo/_pyodide/pyodide_session.py Forwards the launcher's user_config theme to register_formatters.

@cubic-dev-ai cubic-dev-ai 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 issues found across 2 files

Architecture diagram
sequenceDiagram
    participant Pyodide as Pyodide Session
    participant ScriptRunner as Script Runner
    participant Context as Runtime Context
    participant Formatter as register_formatters()
    
    Note over Pyodide,Formatter: Two call sites now pass theme parameter
    
    Pyodide->>Formatter: register_formatters(theme=user_config["display"]["theme"])
    Note over Pyodide,Formatter: Direct user_config access (pyodide scope)
    
    ScriptRunner->>Context: get_context()
    Context-->>ScriptRunner: Runtime context with marimo_config
    ScriptRunner->>Formatter: register_formatters(theme=get_context().marimo_config["display"]["theme"])
    Note over ScriptRunner,Formatter: Retrieves theme from runtime context
    
    alt Theme = "dark"
        Formatter->>Formatter: Configure dark mode formatters
    else Theme = "light" (default)
        Formatter->>Formatter: Configure light mode formatters
    end
Loading
@mscolnick mscolnick added the bug Something isn't working label May 15, 2026
@mscolnick mscolnick merged commit c5fc36f into main May 16, 2026
47 of 50 checks passed
@mscolnick mscolnick deleted the ms/missing-theme branch May 16, 2026 21:49
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

2 participants