This commit is contained in:
2026-09-02 10:48:47 +05:30
parent 98712493c4
commit b72bbd2f12
9 changed files with 533 additions and 99 deletions

View File

@@ -49,6 +49,16 @@ export interface SetupStep {
href: string;
/** A real count, when there is one worth showing. */
detail?: string;
/**
* Why a step was already finished before anybody started.
*
* Onboarding creates a tenant, its first branch AND its administrator in
* one transaction, so two of the seven are done before a merchant ever
* signs in. The walkthrough used to leap straight past them, which reads
* as the tour skipping steps by itself. Saying what happened costs one
* line and removes the whole confusion.
*/
doneNote?: string;
/**
* Why this step is worth doing — the consequence of not doing it.
@@ -101,7 +111,7 @@ export function setupSteps(input: SetupInput): SetupStep[] {
gotcha:
"A field left blank is not changed. Saving will never erase something you did not fill in.",
title: 'Complete your shop profile',
todo: 'Add your shop photo and licence — this is what shoppers see.',
todo: 'Add your shop photo, licence and a line about what you sell.',
cta: 'Add your shop details',
done: isProfileComplete(shop ?? {}),
href: '/admin/profile',
@@ -122,6 +132,9 @@ export function setupSteps(input: SetupInput): SetupStep[] {
cta: 'Add a person',
done: people.length > 0,
href: '/admin/users',
...(people.length > 0
? { doneNote: 'Your own account was created when the shop was set up.' }
: {}),
...(people.some(isUnplaced)
? { detail: `${people.filter(isUnplaced).length} not at a shop yet` }
: {}),
@@ -142,6 +155,9 @@ export function setupSteps(input: SetupInput): SetupStep[] {
cta: 'Open a branch',
done: branches.length > 0,
href: '/admin/branches/new',
...(branches.length > 0
? { doneNote: 'Your first outlet was opened when the shop was set up.' }
: {}),
...(branches.length > 0 ? { detail: `${branches.length}` } : {}),
},
{