Skip to content

Add a setup window that checks for claude and gh on first launch - #78

Merged
m4rocks merged 3 commits into
mainfrom
setup-window
Oct 28, 2026
Merged

m4rocks merged 3 commits into
mainfrom
setup-window

Conversation

@m4rocks

@m4rocks m4rocks commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

launch
  no state file  -> setup window -> Continue -> main window (claude path saved)
  state file     -> main window
Settings "Check setup" / missing-claude toast -> the same window, Close never blocks
every check: platform::reload_path() -> claude::discover + gh auth status
  • New src/app/setup.rs holds the window. main.rs opens the main window through open_main_window.
  • platform::reload_path reads the PATH again before each check. Windows reads the registry. macOS runs the login shell and reads its PATH between markers, with a 5 second limit.
  • github::cli gets AuthState, Gh::auth_status and check_auth. Store::is_first_launch decides whether the window shows.
  • The GitHub pane's sign-in code moved into sign_in_to_github so both windows share it.

The branch also carries two commits that are not part of #57: the project instructions in CLAUDE.md, and an ellipsis for the top bar's folder path.

Evidence

Before the fix, a test for closing the reopened window failed. The Done event never reached the main window, so a path typed there was lost:

assertion `left == right` failed: the window's Done reached its listener before the window went
  left: 0
 right: 1

After: 251 tests pass, 17 ignored. I also drove the debug build on Windows through first launch, the path field, Continue, Settings > Check setup, signing in, and Close. The maintainer checked the missing claude and gh states by hand with a temporary switch, which is removed in this PR.

Not run: anything on macOS. CI runs the tests there for this PR.

Risk

Easy to undo. It adds a window and a few functions, and the only saved setting it touches is claude_path. Existing users already have a state file, so they never see the window.

The macOS login-shell code has not run on a Mac. It starts an interactive login shell on every check and gives up after 5 seconds, leaving the PATH as it was. The Windows reload changes this process's PATH with set_var, which std documents as safe on Windows.

Refs #57

The project instructions now say the maintainer decides every real choice, with a recommendation and the reason, and that new code takes the shape of similar existing code.
A fresh install opens a setup window before the main window. It lists claude (required) and gh (optional), says whether each is found, and links to their install pages. Continue stays off until claude is found. Nothing is installed.

Settings has a Check setup button, and the missing-claude toast offers the same window again. Every check first reads the PATH again, from the registry on Windows and from the login shell on macOS, so a tool installed since Claudiu started is found without a restart.

The window gives its claude path back to the main window, which saves it. The Done event is delivered before the window is removed, so a path typed in a reopened window is not lost.

Refs #57
@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
claudiu Ready Ready Preview Oct 27, 2026 11:13am UTC

@m4rocks
m4rocks merged commit a892a4e into main Oct 28, 2026
4 checks passed
@m4rocks
m4rocks deleted the setup-window branch October 28, 2026 06:46

This branch was successfully deployed

1 active deployment
Preview — d1a404f7 Deployed Oct 27, 2026 by vercel[bot]
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