Files
phokus/src/dev/mockScenarios.ts
T
LyAhn aa3fe2062d
github/actions/ci GitHub Actions CI finished: success
feat(ui-lab): add first-run and update scenarios
Add separate UI Lab scenarios for true first-run onboarding and post-update What's New checks. Keep empty-library fixtures reusable across mock data, tagger readiness, worker pause defaults, and launch-time version state so browser verification can exercise the real flows.
2026-07-04 21:41:34 +01:00

42 lines
1.0 KiB
TypeScript

export type MockScenario =
| 'rich'
| 'empty'
| 'busy'
| 'duplicates'
| 'album'
| 'errors'
| 'huge'
| 'extreme'
| 'unready'
| 'joytag-unready'
| 'new-user'
| 'just-updated'
const SCENARIOS = new Set<MockScenario>([
'rich',
'empty',
'busy',
'duplicates',
'album',
'errors',
'huge',
'extreme',
'unready',
'joytag-unready',
'new-user',
'just-updated',
])
// Scenarios that start with no folders or media. 'empty' is a bare library
// with onboarding already behind it; 'new-user' is the true first run and
// additionally opens the onboarding tour with no tagger model downloaded.
export function isEmptyLibraryScenario(scenario: MockScenario): boolean {
return scenario === 'empty' || scenario === 'new-user'
}
export function getMockScenario(): MockScenario {
if (typeof window === 'undefined') return 'rich'
const value = new URLSearchParams(window.location.search).get('scenario')
return value && SCENARIOS.has(value as MockScenario) ? (value as MockScenario) : 'rich'
}