Skip to content

fix: let the CLI auto-open the browser - #284

Open
iabaako wants to merge 1 commit into
mainfrom
fix/cli-auto-open-browser
Open

fix: let the CLI auto-open the browser#284
iabaako wants to merge 1 commit into
mainfrom
fix/cli-auto-open-browser

Conversation

@iabaako

@iabaako iabaako commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Pull Request Summary 🚀

What does this PR do? 📝

Removes --server.headless true from the datasure CLI entry point
(src/datasure/cli.py) so uv run datasure opens the user's default
browser automatically, like plain streamlit run already does.

Why is this change needed? 🤔

Running uv run datasure starts the server but never opens a browser
tab. server.headless is the exact Streamlit setting that suppresses
auto-opening a browser (intended for headless/container deployments).
Nothing in the current source calls webbrowser.open() to compensate,
so this looks like a leftover from an old PyInstaller-packaged build.
It also silently overrode headless = false, which is already set in
both .streamlit/config.toml and src/datasure/.streamlit/config.toml -
CLI flags take precedence over config.toml, so the config's intent was
never honored.

How was this implemented? 🛠️

Deleted the two sys.argv entries "--server.headless", "true" from
cli.py's Streamlit launch args. No other flags changed.

How to test or reproduce ? 🧪

  1. Before this change: uv run datasure starts the server but no
    browser tab opens (must copy the printed localhost URL manually)
  2. After this change: uv run datasure opens the default browser to
    http://localhost:8501 automatically, matching just datasure-dev

Screenshots (if applicable) 📷

N/A (CLI flag change, not a UI change)

Checklist ✅

  • I have run and tested my changes locally
  • I have limit this PR to less than 1000 lines of code change (if not, explain why)
  • I have updated/added tests to cover my changes (if applicable)
  • I have updated/added requirements to cover my changes (if applicable)
  • I have run linting and formatting on any code changes (if applicable)
  • I have updated the documentation (README, etc.) accordingly
  • I have reviewed and resolved any merge conflict

The datasure entry point forced --server.headless true, which suppresses
Streamlit's normal behavior of opening a browser tab on launch. This
looks like a leftover from the old PyInstaller-packaged build (no
webbrowser.open() call exists anywhere in the current source to replace
it), and it overrode the headless = false already set in
src/datasure/.streamlit/config.toml. Dropping the flag restores the
default streamlit run experience: uv run datasure now opens the browser
automatically, matching just datasure-dev.
@iabaako
iabaako requested a review from a team as a code owner August 29, 2026 18:46
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant