Skip to content

fix(hud): show the dictation HUD with the press and leave with the paste - #3090

Merged
kitlangton merged 1 commit into
devfrom
fix-hud-appear-delay
Nov 29, 2026
Merged

kitlangton merged 1 commit into
devfrom
fix-hud-appear-delay

Conversation

@kitlangton

Copy link
Copy Markdown
Collaborator

The dictation HUD comes up with the press and leaves with the pasted text.

Before: dictation.start waits until the microphone has delivered audio through the press (drain_through, bounded at 100 ms). Only then did the listener tell the HUD Started, so the HUD's first frame waited on the microphone's input latency. On the way out, a 200 ms processing floor kept the HUD fully shown well after a fast paste.

After: the HUD and the Caps Lock light hear Started before the start waits on audio, and a start the microphone refuses sends Discarded to take them back down. Done begins the moment the job completes. The processing floor is gone, along with the Completing state and working_since. The blue still shows, since done keeps the cool colour.

press -> Started -> [wait for audio through the press] -> accepted?   no -> Discarded
release -> Processing -> job done -> Done (100 ms) -> fade

Measured on macOS. Microphone lag is the time from captured_through to delivery, read from cpal callbacks. HUD timings come from IndicatorModel stepped at 60 Hz.

before after
Start wait before Started, USB display mic (51.8 ms lag, 10.7 ms buffer) 52 to 62 ms 0
Start wait before Started, Bluetooth earbuds (30 ms lag, 20 ms buffer) 30 to 50 ms 0
HUD fully shown after an 84 ms paste 216 ms 116 ms
Opacity below 50% after release 367 ms 267 ms
Opacity below 5% after release 517 ms 417 ms

The other hops were measured too, and none of them is a bottleneck. wake_pump goes through a winit proxy event, not the 250 ms idle timer. The macOS panel stays prewarmed and keeps its surface. Rune's first frame after an idle period already steps 50 ms, so it shows at 28% opacity. The listener's 20 ms audio wait still delays reading key events by up to one audio buffer. This PR leaves that alone.

New tests: the_hud_hears_the_press_before_the_start_waits_on_audio, a_refused_start_takes_the_hud_back_down, the_hud_leaves_with_the_pasted_text.

Read: scripts/check passes for rune_hud (82), dictation::indicator (13), onboarding_kit (124), caps_lock (33) and capture_actions (2); clippy and code-shape.py are clean. In scripts/check macos_rune, 24 of 25 tests pass. The one failure, the_menu_reads_upcoming_then_meetings_then_actions_then_the_app ("Paste Last" vs "Paste Last Dictation"), also fails on dev without this change.

@kitlangton
kitlangton merged commit 6244a1b into dev Nov 29, 2026
4 checks passed
@kitlangton
kitlangton deleted the fix-hud-appear-delay branch November 29, 2026 09:35
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.

1 participant