Fix badge hover spam - remove loadStatus() on mouseenter

Root cause:
- onmouseenter was calling loadStatus() which enumerates ALL devices
- loadStatus() calls: get_audio_output_devices (12 devices), get_pipewire_sinks, get_hardware_audio_status
- Each hover triggered 3 expensive backend calls + CPAL/ALSA enumeration
- User reported "spam masivo en la consola" when hovering badge

Solution:
- Removed loadStatus() call from onmouseenter (line 180)
- Only set isHovering = true to show tooltip
- Polling interval (1s) already keeps hardware status fresh
- Tooltip now shows cached data instead of triggering new enumeration

Impact:
- Hover now instant with zero backend calls
- Console spam eliminated
- Battery/CPU usage reduced significantly
- Tooltip still shows current data via 1s polling
This commit is contained in:
vicrodh committed 2026-01-19 12:06:21 -06:00
1 parent 282edfb206
commit 0c3ca16550
1 file changed
+1 -1
+1 -1
View File
@@ -177,7 +177,7 @@
<div <div
class="audio-badges" class="audio-badges"
onmouseenter={() => { isHovering = true; loadStatus(); }} onmouseenter={() => isHovering = true}
onmouseleave={() => isHovering = false} onmouseleave={() => isHovering = false}
> >
<!-- DAC Badge or HW Badge (mutually exclusive) --> <!-- DAC Badge or HW Badge (mutually exclusive) -->