Skip to content

feat: replace single microphone selector with prioritized device list#1070

Open
i-kozlov wants to merge 2 commits intocjpais:mainfrom
i-kozlov:prioritized-microphone-devices
Open

feat: replace single microphone selector with prioritized device list#1070
i-kozlov wants to merge 2 commits intocjpais:mainfrom
i-kozlov:prioritized-microphone-devices

Conversation

@i-kozlov
Copy link
Copy Markdown

@i-kozlov i-kozlov commented Mar 16, 2026

Before Submitting This PR

Human Written Description

I have a USB microphone connected through a docking station, but it is not set as the default device. Setting it as default is not very useful because connecting AirPods always overrides the default input device.

Because of this, I cannot use the "use system default input" setting. At the same time, I also cannot configure this USB microphone as the fixed input device for Handy, because the docking station may be disconnected, which would make the microphone unavailable.

What I would like instead is the ability to set this USB microphone as a priority device, with an automatic fallback to the MacBook built-in microphone if the USB microphone is not available.

Related Issues/Discussions

Discussion: #1069

Community Feedback

See discussion: #1069

Testing

  • Verified migration: existing selected_microphone setting is automatically moved to position 0 of the new prioritized_microphones list on first launch
  • Tested priority fallback: with two devices in the list, disconnecting the first causes Handy to use the second
  • Tested empty list: removing all prioritized devices falls back to system default (same behavior as before)
  • Tested clamshell override (macOS): clamshell_microphone still takes priority over the list when lid is closed

Screenshots/Videos

UI with two prioritized devices (first one active):

The settings page now shows two sections:

  • Prioritized Devices — ordered list with Active badge, reorder (↑↓) and remove (—) controls
  • Available Devices — all other detected devices with add (+) button
  • The Active badge refreshes automatically when the settings window regains focus.
CleanShot 2026-03-22 at 10 57 32

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: Used for implementation assistance. The Human Written Description above is my own.

@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 17, 2026

ill check this out when I have time, I think its probably a good change

you didnt give any screenshots though... we need to have good and obvious UI for this, and it's where I am most hesitant to pull in. carefully think about the UI and UX, it needs to be very good to be pulled in.

@i-kozlov i-kozlov force-pushed the prioritized-microphone-devices branch 2 times, most recently from a2b1e3c to 99e634f Compare March 17, 2026 13:03
DylanBricar added a commit to DylanBricar/Phonara that referenced this pull request Mar 20, 2026
- Local OpenAI-compatible API server on /v1/audio/transcriptions (cjpais#509)
- GNOME system shortcuts via gsettings for Wayland (cjpais#572)
- Wake word detection infrastructure with settings (cjpais#618)
- Live transcription mode settings (overlay/clipboard) (cjpais#832)
- Qwen3-ASR engine type placeholder for future transcribe-rs (cjpais#957)
- Prioritized microphone device list with fallback (cjpais#1070)
- Flatpak detection helper (cjpais#548)
- Storybook dev script (cjpais#784)
@i-kozlov i-kozlov force-pushed the prioritized-microphone-devices branch from 99e634f to b9cf377 Compare March 22, 2026 07:13
@i-kozlov
Copy link
Copy Markdown
Author

updated to resolve conflicts

@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 22, 2026

I don't think you reviewed my earlier comment...

@i-kozlov
Copy link
Copy Markdown
Author

my bad. i missed that.
just added screenshot example.
trying to keep UI minimalistic - just + and - to add/remove and arrows to prioritise.

@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 22, 2026

The UI doesn't really fit nicely into the styling of the app. Please consider this. Also consider how other apps have done this

@i-kozlov
Copy link
Copy Markdown
Author

CleanShot 2026-03-22 at 12 10 35 does this one fit? or is it at least looks better?

@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 22, 2026

much better looking imo, ill have a think about this too. im wondering if the ordering is an advanced setting? im not quite sure what the behavior is for this. im not sure how many people will use this, or just certain people. like for myself I wont use it, but I do see the value

@i-kozlov
Copy link
Copy Markdown
Author

Thanks, i think i got the idea now:
My function targets to small auditory and should be opt-in that does not affect default behaviour.
So basically user goes to General->Microphone
In case of multiple microphones
user goes Advanced->Input->Enable feature support.

Defaults should be
CleanShot 2026-03-22 at 15 47 50
CleanShot 2026-03-22 at 15 48 06

When function is enabled it should be like
CleanShot 2026-03-22 at 15 49 03
CleanShot 2026-03-22 at 15 49 26

@i-kozlov i-kozlov force-pushed the prioritized-microphone-devices branch 2 times, most recently from 6e19841 to 649f133 Compare March 22, 2026 15:39
@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 23, 2026

@VirenMohindra curious for some opinions here

I more or less like this directionally @i-kozlov I want to think about it a bit more the exact flow

@VirenMohindra
Copy link
Copy Markdown
Contributor

VirenMohindra commented Mar 25, 2026

yeah me too. i have a couple questions though

  1. the PR description says selected_microphone gets seeded into the priority list on first launch, but there's no code doing this. users who enable the toggle will see an empty list. should auto-populate from their existing mic selection
  2. no tests for the fallback chain, the priority logic in audio.rs has three early-return paths and is the core of the feature. needs at least~
    1. first device unavailable -> picks second,
    2. no priority device available -> falls back to selected_microphone,
    3. feature disabled → original behavior
  3. update all translations, we only did the english one

should also fix these ones if possible~

  • window.addEventListener("focus", refreshAudioDevices) registers even when multi mic is disabled. should be inside the if (enabled) guard.
  • no input validation — set_prioritized_microphones accepts duplicates, empty strings, anything. filter those out please

and some other nits which are non-blocking~

  • add button is hidden from keyboard users because of the opacity-0 group-hover:opacity-100 pattern which means you can't see the (+) button when tabbing. pls add focus:opacity-100

and finally, rebase if you have a sec, will take a closer look!

…ttings

Add Multiple Microphones toggle in Advanced > Input that enables
a prioritized device list with automatic failover. When enabled,
the General > Microphone dropdown is disabled with an inline explanation.

Backend: multi_microphone_enabled and prioritized_microphones fields in
AppSettings, priority-based device selection in audio manager with
fallback chain: clamshell → prioritized → selected_microphone → OS default.
- Auto-seed selected_microphone into prioritized list on toggle enable
- Add input validation in set_prioritized_microphones (filter empty/dupes)
- Guard focus event listener with multi-mic enabled check
- Add focus:opacity-100 for keyboard accessibility on add button
- Add multipleMicrophones translations to all 17 non-English locales
- Extract select_microphone_name() and add 7 unit tests for fallback chain
@i-kozlov i-kozlov force-pushed the prioritized-microphone-devices branch from 649f133 to 1b86455 Compare March 27, 2026 07:43
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.

3 participants