fix(frontend): fix no-device default, program role duplication, and auto-join race#618
Open
LucasMaupin wants to merge 3 commits intomainfrom
Open
fix(frontend): fix no-device default, program role duplication, and auto-join race#618LucasMaupin wants to merge 3 commits intomainfrom
LucasMaupin wants to merge 3 commits intomainfrom
Conversation
…on, and auto-join race - Device default bug: first-time users (cleared localStorage) received "no-device" as audioinput, causing 500 errors on join. Add a useEffect in user-settings-form.tsx that resets the field to the real default device once enumeration completes; add a defense-in-depth guard in use-submit-form.tsx that falls back to userSettings.audioinput or "default" when the resolved value is falsy or "no-device". - Program feed UX: remove the role selector (Listener / Audio feed checkboxes) from the join form entirely. ProgramLineJoinCard is now the sole place for role selection, eliminating duplicate state and the associated correctness hazard for first-time users. - Program line auto-join bug: two fixes applied together: (1) calls-page.tsx used pendingProgramLines state in the auto-join effect, which could be stale at the time the effect ran — replaced with a ref (pendingProgramKeysRef) updated synchronously before setPendingProgramLines so the effect always reads the latest value. (2) use-submit-form.tsx unconditionally called initiateProductionCall even for program output lines — added a !selectedLine.programOutputLine guard so program lines are not auto-joined before the user picks a role. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gn WebRTC modal - Add TVIcon next to program output lines in presets-list and manage-presets-list with isProgramOutput purple background - Refactor settings-modal.tsx to use the base Modal component, removing duplicated modal primitives from settings-modal-components.ts - Rewrite generate-whip-whep-url-modal.tsx: single username field, WHIP/WHEP copy buttons, title changed to "WebRTC" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `presetOrder` field to `CallData` and a `sortedEntries()` helper in `use-call-list.ts` so CALLS_STATE_UPDATE and CALL_UPDATE messages always list calls in preset position order rather than insertion order. Build `callIndexMap` in `calls-page.tsx` using the same preset-order sort (keyed by productionId:lineId via `presetOrderMap`) so incoming companion actions (mute, volume, etc.) resolve to the correct call. Remove the duplicate `callIndexMap` effect from `connect-to-ws-button.tsx` that was overwriting the sorted map with insertion order on every state change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
"no-device"as the audio input device ID, causing 500 errors on join. AuseEffectinuser-settings-form.tsxnow resets the field to the real default device once enumeration completes;use-submit-form.tsxadds a defense-in-depth guard that replaces a falsy or"no-device"value withuserSettings.audioinputor"default".ProgramLineJoinCard. Removed it from the join form entirely;ProgramLineJoinCardis now the sole owner of role selection, eliminating the separate state and the correctness hazard for first-time users.calls-page.tsxnow tracks pending program keys in a ref updated synchronously (not in state, which was stale at effect time), anduse-submit-form.tsxskipsinitiateProductionCallfor program output lines so they are never auto-joined before the user selects a role.Test plan
npm test— 140 tests)npm run typecheck)npm run lint)"default"or first enumerated device, not"no-device"initiateProductionCallfires and the call connects normallyProgramLineJoinCardis shown (with role selector), and the line is NOT auto-joined before the user picks Listener or Audio feedProgramLineJoinCardappears with role options🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com