Skip to content

add snippet buttons in storage file viewer#8737

Merged
Light2Dark merged 2 commits intomainfrom
sham/add-snippet-buttons-for-stroage-viewer
Mar 24, 2026
Merged

add snippet buttons in storage file viewer#8737
Light2Dark merged 2 commits intomainfrom
sham/add-snippet-buttons-for-stroage-viewer

Conversation

@Light2Dark
Copy link
Copy Markdown
Collaborator

@Light2Dark Light2Dark commented Mar 17, 2026

📝 Summary

The snippets to read file and download file were only present in the Tree viewer for Storage Inspector. For convenience, we can bring it to the File Viewer as well.

image

The icons have been changed too.

🔍 Description of Changes

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@Light2Dark Light2Dark requested a review from manzt as a code owner March 17, 2026 13:03
Copilot AI review requested due to automatic review settings March 17, 2026 13:03
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 17, 2026 1:31pm

Request Review

@Light2Dark Light2Dark added the enhancement New feature or request label Mar 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the existing “insert snippet” actions (read/download code snippets) to the Storage Inspector’s file viewer header, so users can insert common storage code while previewing a file (not only from the tree view).

Changes:

  • Extend OpenFileInfo and StorageFileViewer props to carry protocol and backendType needed for snippet generation.
  • Add snippet action buttons to StorageFileViewer and pass them into FilePreviewHeader.actions.
  • Update StorageEntryRow open-file behavior to pass the additional context.

Reviewed changes

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

File Description
frontend/src/components/storage/storage-inspector.tsx Plumbs protocol/backendType through file-open state so the file viewer can build snippets.
frontend/src/components/storage/storage-file-viewer.tsx Renders snippet buttons in the file preview header using STORAGE_SNIPPETS + useAddCodeToNewCell.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mscolnick
mscolnick previously approved these changes Mar 17, 2026
@Light2Dark Light2Dark merged commit 4a74ce4 into main Mar 24, 2026
27 of 28 checks passed
@Light2Dark Light2Dark deleted the sham/add-snippet-buttons-for-stroage-viewer branch March 24, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants