feat: implement user-editable SRS tuning settings and corresponding UI#16
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a user-editable SRS tuning system for the vocab quiz, exposing pacing presets and custom configuration in a new /settings page and threading those settings through the quiz API so scheduling/selection logic uses the user’s chosen values (fixing the “words never reach Known” default-tuning issue).
Changes:
- Introduces a typed SRS tuning schema with presets + validation + local persistence, and sends tuning to quiz API via an
x-srs-tuningheader. - Threads tuning through quiz service wiring into the interval mechanism + priority selector, and makes session size configurable.
- Adds a
/settingsUI for editing tuning (plus nav link and docs/task updates).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/vocab-test/settings.ts | Adds SRS tuning model/presets, validation, and localStorage persistence helpers. |
| src/modules/vocab-test/service.ts | Threads tuning into mechanism + selector wiring. |
| src/modules/vocab-test/mechanisms/IntervalMechanism.ts | Retunes default interval config to day-scale defaults so “Known” is reachable. |
| src/modules/vocab-test/components/SettingsPanel.tsx | New client UI for selecting presets, editing tuning, and copying the sheet formula. |
| src/modules/vocab-test/client.ts | Sends x-srs-tuning header on quiz session + result requests. |
| src/components/NavLinks.tsx | Adds top-nav link to /settings. |
| src/app/settings/page.tsx | Adds Settings page route wrapper and layout. |
| src/app/api/quiz/session/route.ts | Reads/validates tuning header; uses tuning session size and threshold. |
| src/app/api/quiz/result/route.ts | Reads/validates tuning header; grades using tuned mechanism. |
| docs/setup-guide.md | Mentions using the in-app Settings page to keep sheet formula in sync. |
| .project/tasks/task-011_expose-srs-tuning-config.md | Adds task spec/log for the implemented tuning feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const save = () => { | ||
| if (parseTuning(draft) === null) { | ||
| notify({ variant: 'error', message: 'Some values are invalid — check the highlighted fields.' }); |
Comment on lines
+126
to
+131
| export function saveTuning(config: TuningConfig): void { | ||
| try { | ||
| localStorage.setItem(STORAGE_KEY, JSON.stringify(config)); | ||
| } catch (error) { | ||
| console.error('Error saving SRS tuning:', error); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.