Repository navigation
fix(hud): show the dictation HUD with the press and leave with the paste - #3090
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The dictation HUD comes up with the press and leaves with the pasted text.
Before:
dictation.startwaits until the microphone has delivered audio through the press (drain_through, bounded at 100 ms). Only then did the listener tell the HUDStarted, 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
Startedbefore the start waits on audio, and a start the microphone refuses sendsDiscardedto take them back down. Done begins the moment the job completes. The processing floor is gone, along with theCompletingstate andworking_since. The blue still shows, since done keeps the cool colour.Measured on macOS. Microphone lag is the time from
captured_throughto delivery, read from cpal callbacks. HUD timings come fromIndicatorModelstepped at 60 Hz.Started, USB display mic (51.8 ms lag, 10.7 ms buffer)Started, Bluetooth earbuds (30 ms lag, 20 ms buffer)The other hops were measured too, and none of them is a bottleneck.
wake_pumpgoes 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/checkpasses forrune_hud(82),dictation::indicator(13),onboarding_kit(124),caps_lock(33) andcapture_actions(2); clippy andcode-shape.pyare clean. Inscripts/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 ondevwithout this change.