Open wasimsandhu opened 4 days ago
Thanks for the request this makes sense. Couple ideas for implementation:
AppConfig
and add autorun
there? What are the config names? off/default
or off/on
?UserConfig
and put in the to heading.
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "marimo",
# ]
# [tool.marimo.runtime]
# auto_instantiate = false
# ///
I prefer 2 but it is more work, but 2 will help when we want to support overriding notebook config with by the user's pyprojec.toml. It also allows overriding darkmode and other runtime configuration.
I also think we can improve the UX when starting up a notebook that is not instantiated, such as a banner at the top to "Run All" or "Run Markdown", and maybe a lot less yellow everywhere
I don't have as much context around UserConfig
so I'm not sure what you mean when you say to reuse it (in Option 2).
Also, I know it is a separate discussion, but when it comes to pyproject.toml settings, I'm not sure this solves the per-notebook basis that is requested for runtime configurations, since those are project-level settings.
Description
Having an app-level config for autorun is convenient for users who want some notebooks to run on startup and not others.
Currently, I have to enable and disable this config from marimo home by clicking Settings > User settings > Runtime > Autorun on startup (4 clicks to toggle one setting).
Suggested solution
Here's a quick table showing the expected behavior of these configurations:
TLDR: The notebook can only be autorun on startup if BOTH user config and app config permit it.
Alternative
No response
Additional context
This issue is related to (and is part of the suggested solution for) #2884.