Skip to content

feat(ui): first-run setup screen and server connect form - #1757

Open
rigel-mintaka wants to merge 4 commits into
mainfrom
compass-native/rig-4564-setup-screen
Open

rigel-mintaka wants to merge 4 commits into
mainfrom
compass-native/rig-4564-setup-screen

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This implements T-4 of docs/designs/ui/compass-native-server-url-entry/design.md: the first-run setup screen and the server connect form. It codes against the Go method names and JSON shapes the record fixes. The Go side lands in T-2b and T-3, so the screen is unreachable until T-3 sets the setup mode.

  • shell-globals.ts: ShellMode gains setup and reopen.
  • daemon-transport.ts, still the only @wailsio/runtime importer:
    • shellConnect sends {token} or {token, server};
    • ConnectResult gains invalid-url, invalid-ca and an optional serverUrl; today's Go result omits it until T-2b;
    • new pickCACert, chooseEmbedded, shellState, onSetupDecided and quitApp;
    • a malformed response frame becomes an RPC error and unsubscribes, so the pending fetch rejects. A head status must be 200–599; null-body statuses (204, 205, 304) get no body stream.
  • New boot-setup.ts:
    • two choices: run on this computer, or connect to a server;
    • it subscribes to setup:decided, then reads shellState; it hands off to the configured client or shows the neutral reopen screen;
    • the listener survives this window's failed or refused attempts;
    • a sibling decision aborts an idle connect form. A connect call in flight finishes first, and its own ok wins;
    • a rejected shell call (chooseEmbedded, shellConnect, shellState, pickCACert) leaves a retryable screen. A decision that arrives during a failed or stale state read is kept and retried;
    • a sibling client decision sets the live server URL before the configured hand-off.
  • boot-native.ts setup entry: editable URL, CA picker with "Use system trust" (a cancelled dialog keeps the pick), and no auto-probe. Server messages render via textContent. A setup ok must carry serverUrl, and the provider is built from it; the form is cleared on success. The configured entry is unchanged.
  • boot-mode.ts routes setup to bootSetup and reopen to the neutral screen.

Verification

  • Targeted bun test (boot-native, boot-setup, boot-mode, shell-globals, daemon-transport, daemon-transport.wails): 87 pass, each test written red first. Each T-4 test-cycle bullet maps to a case, including:
    • abort while idle;
    • abort mid-call with a non-ok result;
    • abort mid-call with an ok result;
    • rejection then retry for each shell call;
    • a decision during a failed state read.
  • moon run compass-ui:typecheck: pass. biome check on the changed files: clean.
  • compass-ui:test (full): pass in CI.
  • Review: three rounds plus a confirmation pass. All high and medium findings are fixed; one low remains (cover 205 and 304 as well as 204).

Risks

Medium. These are new async UI state transitions, but no current launch path reaches them, so existing users see no change. Rollback: revert.

Compatibility

shellConnect callers that send only a token are unchanged. The new bound methods need the Go side from T-2b and T-3.

Documentation

None here. User-facing docs land in T-5.

Refs RIG-4564

Adds bootSetup with the embedded and connect choices. It follows
other windows' decisions via setup:decided plus shellState, keeps its
listener across failed attempts, and aborts an idle connect form when
a sibling decides. bootNativeClient gains a setup entry: editable URL,
CA picker, no auto-probe, and the provider built from the connected
URL. The transport adds pickCACert, chooseEmbedded, shellState and
quitApp; shell modes gain setup and reopen.

Refs RIG-4564

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Oct 5, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@linear-code

linear-code Bot commented Oct 5, 2026

Copy link
Copy Markdown

RIG-4564

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-4564-setu.compass-eng-docs.pages.dev

Deployed from compass-native/rig-4564-setup-screen at c7247c1.

rigel-mintaka and others added 3 commits October 5, 2026 23:35
Accepts today's ConnectResult without serverUrl and falls back to the
submitted URL. A rejected chooseEmbedded, shellConnect, shellState or
CA pick leaves a retryable screen; a sibling client decision sets the
live server URL before handoff; setup success clears the form; state
reads re-check active work; reopen shares one renderer; a cancelled CA
dialog keeps the selection.

Refs RIG-4564

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…ures

An invalid Wails response frame becomes an RPC error and unsubscribes,
so the pending fetch rejects; head status must be 200-599 and omitted
optional fields are accepted. A setup success without serverUrl is a
retryable failure. Queued sibling decisions and error messages survive
failed or deferred state reads; the configured retry form handles a
rejected connect locally.

Refs RIG-4564

Co-authored-by: Matt Wilkinson <matt@rigel.build>
A sibling decision that arrives during a state read which then fails is
retried with the error kept on screen. A decision queued by a stale read
also aborts an idle connect form. A 101/103/204/205/304 head builds a
Response with no body, which the constructor otherwise rejects.

Refs RIG-4564

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 6, 2026 06:55

This branch has not been deployed

No deployments
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