Attempt to fix the rest of speech interrupting when it shouldn't. Also play radio buttons after the ui after they figure out if they are checked or not.

This commit is contained in:
Storm Dragon committed 2026-10-19 19:25:11 -04:00
1 parent 2c6ab2ce76
commit 82887b3897
64 files changed
+501 -225

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
# Speech queue verification
Ordinary output always appends. Cancellation belongs to physical key input,
reader command dispatch and explicit stop requests. An announcement arriving
later from the same action must let earlier speech finish. This includes focus,
selection, state, notification and delayed review output. Accepted Tentacle
speech follows the same rule when its originating focus/session retires;
admission still rejects stale replies and Braille retains its own ownership.
External `SpeakText` announcements also queue regardless of their interrupt
flag; `CancelSpeech` remains an explicit stop request.
Run:
```sh
go test ./internal/app ./internal/input ./internal/speech -count=1
python3 tests/check_speech.py
go build -o /tmp/cthulhu-radio-sound ./cmd/cthulhu
CTHULHU_BINARY=/tmp/cthulhu-radio-sound CTHULHU_PREFS_RADIO_RUNTIME_ONLY=1 /usr/bin/python3 tests/native_preferences.py
```
The required radio-selection test sends Laptop focus and checked-state events
through the event loop and speech worker, with a controlled backend that fails
on an unexpected cancellation. Existing tests cover the cancellation barrier,
Say All, key echo voice ordering, initiating-key timestamps, title repeats,
screen lock, internal UI and Tentacle output. These checks establish software
ordering, without proving audible completion or physical input on a Pi.
The private GTK radio test drives Right/Left between Desktop and Laptop. It
requires one selected sound per move, with the label retained. It uses private
Xvfb, D-Bus and a fake speech server; GStreamer auto audio is restricted to the
fake audio sink in the child reader. It never uses the desktop speech server or
audio devices. Debug sound records identify playback attempts, not audible
output. GStreamer's Python bindings and `fakeaudiosink` are required.
Unchecked radio focus sounds wait up to 250 milliseconds for a following
checked event. That event replaces the pending sound immediately. Speech and
Braille remain immediate, and a radio that stays unchecked gets its original
unchecked cue. Fresh input, changed focus/window, lock and handoff retire the
pending cue. Native state-only snapshots retain the owned mnemonic so a
repeated focus event does not replay the selected sound and label.
Before submission, review the diff and rebuild the reader. Restart the active
reader only with the user's authorization. Then listen on the target desktop
and Pi:
1. In keyboard preferences, change Desktop to Laptop, release the key and wait.
Laptop should finish, followed by the role/state announcements. Repeat in
the other direction and test radio buttons, checkboxes and combo boxes.
2. During a long announcement, press Control. Repeat with typing, an arrow,
Tab and a reader command. Old speech and its queued feedback should stop;
the new action should speak normally. Releasing keys should leave speech
alone. Test rapid presses and held arrows, including automatic titles.
3. Leave a long announcement playing while a notification or terminal output
arrives. Both should finish in order. Repeat during Say All, then stop it
with a fresh key and check that the reading position has stopped advancing.
4. With a custom echo voice, press Right in an entry. The key name should finish
before the caret character. A new key should still stop stale feedback.
5. Exercise browser navigation, Where Am I, action/list dialogs and preferences
Apply. Check that each fresh command responds promptly and delayed results
preserve announcements from the same action. Check Braille focus/state and
confirmation restoration separately.
Screen lock still clears speech for privacy. Disabling speech, replacing its
configuration/backend and shutdown retain their existing behavior. Protected
Tentacle messages retain their explicit timeout and cancellation rules. The
bounded queue can discard pending requests on overflow and logs that loss.