-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(voice): always-on Settings toggle + debug panel + i18n (5/8 of #3307) #3344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
M3gA-Mind
merged 8 commits into
tinyhumansai:main
from
M3gA-Mind:feat/voice-split-5-alwayson-ui
Jun 4, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bf8bc2d
feat(computer): main-thread synthetic-input executor + CEF crash fix
M3gA-Mind b96bd27
feat(accessibility): AX/UIA perception + automate perceive→act→settle…
M3gA-Mind 608f177
feat(agent): wire automate/ax_interact computer tools into the orches…
M3gA-Mind 578846a
feat(voice): Phase 2 always-on listening engine + config + RPC
M3gA-Mind 77003ca
feat(voice): always-on Settings toggle + debug panel + i18n
M3gA-Mind 69e63a6
Merge upstream/main into feat/voice-split-5-alwayson-ui
M3gA-Mind 24b256c
chore: drop stale orchestrator desktop-control prompt from the UI slice
M3gA-Mind d122b82
test(voice): cover always-on toggle (VoicePanel + VoiceDebugPanel); m…
M3gA-Mind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
97 changes: 97 additions & 0 deletions
97
app/src/components/settings/panels/__tests__/VoiceDebugPanel.test.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import { fireEvent, render, screen, waitFor } from '@testing-library/react'; | ||
| import { beforeEach, describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| import { | ||
| openhumanGetVoiceServerSettings, | ||
| openhumanUpdateVoiceServerSettings, | ||
| openhumanVoiceServerStatus, | ||
| openhumanVoiceStatus, | ||
| type VoiceServerSettings, | ||
| type VoiceServerStatus, | ||
| type VoiceStatus, | ||
| } from '../../../../utils/tauriCommands'; | ||
| import type { ConfigSnapshot } from '../../../../utils/tauriCommands/config'; | ||
| import VoiceDebugPanel from '../VoiceDebugPanel'; | ||
|
|
||
| // Key-passthrough i18n + trivial chrome so we can render the panel standalone. | ||
| vi.mock('../../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (key: string) => key }) })); | ||
| vi.mock('../../hooks/useSettingsNavigation', () => ({ | ||
| useSettingsNavigation: () => ({ navigateBack: vi.fn(), breadcrumbs: [] }), | ||
| })); | ||
| vi.mock('../components/SettingsHeader', () => ({ default: () => null })); | ||
|
|
||
| vi.mock('../../../../utils/tauriCommands', () => ({ | ||
| openhumanGetVoiceServerSettings: vi.fn(), | ||
| openhumanUpdateVoiceServerSettings: vi.fn(), | ||
| openhumanVoiceServerStatus: vi.fn(), | ||
| openhumanVoiceStatus: vi.fn(), | ||
| })); | ||
|
|
||
| const SETTINGS: VoiceServerSettings = { | ||
| auto_start: false, | ||
| hotkey: 'Fn', | ||
| activation_mode: 'push', | ||
| skip_cleanup: true, | ||
| min_duration_secs: 0.3, | ||
| silence_threshold: 0.002, | ||
| custom_dictionary: [], | ||
| always_on_enabled: false, | ||
| }; | ||
|
|
||
| const SERVER_STATUS: VoiceServerStatus = { | ||
| state: 'idle', | ||
| hotkey: 'Fn', | ||
| activation_mode: 'push', | ||
| transcription_count: 0, | ||
| last_error: null, | ||
| }; | ||
|
|
||
| const VOICE_STATUS: VoiceStatus = { | ||
| stt_available: true, | ||
| tts_available: true, | ||
| stt_model_id: 'ggml-tiny', | ||
| tts_voice_id: 'en_US', | ||
| whisper_binary: null, | ||
| piper_binary: null, | ||
| stt_model_path: null, | ||
| tts_voice_path: null, | ||
| whisper_in_process: true, | ||
| llm_cleanup_enabled: true, | ||
| stt_provider: 'cloud', | ||
| tts_provider: 'cloud', | ||
| }; | ||
|
|
||
| describe('VoiceDebugPanel — always-on toggle', () => { | ||
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| vi.mocked(openhumanGetVoiceServerSettings).mockResolvedValue({ | ||
| result: { ...SETTINGS }, | ||
| logs: [], | ||
| }); | ||
| vi.mocked(openhumanUpdateVoiceServerSettings).mockResolvedValue({ | ||
| result: {} as unknown as ConfigSnapshot, | ||
| logs: [], | ||
| }); | ||
| vi.mocked(openhumanVoiceServerStatus).mockResolvedValue(SERVER_STATUS); | ||
| vi.mocked(openhumanVoiceStatus).mockResolvedValue(VOICE_STATUS); | ||
| }); | ||
|
|
||
| it('toggles always-on and persists it via the update RPC on save', async () => { | ||
| render(<VoiceDebugPanel />); | ||
|
|
||
| const toggle = await screen.findByTestId('voice-always-on-toggle'); | ||
| expect(toggle).toHaveAttribute('aria-checked', 'false'); | ||
|
|
||
| // Local optimistic flip (creates an unsaved change → enables Save). | ||
| fireEvent.click(toggle); | ||
| expect(toggle).toHaveAttribute('aria-checked', 'true'); | ||
|
|
||
| fireEvent.click(screen.getByText('common.save')); | ||
|
|
||
| await waitFor(() => | ||
| expect(vi.mocked(openhumanUpdateVoiceServerSettings)).toHaveBeenCalledWith( | ||
| expect.objectContaining({ always_on_enabled: true }) | ||
| ) | ||
| ); | ||
| }); | ||
| }); |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.