[PR #5338] [MERGED] Narrate the open screen from its recorded narration as Screen does #6220

Closed
opened 2026-11-03 06:16:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5338
Author: @leifiyoo
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: narrator/06-driver


📝 Commits (10+)

  • 19c2a6f Narrate chat, overlays and the game's messages where vanilla does
  • 93adc09 Port NarratorLinux: flite's cmu_us_kal16 voice on the narrator
  • b309894 Add horizon-ctl narration: the narrator's status and recent messages
  • 0308ba7 Port NarratorMac: NSSpeechSynthesizer on the narrator
  • 7983abb Turn the macOS speech thread's run loop over while it idles
  • c635604 Record each frame's screen narration beside its widgets
  • 9ddec4a Narrate the open screen from its recorded narration as Screen does
  • 73bdc8e Merge main into #5335
  • 17f988c Merge #5335's main merge into #5336 (main merged, conflicts resolved below)
  • 659587e Merge #5336's main merge into #5337 (main merged, conflicts resolved below)

📊 Changes

29 files changed (+2611 additions, -111 deletions)

View changed files

📝 Cargo.lock (+4 -0)
📝 crates/horizon-client-render/src/chat.rs (+34 -4)
📝 crates/horizon-client-render/src/chat_tests.rs (+33 -0)
📝 crates/horizon-client-render/src/screen_draw.rs (+23 -9)
📝 crates/horizon-client-render/src/tab_list.rs (+44 -1)
📝 crates/horizon-client-render/src/ui.rs (+19 -0)
📝 crates/horizon-client-render/src/widgets.rs (+460 -0)
📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+3 -0)
📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/control.rs (+10 -0)
📝 crates/horizon-client/src/game/creative_hotbar.rs (+2 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+7 -2)
📝 crates/horizon-client/src/game/jukebox.rs (+4 -2)
📝 crates/horizon-client/src/game/lan_screen.rs (+15 -12)
📝 crates/horizon-client/src/game/narrator.rs (+35 -0)
📝 crates/horizon-client/src/game/remote.rs (+200 -65)
📝 crates/horizon-client/src/game/scoreboard.rs (+4 -1)
📝 crates/horizon-client/src/game/startup_menu.rs (+3 -0)
📝 crates/horizon-client/src/lan/discovery.rs (+49 -1)
📝 crates/horizon-client/src/lib.rs (+1 -0)

...and 9 more files

📄 Description

🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo.

Part 6 of 16 of the narrator series. All 16 PRs have to be merged, in this order, for the narrator to work completely: #5333 → #5334 → #5335 → #5336 → #5337 → #5338 → #5339 → #5340 → #5341 → #5342 → #5343 → #5344 → #5346 → #5347 → #5348 → #5349. Each PR builds on the one before it (stacked branches), so until the previous one is merged this PR's diff also shows its commits; merging only some of them, or out of order, leaves the narrator unfinished.

Stacked on #5337 — merge that first; until then this PR also shows its commits.

The driver that turns a drawn frame's recorded narration into what the narrator says. No screen begins its narration until the next PR, so players see no change yet.

What vanilla does

  • Screen.init → triggerImmediateNarration; Screen.afterMouseMove / afterMouseAction / afterKeyboardAction schedule the narration (NARRATE_DELAY_MOUSE_MOVE, ..._MOUSE_ACTION, ..._NAVIGATION), suppressed for 2 s after init or until the next key after a keyboard event; Gui / Minecraft runs handleDelayedNarration when due.
  • Screen.updateNarrationState: the title, findNarratableWidget (focused, else hovered), "Screen element i out of n" (narrator.position.screen), the usage (narration.button.usage.*), lists' rows (narrator.position.list) and ContainerObjectSelectionList's row widgets.
  • ScreenNarrationCollector says only what changed; mouseClicked focuses what it hits.

What changed

  • crates/horizon-client/src/screen_narrator.rs (new), lib.rs.

How it was tested

  • cargo test -p horizon-client --lib screen_narrator: the sentences for buttons, sliders, edit boxes, cycle buttons, lists and container lists, positions, usage, what changes between runs, the timing.
  • clippy (all targets) clean at this tip; fmt.

Known differences from vanilla

  • The first narration of a screen runs after its first frame (vanilla's runs in init, before it).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5338 **Author:** [@leifiyoo](https://github.com/leifiyoo) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `narrator/06-driver` --- ### 📝 Commits (10+) - [`19c2a6f`](https://github.com/horizon-rust/horizon/commit/19c2a6ff82507ef54d26cfb381f8ecc01c9565fb) Narrate chat, overlays and the game's messages where vanilla does - [`93adc09`](https://github.com/horizon-rust/horizon/commit/93adc0997c67723c684c2644f1af349798787c13) Port NarratorLinux: flite's cmu_us_kal16 voice on the narrator - [`b309894`](https://github.com/horizon-rust/horizon/commit/b309894c945d30637be8a347b8ff34a020520f5c) Add horizon-ctl narration: the narrator's status and recent messages - [`0308ba7`](https://github.com/horizon-rust/horizon/commit/0308ba799fdd9fc680c5e9d177a2f98dfd9b259b) Port NarratorMac: NSSpeechSynthesizer on the narrator - [`7983abb`](https://github.com/horizon-rust/horizon/commit/7983abb95e233ec78b05996ded3ffe83bd05ed8e) Turn the macOS speech thread's run loop over while it idles - [`c635604`](https://github.com/horizon-rust/horizon/commit/c635604a89164a91b89f455839d8d1ce943dac0d) Record each frame's screen narration beside its widgets - [`9ddec4a`](https://github.com/horizon-rust/horizon/commit/9ddec4a5493a377e7eb06bd441b84aa01bd24455) Narrate the open screen from its recorded narration as Screen does - [`73bdc8e`](https://github.com/horizon-rust/horizon/commit/73bdc8ef5a4229307a8bbc6ae6ba5914865ac9f0) Merge main into #5335 - [`17f988c`](https://github.com/horizon-rust/horizon/commit/17f988c72a6486a6075b8c0f4d26dc0d2f937981) Merge #5335's main merge into #5336 (main merged, conflicts resolved below) - [`659587e`](https://github.com/horizon-rust/horizon/commit/659587e36253d33d06565a65f9de9d4f91f86176) Merge #5336's main merge into #5337 (main merged, conflicts resolved below) ### 📊 Changes **29 files changed** (+2611 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+4 -0) 📝 `crates/horizon-client-render/src/chat.rs` (+34 -4) 📝 `crates/horizon-client-render/src/chat_tests.rs` (+33 -0) 📝 `crates/horizon-client-render/src/screen_draw.rs` (+23 -9) 📝 `crates/horizon-client-render/src/tab_list.rs` (+44 -1) 📝 `crates/horizon-client-render/src/ui.rs` (+19 -0) 📝 `crates/horizon-client-render/src/widgets.rs` (+460 -0) 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+3 -0) 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/control.rs` (+10 -0) 📝 `crates/horizon-client/src/game/creative_hotbar.rs` (+2 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+7 -2) 📝 `crates/horizon-client/src/game/jukebox.rs` (+4 -2) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+15 -12) 📝 `crates/horizon-client/src/game/narrator.rs` (+35 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+200 -65) 📝 `crates/horizon-client/src/game/scoreboard.rs` (+4 -1) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/discovery.rs` (+49 -1) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) _...and 9 more files_ </details> ### 📄 Description > 🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo. **Part 6 of 16 of the narrator series.** All 16 PRs have to be merged, in this order, for the narrator to work completely: #5333 → #5334 → #5335 → #5336 → #5337 → #5338 → #5339 → #5340 → #5341 → #5342 → #5343 → #5344 → #5346 → #5347 → #5348 → #5349. Each PR builds on the one before it (stacked branches), so until the previous one is merged this PR's diff also shows its commits; merging only some of them, or out of order, leaves the narrator unfinished. Stacked on #5337 — merge that first; until then this PR also shows its commits. The driver that turns a drawn frame's recorded narration into what the narrator says. No screen begins its narration until the next PR, so players see no change yet. ## What vanilla does - `Screen.init` → `triggerImmediateNarration`; `Screen.afterMouseMove` / `afterMouseAction` / `afterKeyboardAction` schedule the narration (`NARRATE_DELAY_MOUSE_MOVE`, `..._MOUSE_ACTION`, `..._NAVIGATION`), suppressed for 2 s after `init` or until the next key after a keyboard event; `Gui` / `Minecraft` runs `handleDelayedNarration` when due. - `Screen.updateNarrationState`: the title, `findNarratableWidget` (focused, else hovered), "Screen element i out of n" (`narrator.position.screen`), the usage (`narration.button.usage.*`), lists' rows (`narrator.position.list`) and `ContainerObjectSelectionList`'s row widgets. - `ScreenNarrationCollector` says only what changed; `mouseClicked` focuses what it hits. ## What changed - `crates/horizon-client/src/screen_narrator.rs` (new), `lib.rs`. ## How it was tested - `cargo test -p horizon-client --lib screen_narrator`: the sentences for buttons, sliders, edit boxes, cycle buttons, lists and container lists, positions, usage, what changes between runs, the timing. - clippy (all targets) clean at this tip; fmt. ## Known differences from vanilla - The first narration of a screen runs after its first frame (vanilla's runs in `init`, before it). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6220
No description provided.