Skip to content

fix(voices): apply settings-page voice changes to host menus immediately (#475)#477

Merged
rosscado merged 1 commit into
mainfrom
fix/475-voice-selection-sync
Jul 2, 2026
Merged

fix(voices): apply settings-page voice changes to host menus immediately (#475)#477
rosscado merged 1 commit into
mainfrom
fix/475-voice-selection-sync

Conversation

@rosscado

@rosscado rosscado commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Why

Founder tasting feedback on Patch A (#470): pick Lucy in the settings Voices catalog while claude.ai is open — the next utterance is Lucy's voice, but the host page's voice button keeps saying "Cassidy" until some later repopulate.

What

The plumbing already existed: the settings page persists voicePreferences to chrome.storage.local, and PreferenceModule's storage.onChanged listener relays it into the host tab as a userPreferenceChanged EventBus event (src/prefs/PreferenceModule.ts:445). Nothing on the menu side listened.

  • VoiceSelector now subscribes (registerVoicePreferenceChangeHandler): on a voice-preference event addressed to this chatbot, it re-reads the stored voice through the preference module (cache already updated) and calls a new applySelectedVoice hook.
  • Base behavior (Pi's button grids): re-mark the matching row, unmark the rest; if the shortlist cap is hiding the voice, pin it for the next populate; a cleared preference unmarks the SayPi rows.
  • ClaudeVoiceMenu override: updates the trigger label, active-state icon, and row checkmarks via the existing updateSelectedVoice, pinning shortlist-hidden voices so the row appears on next open.

No repopulate happens on this path, so the open-menu teardown guard from #470 is preserved — an open menu is never rebuilt under the user.

Tests (fail-first)

New test/chatbots/VoiceMenu-preference-sync.spec.ts (4 tests): Claude label+checkmark update on the event, cross-chatbot events ignored, cleared preference handled, Pi grid re-marking. All failed before the fix (no handler existed); full npm test gate green after, re-run post-rebase onto the #476 merge.

Closes #475

🤖 Generated with Claude Code

https://claude.ai/code/session_012DZR4Vp9B1RiKVrkfYiM1o

…ely (#475)

Picking a voice in the settings catalog switched TTS at once (the
preference cache updates on the storage write) but the host page's
selector kept showing the old voice until its next repopulate.
PreferenceModule already relays the storage change into the tab as a
userPreferenceChanged event carrying voicePreferences — the selectors
just never listened. VoiceSelector now subscribes and applies the
re-read stored voice in place: Claude updates its trigger label +
checkmarks (and pins a shortlist-hidden voice for the next populate);
the Pi button grids re-mark the selected row. No repopulate, so an
open menu is never torn down.

Closes #475

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DZR4Vp9B1RiKVrkfYiM1o
@rosscado rosscado merged commit 8891c0e into main Jul 2, 2026
2 checks passed
@rosscado rosscado deleted the fix/475-voice-selection-sync branch July 2, 2026 21:36
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.

Host-page voice menu is slow to reflect a voice chosen in the settings catalog

1 participant