refactor: wrap typing page in solidjs (@miodec) - #8438
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Large structural SolidJS migration of a core page with changed init ordering, lazy singletons, and an explicitly incomplete ("no typing for now") scope that warrants human verification.
Review effort: Balanced
Findings: None
What changed in this PR
Converts the test page from static HTML (test.html + test-result.html) to a SolidJS component (TestPage.tsx), while keeping the test internals vanilla ("no typing for now"). Because the page markup now renders on mount rather than existing at import time, module-level DOM refs become lazy and event bindings move to delegation on the static .pageTest wrapper; several singletons (carets, result chart, input listeners) are initialized from TestPage.onMount.
Changes:
- New
lazyQsrhelper + widespread switch fromqsr/qsto lazy refs for test-page elements; carets, result chart, and input listeners now created viainit*()called inTestPage.onMount. - Vanilla click/handlers rewired to
qs('.pageTest')?.onChild(...)delegation (usingevent.childTarget) so they work with Solid-rendered children. mountComponents()moved earlier inindex.ts; test subcomponents consolidated underTestPage;index.htmlmount point replaces the deleted HTML partials.
| File | Description |
|---|---|
utils/dom.ts |
Adds lazyQsr (deferred+cached qsr). |
test/test-ui.ts |
Lazy wordsEl/wordsWrapperEl/resultWordsHistoryEl; moves effect+listeners into init(); delegation bindings. |
test/result.ts |
Legend/favorite handlers switched to .pageTest delegation + childTarget. |
test/replay-ui.ts |
Lazy replayEl; delegation for replay buttons/letters. |
test/caret.ts, test/pace-caret.ts |
Carets created lazily via initElement(). |
test/funbox/*-timer.ts |
qs→lazyQsr timer refs. |
input/listeners/* |
Side-effect modules wrapped in init(); aggregated by initInputListeners(). |
input/input-element.ts |
Lazy #wordsInput lookup. |
controllers/chart-controller.ts |
Result chart created lazily via initResultChart(). |
elements/test-init-failed.ts, elements/caret.ts |
Lazy refs + ElementWithUtils helpers. |
event-handlers/test.ts |
Quote/leaderboard handlers switched to delegation. |
components/pages/test/TestPage.tsx |
New Solid component rendering full test + result markup; onMount wiring. |
components/mount.tsx |
Consolidates test components into TestPage; matches [data-component=...]. |
index.ts |
Moves mountComponents() earlier; drops eager listeners import. |
index.html, html/pages/test*.html |
Static mount div replaces deleted HTML partials. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Also moves all test dom modifications to go through test ui. Some reading still happens outside it.