Skip to content

Sidebar navigation redirects to edit homepage when opening notebook from marimo edit . #7131

@shrikantad

Description

@shrikantad

Describe the bug

When I run my notebook with a sidebar using marimo run notebook_with_sidebar.py, the sidebar navigation works as expected.
However, if I start Marimo with marimo edit . and then open the same notebook from the file browser, clicking the sidebar navigation buttons redirects me to the Marimo edit homepage (the file browser), instead of navigating within the notebook.
If I open the notebook directly with marimo edit notebook_with_sidebar.py, the sidebar navigation works correctly.

Steps to reproduce

  1. Create a notebook with a sidebar and navigation using mo.sidebar and mo.routes.
  2. Start Marimo with marimo edit .
  3. Open the notebook from the file browser.
  4. Click any sidebar navigation button.
  5. Observe that it redirects to the edit homepage instead of navigating within the notebook.

Expected behavior
Sidebar navigation should switch between pages within the notebook, not redirect to the edit homepage, regardless of how the notebook is opened.

Environment

Marimo version: 0.17.7
OS: Windows 11 25H2
Python version: 3.11.3 (managed by uv)
Browser: Microsoft Edge

Will you submit a PR?

  • Yes

Environment

Replace this line with the output of marimo env. Leave the backticks in place.

Code to reproduce

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions