Skip to content

Conversation

marcusrein
Copy link
Member

📦 PR Description

Note: this PR is stacked on top of cli-rename; its base branch is set accordingly.

Why

  • Follow-up to the CLI rename. Users on Arc, Safari, or other default browsers received a crash when running --open.
  • Goal: make hypergraph studio reliably launch the Studio UI in any modern browser, or gracefully fall back to the system default.
  • Requested in Chris’s task list – item Setup staging environment #3 “Fix open browser logic.”

What’s inside

  1. Enhanced browser support

    • apps/typesync/src/subcommands/studio.ts
      • Accepted --browser values expanded to
        chrome | firefox | edge | safari | arc | browser | browserPrivate.
      • Default behaviour (--browser browser or no flag) now defers to the OS handler—works with Arc and future browsers.
      • If a specified browser fails to spawn, we silently fall back to the default browser instead of throwing.
  2. Cross-platform mapping

    • Uses open.apps.* constants for Chrome/Firefox/Edge and explicit names for Safari/Arc.
  3. Type-safe + resilient

    • Added helper mapBrowserName with correct TypeScript types.
    • Build & lint pass (pnpm run build:ts).
  4. README tweak

    • Browser flag docs now list all supported values and updated example.
  5. Manual smoke test

    pnpm run build && pnpm link --global
    hypergraph studio --open                # opens default (Arc ok)
    hypergraph studio --open --browser chrome
    hypergraph studio --open --browser arc
    hg studio --open=false --port 4001      # still works

Breaking change?

None. Existing flags still work; only additional values and graceful fallback were added.


Task list progress

  • 1-2 CLI rename / bin mapping
  • 3 Open-browser logic (this PR)
  • 4 Dev workflow verification
  • 5 useQueryEntity generator
  • 6 Async “wins” bundle
  • 7 Auth / wallet integration

How to test locally

cd apps/typesync
pnpm i
pnpm run build
pnpm link --global
hypergraph studio --open                      # should launch without error
hypergraph studio --open --browser safari     # macOS Safari
hypergraph studio --open --browser browser    # always safe fallback

This PR completes task #3 of the roadmap and ensures a smoother out-of-the-box experience across all modern browsers.

@marcusrein marcusrein self-assigned this Jun 23, 2025
Copy link

vercel bot commented Jun 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hypergraph-connect ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2025 4:09pm
hypergraph-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2025 4:09pm

@marcusrein marcusrein changed the title update README and studio command to support additional browser options fix(cli): add robust browser support for --open flag Jun 23, 2025
Copy link
Collaborator

@nikgraf nikgraf left a comment

Choose a reason for hiding this comment

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

👏

Base automatically changed from cli-rename to main June 24, 2025 19:50
@marcusrein marcusrein merged commit 69ca83b into main Jun 26, 2025
6 checks passed
@marcusrein marcusrein deleted the cli-browser-open branch June 26, 2025 16:26
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.

2 participants