Skip to content

refactor: solid modes notice (@fehmer)#7964

Draft
fehmer wants to merge 25 commits into
masterfrom
feature/solid-modes-notice
Draft

refactor: solid modes notice (@fehmer)#7964
fehmer wants to merge 25 commits into
masterfrom
feature/solid-modes-notice

Conversation

@fehmer
Copy link
Copy Markdown
Member

@fehmer fehmer commented May 18, 2026

fixes #7961

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label May 18, 2026
@Miodec Miodec requested a review from Copilot May 20, 2026 19:22
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TestModesNotice with 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.getLocalPB synchronous 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>
Comment thread frontend/src/ts/components/test/modes-notice/TestModesNotice.tsx
Comment thread frontend/src/ts/components/test/modes-notice/TestModesNotice.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modes notice for last10 average not updating

4 participants