fix: pass theme to register_formatters in pyodide and script runner#9553
Merged
Conversation
Both call sites had user config in scope (or via context) but were defaulting formatters to the light theme.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
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, readmarimo_config["display"]["theme"]from the runtime context and pass it toregister_formatters. - In
_launch_pyodide_kernel, passuser_config["display"]["theme"]toregister_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. |
Contributor
There was a problem hiding this comment.
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
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both call sites had user config in scope (or via context) but were
defaulting formatters to the light theme.