Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: stable audio device order in tray menu

Louis Beaumont4577ac8a697c
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
index 77e66a580..d60867ca7 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/tray.rs
@@ -438,12 +438,15 @@ fn create_dynamic_menu(
// Show only the audio devices from get_recording_info (the ones
// the user configured in recording settings). User-disabled devices
// stay in the list but show as unchecked.
+ // Sort by name so the order is stable when devices are paused/resumed.
let device_status = get_audio_device_status();
- for device in info
+ let mut audio_devices: Vec<_> = info
.devices
.iter()
.filter(|d| d.kind != DeviceKind::Monitor)
- {
+ .collect();
+ audio_devices.sort_by(|a, b| a.name.cmp(&b.name));
+ for device in audio_devices {
let suffix = if device.kind == DeviceKind::AudioInput {
"input"
} else {