Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR closes any issues, list them here by number (e.g., Closes #123). --> - Adds a feature flag to enable storage inspector - Implements frontend features for storage inspector including: - Downloading a file - Searching a file (must have been expanded, only client-side search). This is consistent with cloudflare / aws where they do client-side searching rather than server-side search which can be expensive. - UI display for file types, file size, last modified - Refactors UI components across session-panel for reuse here. <img width="437" height="537" alt="image" src="https://github.com/user-attachments/assets/21f3230b-5444-4359-949c-16dbff845b6b" /> https://github.com/user-attachments/assets/96bedd6a-ee0e-44cb-967e-8d71e1a42d67 **Future improvements** - ~Add 'copy' feature, copy the full URL~. Maybe 'copy Python snippet' to read locally in Python - Preview file (open file in external browser / sidepanel / expanded) - ~Refresh connection~ ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] Tests have been added for the changes made. - [ ] Documentation has been updated where applicable, including docstrings for API changes. - [x] Pull request title is a good summary of the changes - it will be used in the [release notes](https://github.com/marimo-team/marimo/releases).
## 📝 Summary <!-- Provide a concise summary of what this pull request is addressing. If this PR closes any issues, list them here by number (e.g., Closes #123). --> adds docs + link to docs from the editor. small fix to capitalize the display_name of storages. <img width="1512" height="824" alt="image" src="https://github.com/user-attachments/assets/077c8dcd-e50c-4f9a-b128-5853cef5ee45" /> video https://github.com/user-attachments/assets/d3f7d33c-4fb8-4290-a9b7-054662d33f30 ## 📋 Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [ ] Tests have been added for the changes made. - [x] Documentation has been updated where applicable, including docstrings for API changes. - [x] Pull request title is a good summary of the changes - it will be used in the [release notes](https://github.com/marimo-team/marimo/releases).
6e0040c to
299edd4
Compare
There was a problem hiding this comment.
Pull request overview
Adds an experimental “Storage Inspector” (remote storage browser) behind a feature flag, wiring new backend storage commands/notifications through to new UI state, panel, and API endpoints.
Changes:
- Add runtime/server support for listing and downloading external storage entries (commands, callbacks, notifications, HTTP endpoints, OpenAPI updates).
- Add frontend storage state + request registry and a new Storage Inspector UI in the Files panel under an experimental flag.
- Add docs + examples and comprehensive unit/integration tests across backend and frontend.
Reviewed changes
Copilot reviewed 49 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/_session/state/test_session_external_storage.py | Adds SessionView tests for merging/filtering storage namespaces and notification behavior. |
| tests/_server/api/endpoints/test_storage_endpoints.py | Adds endpoint tests for storage list/download and read-mode authorization. |
| tests/_runtime/test_virtual_file.py | Adds tests for VirtualFile.create_and_register behavior with/without context and empty buffers. |
| tests/_runtime/test_runtime_external_storage.py | Adds runtime tests for storage list/download success and error paths (incl. thread dispatch). |
| tests/_data/_external_storage/test_storage_models.py | Adds tests for download_file() and display_name behavior for storage backends. |
| tests/_data/_external_storage/test_get_storage.py | Updates namespace conversion expectations to use backend display_name; removes nullable-name case. |
| pyproject.toml | Removes default enabling of storage_inspector under experimental config. |
| packages/openapi/src/api.ts | Adds storage endpoints + storage command/notification schemas; updates StorageNamespace.name to required string. |
| packages/openapi/api.yaml | Adds storage endpoints + schemas mirroring runtime/server changes; updates StorageNamespace.name to non-null. |
| mkdocs.yml | Renames nav group and adds Remote Storage guide to “Working with data”. |
| marimo/_session/state/session_view.py | Stores/merges StorageNamespacesNotification and filters namespaces by variable scope. |
| marimo/_server/models/models.py | Adds request models for storage list/download that map to kernel commands. |
| marimo/_server/api/router.py | Registers new /api/storage router. |
| marimo/_server/api/endpoints/storage.py | Adds /list_entries and /download endpoints dispatching control requests. |
| marimo/_runtime/virtual_file/virtual_file.py | Adds VirtualFile.create_and_register helper with fallback to data URLs. |
| marimo/_runtime/runtime.py | Registers new storage commands and implements ExternalStorageCallbacks (list/download). |
| marimo/_runtime/commands.py | Introduces StorageListEntriesCommand and StorageDownloadCommand in the command union. |
| marimo/_messaging/notification.py | Adds StorageEntriesNotification and StorageDownloadReadyNotification to notification union. |
| marimo/_data/_external_storage/models.py | Makes namespace name non-null; adds DownloadResult, download_file(), and display_name mapping. |
| marimo/_data/_external_storage/get_storage.py | Uses backend display_name when building StorageNamespace. |
| marimo/_cli/development/commands.py | Includes storage request models in generated server API schema. |
| frontend/src/core/websocket/useMarimoKernelConnection.tsx | Handles storage notifications and resolves deferred storage requests; filters storage by in-scope variables. |
| frontend/src/core/wasm/bridge.ts | Adds unimplemented stubs for storage requests in wasm bridge. |
| frontend/src/core/storage/types.ts | Adds storage types/utilities including storage path keys and URL construction. |
| frontend/src/core/storage/state.ts | Adds Jotai reducer/atoms and useStorageEntries hook for lazy entry loading + caching. |
| frontend/src/core/storage/request-registry.ts | Adds deferred request registries for list/download storage operations. |
| frontend/src/core/storage/tests/useStorageEntries.test.tsx | Tests useStorageEntries caching/fetching behavior. |
| frontend/src/core/storage/tests/types.test.ts | Tests storage key helpers and URL composition. |
| frontend/src/core/storage/tests/state.test.ts | Tests storage reducer actions: namespaces, entries caching, and filtering. |
| frontend/src/core/network/types.ts | Extends request client types with storage list/download requests. |
| frontend/src/core/network/requests-toasting.tsx | Adds toast messages for storage request failures. |
| frontend/src/core/network/requests-static.ts | Adds static-mode “not in edit mode” stubs for storage requests. |
| frontend/src/core/network/requests-network.ts | Implements network POSTs for /api/storage/list_entries and /api/storage/download. |
| frontend/src/core/network/requests-lazy.ts | Ensures storage requests wait for websocket connection. |
| frontend/src/core/islands/main.ts | Marks new storage notifications as unsupported in islands mode. |
| frontend/src/core/islands/bridge.ts | Adds unimplemented stubs for storage requests in islands bridge. |
| frontend/src/core/config/feature-flag.tsx | Adds storage_inspector experimental feature flag (default false). |
| frontend/src/components/storage/storage-inspector.tsx | Implements the Storage Inspector UI: namespaces, tree browsing, searching, copy URL, download. |
| frontend/src/components/storage/components.tsx | Adds protocol and file-type icon helpers for storage inspector UI. |
| frontend/src/components/editor/file-tree/tests/file-explorer.test.ts | Adds tests for filtering hidden files/directories in file explorer tree. |
| frontend/src/components/editor/chrome/panels/session-panel.tsx | Refactors to shared panel accordion components. |
| frontend/src/components/editor/chrome/panels/file-explorer-panel.tsx | Adds remote storage accordion section above Files panel under feature flag. |
| frontend/src/components/editor/chrome/panels/components.tsx | Introduces shared styled accordion components for sidebar panels. |
| frontend/src/components/databases/icons/google-cloud-storage.svg | Adds Google Cloud Storage icon asset for protocol rendering. |
| frontend/src/components/databases/engine-variable.tsx | Stops propagation on click to avoid toggling parent accordion/row interactions. |
| frontend/src/components/app-config/user-config-form.tsx | Adds Settings toggle for experimental Storage Inspector. |
| frontend/src/mocks/requests.ts | Extends request client mocks with storage request methods. |
| examples/storage/general.py | Adds example notebook/script demonstrating storage backends. |
| docs/guides/working_with_data/remote_storage.md | Adds Remote Storage guide for using the Storage Inspector. |
| docs/guides/working_with_data/index.md | Updates “Working with data” index to include Remote Storage. |
| docs/guides/editor_features/panels.md | Updates Files panel description to mention remote storage inspection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| name: ClassVar[str] = "storage-download-ready" | ||
| request_id: RequestId | ||
| url: Optional[str] = None |
There was a problem hiding this comment.
i dont know if the file in sharememory will be cleaned up, but something to monitor. because taking out of GA, we may want to check and instead just pass the raw bytes
cc @dmadisetti
| return return_data_url() | ||
|
|
||
| vfile = VirtualFile(filename=vfile_name, buffer=buffer) | ||
| ctx.virtual_file_registry.add(vfile, ctx) |
There was a problem hiding this comment.
we may never remove this, so could lead to a leak
| _, sep, suffix = filename.rpartition(".") | ||
| ext = suffix if sep and suffix else "bin" | ||
| return DownloadResult( | ||
| file_bytes=file_bytes, |
There was a problem hiding this comment.
another approach would would relieve some memory pressure in the marimo server and handle larger files (but also wont work for all cases), is creating a a signed url to hand back to the frontend:
https://developmentseed.org/obstore/latest/api/sign/#obstore.sign
(something to consider for a followup)
There was a problem hiding this comment.
Yeah.., maybe you are right to not rely on vfiles, and return bytes as a fallback.
📝 Summary
Adds storage inspector feature under a feature flag.
🔍 Description of Changes
📋 Checklist