Add qr code button for mobile enhancement#76
Merged
NathanTarbert merged 6 commits intomainfrom Apr 2, 2026
Merged
Conversation
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.
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.
No description provided.