refactor: solid modes notice (@fehmer)#7964
Draft
fehmer wants to merge 25 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the test “modes notice” toward SolidJS + signal-driven state, aiming to fix #7961 where the last10 average notice didn’t update when toggled via command line after reload.
Changes:
- Add Solid
TestModesNoticewith reactive “average” + “pb” notices (live queries). - Move quote/repeat/pace-caret/custom-text indicators into Solid state (
states/test,states/core); delete legacy custom-text-name state. - Make
DB.getLocalPBsynchronous and update call sites; split commandline subgroup key typing.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/ts/ui.ts | Use getCustomTextIndicator() instead of legacy custom-text long flag. |
| frontend/src/ts/types/quotes.ts | New shared Quote/QuoteWithTextSplit types. |
| frontend/src/ts/test/words-generator.ts | Swap quote + repeat state from legacy modules to states/test. |
| frontend/src/ts/test/timer-progress.ts | Use getCurrentQuote() for quote progress length. |
| frontend/src/ts/test/test-words.ts | Remove currentQuote storage from this module. |
| frontend/src/ts/test/test-ui.ts | Stop relying on TestWords.currentQuote; use getCurrentQuote(). |
| frontend/src/ts/test/test-state.ts | Remove repeated/pace-repeat flags from legacy test-state module. |
| frontend/src/ts/test/test-logic.ts | Use Solid signals for quote/repeat/custom-text indicators; update PB lookups. |
| frontend/src/ts/test/result.ts | Use getCurrentQuote() + getCustomTextIndicator(); adjust PB calls for sync DB API. |
| frontend/src/ts/test/practise-words.ts | Set custom-text indicator via states/core. |
| frontend/src/ts/test/pace-caret.ts | Use “Once” result queries; store pace caret WPM in states/test. |
| frontend/src/ts/states/test.ts | Add signals: repeated flags, pace caret WPM, current quote; update long-test effect. |
| frontend/src/ts/states/quote-rate.ts | Rename currentQuote signal to selectedQuote. |
| frontend/src/ts/states/core.ts | Add showCommandLineForConfig + customTextIndicator signal. |
| frontend/src/ts/legacy-states/custom-text-name.ts | Delete legacy custom text name/long tracking module. |
| frontend/src/ts/input/handlers/keydown.ts | Use getCustomTextIndicator() for restart confirmation logic. |
| frontend/src/ts/event-handlers/test.ts | Use CommandlineSubgroupKey typing; use getCurrentQuote() for quote actions. |
| frontend/src/ts/elements/modes-notice.ts | Refactor legacy notice to read new Solid test/core state (still DOM-based). |
| frontend/src/ts/elements/last-10-average.ts | Switch to getUserAverage10Once + getCurrentQuote(). |
| frontend/src/ts/db.ts | Make getLocalPB synchronous. |
| frontend/src/ts/controllers/quotes-controller.ts | Move Quote types import to ts/types/quotes.ts. |
| frontend/src/ts/components/test/modes-notice/TestModesNotice.tsx | New Solid modes notice UI composition. |
| frontend/src/ts/components/test/modes-notice/PbNotice.tsx | New Solid PB notice (local snapshot driven). |
| frontend/src/ts/components/test/modes-notice/Notice.tsx | New reusable notice (button vs div) component. |
| frontend/src/ts/components/test/modes-notice/AverageNotice.tsx | New Solid average notice using live query. |
| frontend/src/ts/components/mount.tsx | Register testmodesnotice mount component. |
| frontend/src/ts/components/modals/ShareTestSettings.tsx | Use getCurrentQuote() for mode2 share string. |
| frontend/src/ts/components/modals/SavedTextsModal.tsx | Replace legacy custom text state with setCustomTextIndicator. |
| frontend/src/ts/components/modals/SaveCustomTextModal.tsx | Set custom-text indicator on save via states/core. |
| frontend/src/ts/components/modals/QuoteRateModal.tsx | Rename currentQuote() usage to selectedQuote(). |
| frontend/src/ts/components/modals/CustomTextModal.tsx | Replace legacy custom text state with customTextIndicator signal. |
| frontend/src/ts/commandline/types.ts | Add CommandlineSubgroupKey + CommandlineListKey unions. |
| frontend/src/ts/commandline/lists/quote-favorites.ts | Use getCurrentQuote() for favorite/unfavorite commands. |
| frontend/src/ts/commandline/lists/bail-out.ts | Use getCustomTextIndicator()?.isLong in bail-out availability. |
| frontend/src/ts/commandline/lists.ts | Strongly type lists map + list keys. |
| frontend/src/ts/commandline/commandline.ts | Use CommandlineSubgroupKey for subgroup override typing. |
| frontend/src/ts/collections/tags.ts | Replace one-shot active-tags getter with useActiveTagsLiveQuery. |
| frontend/src/ts/collections/results.ts | Add useUserAverage10LiveQuery; convert average/daily queries to “Once” variants using active tags. |
| frontend/src/html/pages/test.html | Add Solid mountpoint for testmodesnotice (legacy #testModesNotice still present). |
| <div id="memoryTimer">Time left to memorise all words: 0s</div> | ||
| <div id="layoutfluidTimer">Time left to memorise all words: 0s</div> | ||
| <div id="testModesNotice"></div> | ||
| <mount data-component="testmodesnotice"></mount> |
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.
fixes #7961