feat(config): remember that onboarding happened — tui.onboarding (v43) - #220
Open
plombeer31 wants to merge 1 commit into
Open
feat(config): remember that onboarding happened — tui.onboarding (v43)#220plombeer31 wants to merge 1 commit into
plombeer31 wants to merge 1 commit into
Conversation
The first-run flow has no memory. Whether to run setup is re-derived on every launch from `checkLlamaServer()`, so an operator who pressed Esc at the backend picker meets it again on the next start, and the next, for as long as the install lives. Nothing is written when they escape, so there is nothing to read back. Adds `tui.onboarding` — four nullable ISO stamps (`introSeenAt`, `completedAt`, `skippedAt`, `proposedSecondBackendAt`) — plus the `persistOnboardingState` helper and the `decideOnboarding` predicate that reads them. Timestamps rather than booleans so a later release can tell whether an install predates a flow it wants to show again; the caller stamps the instant so tests can write a fixed one. `decideOnboarding` answers from config alone. A backend that is *configured* counts as onboarded even when it is not answering right now — a server that is down is the status bar's problem, not a reason to re-run setup. Nothing consumes the predicate yet; the flow itself follows in the next PR. Additive schema change, so a pre-v43 file parses with four nulls and behaves exactly as before.
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug this removes
The first-run flow has no memory.
runLocalModelsStartupGateIfNeededre-derives "does this user need setup?" on every launch from a health probe, and the Esc branch writes nothing. So an operator who skips the backend picker meets it again on the next launch, and every launch after that — a fresh 10-second gate, forever.What this adds
tui.onboarding(config v43), four nullable ISO-8601 stamps:introSeenAtcompletedAtskippedAtproposedSecondBackendAtPlus:
src/tui/persist-onboarding-state.ts— read → merge → validate → write → reset, same shape as the otherpersist-*helpers. The caller stamps the instant, so tests write a fixed one instead of freezing the clock.src/tui/onboarding/needs-onboarding.ts—decideOnboarding()returns{ needed, reason };needsOnboarding()is the boolean.Timestamps rather than booleans: knowing when a run completed is what lets a later release decide whether an install predates a flow it would like to show again, at the same byte cost.
decideOnboardinganswers from config alone, never a probe. A backend that is configured counts as onboarded even when it is not answering right now — a server that is down is the status bar's problem, not a reason to re-run setup. It reuses the three existing predicates (isCloudTextProviderReady,isManagedModeReadyOnDisk,isLocalBackendConfigured) rather than inventing a fourth definition of "configured".Scope
Nothing consumes the predicate yet — the first-run flow itself is the next PR in the series. This lands alone so the schema bump has its own reviewable diff.
42also joinsSUPPORTED_INPUT_VERSIONS, which the bump would otherwise drop (the list carries the previous versions explicitly and the current one by constant).Compatibility
Additive.
parseUserConfigFilefills absent keys, so a pre-v43 file parses with fournulls and behaves exactly as it does today. No migration code, and a v42 file is still accepted.Tests
config-schema.test.ts— defaults on a v42 file, ISO round-trip, a non-date stamp and a non-object block both rejected.persist-onboarding-state.test.ts— write +getConfig()pickup, merge semantics across two writes, and the rest oftuiuntouched.onboarding/needs-onboarding.test.ts— fresh install opens; completed, skipped, cloud-configured, external-URL and managed-model-picked all stay shut; the shipped default URL nobody chose still counts as unconfigured.Full suite: 5132 passed. The two failures on this machine (
fs-glob-real— a dev-machine path;send-message-concurrency— timing) also fail onmainunchanged.