Skip to content

improvement: refresh static notebook run dialog - #10741

Merged
mscolnick merged 3 commits into
mainfrom
ms/fix/static-run-edit-popup
Sep 3, 2026
Merged

mscolnick merged 3 commits into
mainfrom
ms/fix/static-run-edit-popup

Conversation

@mscolnick

@mscolnick mscolnick commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor
  • Molab is hidden when sharing is disabled, now covered by regression tests.
  • Added package-manager tabs: uv (recommended), pip, and conda.
  • Added copy buttons for commands.
  • Safely quotes filenames and URLs.
  • Handles Windows path basenames.
  • Only suggests direct URLs supported by marimo edit.
  • Avoids generating the molab URL when its section is hidden.
image

Copilot AI lite review requested due to automatic review settings September 3, 2026 16:24
@vercel

vercel Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 3, 2026 5:56pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional changes are covered by new tests and the remaining feedback is a minor naming clarity nit.

Pull request overview

Refreshes the “Run or Edit” dialog shown on static notebooks to provide clearer run instructions, safer copy/paste commands, and better configurability around Molab.

Changes:

  • Reworked the static notebook dialog UI to use package-manager tabs (uv/pip/conda) and added “copy command” buttons.
  • Added URL/filename handling helpers for safer shell command output (quoting + URL eligibility + Windows basename handling).
  • Added regression tests covering Molab visibility and command/tab rendering, plus URL-target selection logic.
File summaries
File Description
frontend/src/components/static-html/static-banner.tsx Updates the static notebook dialog UI, adds command blocks + URL run-target selection helper, and gates Molab link generation behind config.
frontend/src/components/static-html/tests/static-banner.test.tsx Adds tests for Molab visibility, tabbed command rendering, and getStaticNotebookRunTarget behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +172 to +182
const isHtmlFile = url.pathname.endsWith(".html") && url.search === "";
const isMarimoHost =
url.protocol === "https:" &&
(url.hostname === "marimo.app" ||
url.hostname === "links.marimo.app" ||
(url.hostname === "static.marimo.app" &&
url.pathname.startsWith("/static")) ||
url.pathname.includes("/notebooks/nb"));
if (!isHtmlFile && !isMarimoHost) {
return filename;
}
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 56.92% 21363 / 37528
🔵 Statements 56.87% 21738 / 38224
🔵 Functions 50.08% 4820 / 9624
🔵 Branches 50.06% 11005 / 21980
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/components/static-html/static-banner.tsx 80% 85.71% 62.5% 80% 35, 39, 137-149, 199-200
Generated in workflow #21039 for commit e37209b by the Vitest Coverage Report Action

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/static-html/static-banner.tsx Outdated
Light2Dark
Light2Dark previously approved these changes Sep 3, 2026
@mscolnick
mscolnick merged commit e363c24 into main Sep 3, 2026
27 of 28 checks passed
@mscolnick
mscolnick deleted the ms/fix/static-run-edit-popup branch September 3, 2026 17:55
williambdean pushed a commit to williambdean/marimo that referenced this pull request Sep 6, 2026
- Molab is hidden when sharing is disabled, now covered by regression
tests.
- Added package-manager tabs: uv (recommended), pip, and conda.
- Added copy buttons for commands.
- Safely quotes filenames and URLs.
- Handles Windows path basenames.
- Only suggests direct URLs supported by marimo edit.
- Avoids generating the molab URL when its section is hidden.

<img width="1212" height="480" alt="image"
src="https://github.com/user-attachments/assets/922dc5f2-fa6c-42fa-b631-181c47ef65ad"
/>

This branch was successfully deployed

1 active deployment
Preview — e37209b2 Deployed Sep 3, 2026 by vercel[bot]
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