feat(t100): durable per-device client prefs#12
Merged
Conversation
Dokploy Preview Deployment
|
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.
What
Three web-only client prefs —
qualityTier,inputTransport,latencyHud— moved offlocalStorage(which resets on the iPad PWA) into per-device server ui-state, keyed<base>_<deviceId>(same seam aswebPush/notifMutes, t093/t095). Each web device now keeps its own values and they survive a PWA refresh/reinstall. Also kills a live drift bug wherequalityTierwas double-stored (localStorage vs the global the connector reads).Spec + rationale:
docs/tasks/done/100-durable-per-device-client-prefs.md.How
src/lib/device-prefs.ts(TDD) — the single owner of the plain↔<base>_<deviceId>remap, defaults, parse-guards, and thequalityTierglobal-shadow rule: a tier write also mirrors the plain global key the shared-screencast connector reads, so the connecting device's tier applies to the one shared stream withcore/remote-page-connector.jsbyte-unchanged.core/settings-store.jsDEVICE_KEY_PREFIXESgains the 3 prefixes;cdp-web-transport.tsresolves/remaps them ingetUiState/setUiStateand sources the transport mode from ui-state (bootsauto, reconfigures once when ui-state lands).settings-dialog.tsx/latency-hud.tsx/app.tsxread/write ui-state; the transport-selector's transient last-good probe cache intentionally stays in localStorage (not a durable pref).qualityTierslot falls back to the existing global value → nothing resets on first load after ship.Notes
qualityTierlocalStorage key brokeviewport.tsx's resize reissue (it read that key to preserve the tier onPage.startScreencast, t099). Fixed with a live in-memory tier mirror inquality-tier.ts, seeded from ui-state at boot + on picker change.Tests
typecheck · 1014 unit (+device-prefs 17, quality-tier mirror 3, settings-store 1) · 49 e2e (+2 real-server ui-state round-trip proving persistence + device isolation) · build · biome clean on touched files.
https://claude.ai/code/session_01USyifc9ZK6Cy5hAmKKy2ok