Skip to content

Add qr code button for mobile enhancement#76

Merged
NathanTarbert merged 6 commits intomainfrom
addQR
Apr 2, 2026
Merged

Add qr code button for mobile enhancement#76
NathanTarbert merged 6 commits intomainfrom
addQR

Conversation

@NathanTarbert
Copy link
Copy Markdown
Contributor

No description provided.

Adds a QR button in the top banner that opens a modal with a scannable
QR code. Audience members scan it, pick from 3 random visualization
options, and the selected prompt is sent to the AI agent on the big
screen.
Prevents stale closure issues when the setTimeout fires after modal
close. Also stops polling immediately after first pick to avoid
duplicate agent runs.
- Move ref updates into effects to satisfy react-hooks/refs rule
- Remove synchronous setState in effects (set-state-in-effect rule)
- Compute non-localhost URL eagerly in usePickUrl initializer
Use a ref-based guard (pickedRef) to ensure sendPrompt is called
exactly once, regardless of effect re-runs or in-flight fetch races.
Also generate a fresh session ID each time the modal opens.
The GET endpoint now clears the prompt from the session after the first
read. Subsequent polls see status "picked" but no prompt, so even if
multiple fetches are in flight only the first one gets the prompt to
send to the agent.
Session ID is now generated on modal open (not mount), so the URL hook
must react to changes. Restructured usePickUrl to derive the URL via
useMemo and only use an effect for the localhost LAN IP fetch.
@NathanTarbert NathanTarbert merged commit f97d1e8 into main Apr 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants