The Problem
Every time the server URL changes (new connection, IP change, sender starts), BeamSync generates a QR code. QR generation creates a 220Γ220 PNG with error correction β all on the main JavaScript thread. This blocks the UI for 10-30ms per generation. π±
During network flapping (VPN switching, unstable Wi-Fi), multiple generations queue up and the UI becomes noticeably janky.
Where to Look
desktop/frontend/src/App.svelte β generateQR() at line 508. The QRCode.toDataURL() call is synchronous and CPU-intensive.
- Consider debouncing (don't regenerate if called again within 100ms) or offloading to a microtask.
The Goal
- QR generation should not block the UI
- Debounce rapid URL changes so only the last one triggers a QR regen
- Test: rapidly change the server URL 10 times β UI should stay responsive throughout
The Problem
Every time the server URL changes (new connection, IP change, sender starts), BeamSync generates a QR code. QR generation creates a 220Γ220 PNG with error correction β all on the main JavaScript thread. This blocks the UI for 10-30ms per generation. π±
During network flapping (VPN switching, unstable Wi-Fi), multiple generations queue up and the UI becomes noticeably janky.
Where to Look
desktop/frontend/src/App.svelteβgenerateQR()at line 508. TheQRCode.toDataURL()call is synchronous and CPU-intensive.The Goal