feat(answer-game): auto-persist config draft on every keystroke
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in InstructionsOverlay and trace the existing onPersistLastSession callback and draftApi.draft.config flow introduced by PR #270. Add debounced persistence for draft changes while preserving the explicit Play-branch writes. Done means edits from both forms survive a refresh, the debounce is at least 300 ms, and playing still persists correctly.
Written by the indexing model from the issue text.
Description
Problem
Before PR #270, usePersistLastGameConfig debounced config writes to saved_game_configs on every keystroke. This meant the panel state survived browser refreshes — the user's last-edited config was restored on next visit.
PR #270 removed the debounce and replaced it with explicit writes only on Play. As a result, edits made in the simple form (or advanced modal) are lost if the user refreshes before playing.
Proposed solution
Re-add lightweight auto-persistence so that saved_game_configs is kept in sync with the current draft as the user edits. Options (in order of preference):
- Debounced write inside
InstructionsOverlay— callonPersistLastSession(draftApi.draft.config)in auseEffectthat watchesdraftApi.draft.config, with a ~500 ms debounce. TheonPersistLastSessioncallback already exists on the overlay; this is purely additive. - Restore a lightweight hook — reintroduce a slim
usePersistLastGameConfig(or rename ituseAutoSaveDraft) that wraps the debounce, and wire it back into the route alongside the explicit Play-branch calls.
Option 1 keeps the logic close to the overlay and avoids re-adding a route-level hook.
Acceptance criteria
- Making a change in the simple form or advanced modal and refreshing the page restores the edited config (not the last-played config).
- Debounce is at least 300 ms to avoid hammering RxDB on every keystroke.
- The explicit Play-branch writes from PR #270 are preserved (no regression).
Context
- PR #270 (config state sync) introduced
useConfigDraftandonPersistLastSession - Issue #254 (parent of #270)
- Issue #271 (confirm on discard — related UX improvement)
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from leocaseiro/base-skill
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
leocaseiro/base-skill#378 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
leocaseiro/base-skill#352 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
leocaseiro/base-skill#301 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
leocaseiro/base-skill#292 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
leocaseiro/base-skill#290 ·
All issues in leocaseiro/base-skill
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100