feat(session): add ?autoVoice=1 deep-link param to auto-start realtime voice#1412
Open
averymkeller83-hub wants to merge 1 commit into
Open
feat(session): add ?autoVoice=1 deep-link param to auto-start realtime voice#1412averymkeller83-hub wants to merge 1 commit into
averymkeller83-hub wants to merge 1 commit into
Conversation
Lets external automations (Siri Shortcuts, push notifications, custom URL schemes, etc.) open a session and start the realtime voice assistant in one step instead of requiring a manual mic tap. - Switch session/[id] route to expo-router's useLocalSearchParams so query-string params can be read alongside the path param. - Thread an autoVoice prop through SessionView -> SessionViewLoaded. - When the prop is true and the realtime layer is idle, fire the existing handleMicrophonePress() exactly once on mount. Usage: happy://session/<sessionId>?autoVoice=1 https://app.happy.engineering/session/<sessionId>?autoVoice=1
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.
Summary
Adds an opt-in
?autoVoice=1query param to the session route so external automations can open a session and start the realtime voice assistant in a single step.Before this PR: a deep-link can land you on
session/<id>, but the voice session still requires a manual mic tap.After:
happy://session/<id>?autoVoice=1(or the universal-link equivalent) lands you straight into voice mode.Why
This unlocks a class of integrations that were previously two-tap:
The param is opt-in: existing links and the in-app session opener behave exactly as before.
Implementation
session/[id].tsx: switch from@react-navigation/native'suseRoutetoexpo-router'suseLocalSearchParamsso we can read both the path param (id) and the query string (autoVoice). Per the project CLAUDE.md ("Always use expo-router api, not react-navigation one"), this also brings this route in line with the rest of the codebase.SessionView.tsx: thread an optionalautoVoice?: booleanprop throughSessionView→SessionViewLoaded.useEffectinSessionViewLoaded, gated by auseRef, fireshandleMicrophonePress()exactly once on mount and only whenrealtimeStatus === 'disconnected'— so it never racing-stacks against an already-connecting/connected session.Accepts
autoVoice=1andautoVoice=true; everything else (including absent) is a no-op.Test plan
pnpm typecheckcleanhappy://session/<id>?autoVoice=1from Siri Shortcut → voice connects without tapping the michttps://app.happy.engineering/session/<id>?autoVoice=1on web → samehappy://session/<id>(no param) → unchanged behavior, no auto-mic🧙 Built with WOZCODE