Skip to content

fix(console): let the mock first-run wizard continue into the console - #205

Merged
Bugs5382 merged 2 commits into
mainfrom
fix/198-mock-firstrun-continue
Oct 16, 2026
Merged

Bugs5382 merged 2 commits into
mainfrom
fix/198-mock-firstrun-continue

Conversation

@Bugs5382

Copy link
Copy Markdown
Contributor

What and why

In mock mode with first run forced open (VITE_FLEET_MODE=mock, VITE_BOOTSTRAP_MOCK_STATE=open), login always acted like a browser holding no certificate, even after the wizard finished or was skipped, because it checked the static env flag instead of the current mock bootstrap state. A reviewer could never get past the operator certificate step.

src/lib/bootstrap.ts gains isMockFirstRunOpen() (read by login in mock mode) and closeMockBootstrap(). Finishing or skipping the admin step (reaching the install step) now calls closeMockBootstrap(), mirroring how a live admin's first authenticated sign-in closes first run for real. The install step's button then signs straight in through the auth context in mock mode instead of reloading the page, since mock mode has no browser certificate for a reload to pick up and reloading would only reset the mock state back to open.

Live mode is untouched: it never reads the mock bootstrap state, keeps the "Reload and sign in" button, and still needs a real operator certificate.

Closes #198

Verification

How this was verified

CI is the proof: Web CI runs lint, the vitest suite (new cases in apps/console/src/context/auth.test.tsx covering mock login while first run is open vs. closed, and in apps/console/src/components/first-run/first-run-wizard.test.tsx covering path A and path B reaching install and then signing in through the console, plus a live-mode check that the reload button is unaffected), and the build, including the release-bundle check (this change adds no mock-fixture markers, so it stays clean). No local build or test was run on this box.

In mock mode with first run forced open, login always acted like a
browser holding no certificate, even after the wizard finished or was
skipped, so a reviewer could never get past the operator certificate
step. Finishing or skipping the admin step now closes mock first run
(closeMockBootstrap), and the install step signs straight in as the
mock admin instead of reloading, which would only reset the mock state
back to open. Live mode is unchanged: it still reloads and still needs
a real operator certificate.

Closes #198

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382 Bugs5382 added this to the v0.1.0 milestone Oct 16, 2026
@Bugs5382 Bugs5382 added the bug Something isn't working. label Oct 16, 2026
@Bugs5382 Bugs5382 self-assigned this Oct 16, 2026
@github-actions github-actions Bot added the fix Bug fix (fix). Patch. label Oct 16, 2026
Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382
Bugs5382 merged commit f312d85 into main Oct 16, 2026
9 checks passed
@Bugs5382
Bugs5382 deleted the fix/198-mock-firstrun-continue branch October 16, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. fix Bug fix (fix). Patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(console): let the mock first-run wizard continue into the console

1 participant