WebRTC LAN/WiFi result sharing#3
Open
techninja wants to merge 3 commits into
Open
Conversation
Owner
Author
|
This needs
|
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's the mutation?
LAN peer sharing ("Family View") — allows a device with scored results to share them with another device on the same network via WebRTC DataChannel. No server, no cloud relay. Pairing uses QR codes: source shows offer QR → viewer scans → viewer shows answer QR → source scans back (or paste fallback). Data streams peer-to-peer.
New files:
src/utils/peer-rtc.js+peer-rtc-shared.js— WebRTC offer/answer/DataChannel (multi-viewer source, single viewer)src/utils/peer-sdp.js— base64url encode/decode full SDP for QR transportsrc/utils/peer-qr.js— QR generation (uqr + logo overlay) and scanning (BarcodeDetector + jsQR fallback)src/utils/peer-protocol.js— request/response over DataChannel with chunked transfer for large payloadssrc/utils/peer-state.js— viewer session state, remote data caching, disconnect handlingsrc/components/molecules/share-source/— settings drawer widget (QR display, webcam scanner, paste input)src/components/molecules/share-viewer/— viewer pairing page (answer QR, copy code, retry)src/pages/pair/pair-view.js— route handler for/pair/:offerdocs/app-spec/LAN_PEER_SHARING.md— full feature specModified files:
src/pages/home/home-view.js— added PairView to router stacksrc/pages/beta/beta-init.js— remote viewer mode detection, reconnect statesrc/pages/beta/beta-view.js— viewer mode UI (read-only, disconnect button, reconnect prompt)src/pages/beta/results-store.js— transparent proxy to remote results when viewingsrc/pages/beta/scoring-controller.js— skip queue in viewer mode, loading state on switchsrc/components/organisms/trait-grid/render-card.js— load emoji from remote individualssrc/components/organisms/settings-drawer/— added "Share Results" sectionsrc/index.html— import map entries for uqr/jsqr, CSS linksscripts/vendor-deps.js— ESM wrapping for UMD depspackage.json— added uqr, jsqr dependencies🔬 Why?
Results are "trapped" in the desktop browser's IndexedDB. Users want to casually browse scores on their phone without re-uploading and re-scoring. This gives them a zero-server, zero-cloud way to view results from any device on the same network — reinforcing the privacy-first message.
🧪 How to test
/beta→ individuals load → trait cards show scored resultspnpm run test:nodepasses📸 Screenshots / recordings
Source settings drawer with QR and viewer count.

🏷️ Type
✅ Checklist
drawer-sections.js(164 lines, +14 from new section) andBarcodeDetectortype (not in TS lib, global API) are the only new violations. Pre-existing: test.js, beta-view.js, beta-view.css.🔮 Reviewer's horoscope
Your WebRTC handshake will complete on the first try today. The STUN server smiles upon you. Do not fear the base64url padding.