M007 S01: DEFAULT_OPENINGS defined but never seeded — first-time users see empty list #5

Closed
opened 2026-05-15 19:19:28 +00:00 by Mark · 1 comment
Owner

Severity: MEDIUM
File: src/data/openings.ts:134-158

Problem

Two default openings ("Pressure Start" and "Execution Setup") are defined as DEFAULT_OPENINGS but never imported or seeded into localStorage. When a first-time user opens the Openings browser, loadOpenings() returns [] from empty localStorage and they see "No openings saved yet."

Fix

In src/data/openings.ts, export DEFAULT_OPENINGS. In src/pages/CasualDuel.tsx or the opening initialization path, call something like seedDefaultOpenings() on first use that writes the defaults if localStorage is empty.

Alternatively, loadOpenings() could automatically seed defaults before returning when the store is empty.

**Severity:** MEDIUM **File:** src/data/openings.ts:134-158 ## Problem Two default openings ("Pressure Start" and "Execution Setup") are defined as `DEFAULT_OPENINGS` but never imported or seeded into localStorage. When a first-time user opens the Openings browser, `loadOpenings()` returns `[]` from empty localStorage and they see "No openings saved yet." ## Fix In `src/data/openings.ts`, export `DEFAULT_OPENINGS`. In `src/pages/CasualDuel.tsx` or the opening initialization path, call something like `seedDefaultOpenings()` on first use that writes the defaults if localStorage is empty. Alternatively, `loadOpenings()` could automatically seed defaults before returning when the store is empty.
Author
Owner

Unblocking — lint gate now passes clean (47dfc01).

Unblocking — lint gate now passes clean (47dfc01).
Mark closed this issue 2026-05-16 17:23:30 +00:00
Sign in to join this conversation.
No description provided.