Skip to content

fix(setup): "Everything is set up" shows once per admin, remembered on the server. CU-17tkuw61bjx - #766

Merged
romanivan-flamingo merged 4 commits into
mainfrom
fix/setup-wizard-seen-once
Nov 3, 2026
Merged

romanivan-flamingo merged 4 commits into
mainfrom
fix/setup-wizard-seen-once

Conversation

@romanivan-flamingo

@romanivan-flamingo romanivan-flamingo commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Frontend part of Setup wizard: show "Everything is set up" only on an admin's first login (FE subtask 17tkuw61bjx).

Why

The wizard's last screen kept coming back for an admin whose workspace was already set up. The only lasting record that the admin had been through it was the Mingo conversation the panel creates after "Start with Mingo" (tourDialogId), and the handoff marker lives in one browser's localStorage. Another browser or device, cleared browser data, or a tour that never got started brought the screen back.

What changes

  • userOnboardingProgress.setupSeen (new on the BE) is the lasting record. The progress query and every user onboarding mutation select it; the onboarding store carries it.
  • The /setup wizard records its last screen ("You are ready to go" / "Everything is set up") as seen the moment it shows, through the new markUserOnboardingSetupSeen mutation (fire-and-forget, idempotent on the server). On display rather than on the button: an admin who leaves the screen another way has seen it too.
  • useSetupPending sends a session to /setup only while the server has not seen the admin there (on top of today's tourDialogId and local-marker checks, which cover records from before the flag existed and the moment right after the button).
  • OnboardingV2Redirect: the way out of /setup is decided once per visit, when the answer first lands, so the seen record landing mid-visit does not throw the admin off the screen before "Start with Mingo". Leaving the wizard stays the wizard's own job; the way in from the dashboard stays live for "Reset Onboarding".
  • "Reset Onboarding" is offered to an admin who saw the screen without starting the tour; the reset clears the record on the server, so the screen shows once more.

Tests

New: use-setup-pending.test.tsx (the rule), onboarding-v2-redirect.test.tsx (both legs, the once-per-visit decision), setup-wizard.test.tsx (the mark on each last screen, once). Extended: reset-onboarding-dialog.test.tsx (useCanResetOnboarding), use-onboarding-mutations.test.tsx (the mark mirrors into the store). 81 tests across the onboarding/setup files pass; type-check, lint:ci, format and check:loading are green.

Verified on the BE feature tenant (tenant-4305-18)

Dev "Skip onboarding" leaves setupSeen true (BE side effect); after a reset the dashboard sends the admin to "Everything is set up", the mark lands on display and the admin stays on the screen; a browser without local markers opens on the dashboard and a direct /setup returns there; "Reset Onboarding" from the Mingo menu brings the screen back once with a fresh stamp; "Start with Mingo" opens the tour, records tourDialogId and keeps the earlier stamp.

Rollout

Needs the BE on the environment first: the progress query selects setupSeen, and an unknown field fails the whole query, which hides the wizard entirely. Order: oss-lib release, saas-tenant release (dev, then QA), then this FE release.

Change-Set: fix-setup-wizard-seen-once
Depends-On: https://github.com/flamingo-stack/openframe-saas-tenant/pull/4305
Depends-On: flamingo-stack/openframe-oss-lib#2892

Change set flamingo-stack/openframe-oss-frontend#766: this pull request is the only one in it so far. Another pull request joins by naming this one in a Depends-On line, or by carrying the same Change-Set line.

Linked work

  • …and 1 linked item not shown here

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

…n the server. CU-17tkuw61bjx

The wizard's last screen kept coming back for an admin whose workspace was
already set up: the only lasting record that the admin had been through it was
the Mingo conversation the panel creates after "Start with Mingo", and the
handoff marker lives in one browser's localStorage. Another browser or device,
cleared browser data, or a tour that never got started brought the screen back.

The server now keeps `userOnboardingProgress.setupSeen`: the wizard records
its last screen ("You are ready to go" / "Everything is set up") as seen the
moment it shows, `useSetupPending` keeps a session away from `/setup` once the
server has seen it, and the way out of the wizard is decided once per visit,
so the answer landing mid-visit does not throw the admin off the screen before
"Start with Mingo". "Reset Onboarding" clears the record and is offered to an
admin who saw the screen without starting the tour.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@romanivan-flamingo
romanivan-flamingo requested review from a team as code owners October 30, 2026 14:47
@michaelassraf

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦩 Flamingo Code Review

✅ Tests and checks passed on this commit (3 lanes).

✅ No findings on the current head.

Advisory: findings do not block the merge.

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
25 +644 / -29 0 0 0

✅ What this change does well

  • setup-wizard.tsx's effect at line 161-164 guards the markSetupSeenInBackground call with setupUnseen so the idempotent mutation is still only fired once client-side per session, matching the test coverage in setup-wizard.setup-seen.test.tsx.
  • onboarding-v2-redirect.tsx's decidedFor ref (lines 34-46) carefully prevents the redirect from bouncing the admin off the wizard's last screen mid-visit when setupSeen flips server-side, and the accompanying onboarding-v2-redirect.test.tsx pins this exact behavior with a dedicated test case.
  • The schema.graphql docstring updates clearly describe the new setupSeen/setupSeenAt semantics and their idempotency, keeping the GraphQL contract well documented for consumers.
  • use-onboarding-mutations.ts's markSetupSeenInBackground follows the existing fire-and-forget pattern (toast on error, setUser on success) consistently with the sibling mutations in the same file.
  • onboarding-store.ts documents the new setupSeen field's semantics and lifecycle (cleared by Reset Onboarding) directly in the JSDoc, matching the file's existing documentation style.
1 possible problem checked and ruled out
  • apps/web/src/graphql/onboarding/complete-user-onboarding-mutation.ts:3 8 new or changed definitions have no test referencing them: These are declarative relay graphql string definitions (mutations/queries) and a state type, not logic; missing tests for them is boilerplate and the PR also adds dedicated test files for related onboarding hooks/components, so this is not worth a comment.

Review again. New commits are not reviewed until you ask:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

🧪 Tests and mutation

Tests per lane

Language Project Command Status Counts Time
TypeScript (npm) apps/web npx vitest related --run 'src/app/(app)/mingo/tour/use-mingo-tour.test.tsx' 'src/app/(app)/settings/components/profile-card.test.tsx' 'src/app/(app)/setup/components/setup-wizard.setup-seen.test.tsx' ✅ passed 347 run, 0 failures 112.9 s

Checks

Check Kind Language Project Status Time
lint:ci lint TypeScript (npm) apps/web ✅ passed 52.4 s
check:loading lint TypeScript (npm) apps/web ✅ passed 4.6 s

1 gap (not tested here):

  • TypeScript (npm) apps/web: no mutation testing (no Stryker configured: mutation coverage is a gap to report)

Started 2026-11-03 10:59 UTC · updated 2026-11-03 11:01 UTC · workflow run

@romanivan-flamingo

Copy link
Copy Markdown
Contributor Author

@flamingo-review

…-once

# Conflicts:
#	apps/web/src/app/(app)/settings/components/profile-card.test.tsx
#	apps/web/src/app/(app)/setup/components/setup-wizard.test.tsx
#	apps/web/src/app/components/onboarding-v2-redirect.tsx
@romanivan-flamingo romanivan-flamingo self-assigned this Nov 2, 2026
@romanivan-flamingo

Copy link
Copy Markdown
Contributor Author

@flamingo-review

@romanivan-flamingo
romanivan-flamingo added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit bc37de9 Nov 3, 2026
20 checks passed
@romanivan-flamingo
romanivan-flamingo deleted the fix/setup-wizard-seen-once branch November 3, 2026 11:25
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.

3 participants