-
Notifications
You must be signed in to change notification settings - Fork 892
feat: support serving a gallery of notebooks #8056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
for more information, see https://pre-commit.ci
|
cc @dmadisetti, its still in draft but can you check out the Sandbox semantics here |
dmadisetti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great start. Followups that might be useful:
- return to home from an app page
- thumbnails
As is, gallery sandbox falls back to ipc sandbox, which I think is fine. It provides consistency in experience.
We do need to fail fast if pyzmq is not installed like in sandboxed home.
But as is, even with pyzmq- this doesn't seem to work for --sandbox (at least locally, I'm getting blank screens for things that should otherwise work) and also --check.
I'd be OK raising an error for these flags, and following up in another PR. I think marimo run --sandbox falls under some of my wheelhouse so I can grab it if you'd like
| # correctness check - don't start the server if we can't import the module | ||
| for path in validated_paths: | ||
| if Path(path).is_file(): | ||
| check_app_correctness(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We maybe want to do this on launch and not stop the server itself from spawning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think about this is more of a UX tradeoff than a purely technical one. Based on #3257 my understanding is that in gallery mode we're aiming at potentially non‑technical end users, so I lean toward fail‑fast at launch: if an app check fails, I'd rather surface that to the developer than risk an end user launching a broken app. Happy to discuss alternatives ofc. Maybe we add a CLI flag to toggle between lazy and eager checks?
| ] | ||
| file_count = len(marimo_files) | ||
| has_more = file_count >= MAX_FILES | ||
| return WorkspaceFilesResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should dynamically load more apps? Torn on this (see comment above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see value in loading more apps dynamically but also see the associated concerns. Maybe let's consider adding a CLI flag to control this?
5fe2b13 to
f8566b8
Compare
|
Thanks for the feedback @dmadisetti
For now I added a clickable marimo logo to go back. Alternatively, we could go with a back arrow + "Gallery" text maybe or "Gallery / " breadcrumbs with Gallery clickable. I am not convinced though that everyone who deploys a multi-app env will want to call it "Gallery" (hence I just went with the logo for now)
That's exactly what we started to discuss with Myles. We'd want to generate OpenGraph content on the fly, (allowing users to overwrite it e.g. as PEP 723 metadata and add
That would be great. This way I can focus in this PR on better aesthetics through thumbnail (+ |
fb5521d to
5f19848
Compare
5f19848 to
f31df50
Compare
|
This CI error does not seem to be related to changes made in this PR: https://github.com/marimo-team/marimo/actions/runs/21514574296/job/61989661450?pr=8056 |
mscolnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing stuff! great work
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.8-dev1 |

📝 Summary
Enables running multiple marimo notebook files as a gallery of apps in the below style:
When pointed to a local clone of https://github.com/marimo-team/learn this gives us:
Closes #3257
🔍 Description of Changes
I based this work on #4961, borrowing the idea of reusing the existing home page infrastructure used in
marimo editmode and addinggalleryas a new frontend view inmarimo runmode./?file=<encoded>to avoid introducing new routing / mounting logic/?file=<encoded>valuesmarimo._server.file_router.ListOfFilesAppFileRouterto behave like an allowlist routermarimo run app.py -- --arg valuebehavior working while enablingmarimo run file_a.py file_b.py folderand still allowing notebook args to be explicitly separatedmarimo._cli.cli.py._resolve_root_dir)uv run marimo run /Users/petergy/Projects/opensource/marimo-team/learn. thelearnrepo is recognized as gallery root, so opening/Users/petergy/Projects/opensource/marimo-team/learn/functional_programming/05_functors.pywill be available underhttp://localhost:2720/?file=functional_programming%2F05_functors.pytitleandsubtitlefor now (notebook dir and file name piped throughtitleCase)TODO before undrafting this
--sandboxsemantics📋 Checklist