Repository navigation
UI: query-options factories, typed pending actions, useNow, plain shell data, latin woff2 fonts - #164
Merged
Conversation
RikusVanRensburg
force-pushed
the
refactor/RVR/ui-query-pending-fonts
branch
from
November 12, 2026 19:49
8b95430 to
c9abaed
Compare
One factory per resource in queries.ts replaces the query keys and the repeated useQuery calls. The pending store takes a discriminated action per domain, sends through useMutation, and no longer reads the query cache to describe a change. The shell takes plain data: the open page is read from the address, the redirect and the title are computed in render, and first run lands on its page once the server confirms setup. Relative times come from useNow, and the system info is no longer polled. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…I tests fonts.css declares the ten faces itself with the packages' unicode ranges, so the program embeds 10 woff2 files instead of every subset in two formats. The design system sync now stops if the Google Fonts import is spelled another way. pages.test and auth.test are split per page, with their shared fixtures in their own files, and the first run, relative time and no-polling behaviour have tests. docs/decisions.md records the font decision and why the ack idea is not taken. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
RikusVanRensburg
force-pushed
the
refactor/RVR/ui-query-pending-fonts
branch
from
November 12, 2026 19:50
c9abaed to
72793b6
Compare
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.
Closes #158
What changed and why
queries.tshas one factory per resource (settingsOptions()and the rest). Hooks, the live push table, the pending domains and tests take keys from it.query-keys.tsis gone and the literal keys are gone with it.getSystemInfoandgetSystemChecksmoved toapi/system.ts. The activity fetch merges through the query function's ownclient.useNowrenews the time every 30 s.seen()anduptime()take it instead of readingDate.now()in a render. The system info query lost its 60 srefetchIntervaland its redundantstaleTime: it is fetched once and refetched by the push when settings or keys change.usePage,useSyncExternalStore) and changed withgoTo; nothing sets it twice. The redirect for a page the role lacks is computed in render. The phone title comes frompageTitles[page].FrameContextis now{ locked, asideSlot }, no effects and no rebuilt ReactNodes.keyOf,describe,verdictandsend.usePending(name).request(action)marks it pending and sends it as auseMutation; the store no longer reads the query cache and the generics are not erased (the one cast is the cache's untyped data, injudgeCached). The connection secret is the send's input, so it never sits in the store. One fingerprint module (shared/fingerprint.ts): lower case for comparing, upper case only for display.finish()used to move the address before the server confirmed. Now the page and the address leave only on confirmation, and the app lands on Clients (server or both) or Configuration (client). A refused setup stays on the setup page. Tests added for all three. Confirm tests unaffected.--font-sans/--font-monostacks (Segoe UI and system-ui draw all three). Reasoning indocs/decisions.md.fonts.cssnow declares 10 woff2 faces with the packages' unicode ranges.sync-design-system.mjsstops with an error if the Google Fonts import survives its pattern.docs/decisions.md(no wire change).pages.test.tsxandauth.test.tsxare split per page (setup,shell,configuration,login,set-password,change-password,live-gate) with sharedfixtures.tsxandauth-fixtures.tsx.FakeHubwas already gone in UI: one EventSource module with one retry policy #159.One test changed, on purpose
"is redirected to the overview once the loaded role has no such page" asserted that the address becomes
#overview. The issue asks for the redirect in render, so the address is no longer rewritten. The test now asserts that the overview shows, the phone title says Overview and the address is untouched. The test was asserting the old mechanism.Visible change
The phone top bar says "Devices" on both device pages (it said "Devices on lab" and "Devices on this machine"); the page heading is unchanged.
Testing
pnpm --filter koppel.ui typecheck,pnpm --filter koppel.ui lint: clean.pnpm design:sync: generated CSS unchanged.node:24.22.2-bookworm-slim, pnpm 9.15.0:pnpm --filter koppel.ui test12 files, 89 tests passed;pnpm --filter @koppel/react-ui test5 files, 32 passed.Docs
docs/ui.mdanddocs/decisions.mdupdated.Changelog notes: no wire, on-disk or settings change. The embedded UI is about 240 KB smaller (font files). Text in Cyrillic, Greek or Vietnamese in a monospace field now uses the system font.
🤖 Generated with Claude Code