[PR #5337] [MERGED] Record each frame's screen narration beside its widgets #6218

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

📋 Pull Request Information

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

Base: main ← Head: narrator/05-recording


📝 Commits (9)

  • 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
  • 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

27 files changed (+1409 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/multiplayer.rs (+45 -0)

...and 7 more files

📄 Description

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

Part 5 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 #5336 — merge that first; until then this PR also shows its commits.

Groundwork for screen narration; players see no change. Horizon's screens are drawn every frame instead of being widget trees, so the drawers now record what vanilla's widgets would narrate as they draw.

What vanilla does

Screen.updateNarrationState walks the screen's NarratableEntrys (AbstractWidget.updateNarration: Button, AbstractSliderButton, EditBox, CycleButton...) and Screen.getNarrationMessage.

What changed

  • crates/horizon-client-render/src/widgets.rs: begin_screen (ScreenInfo: id, title, usage, overrides), narratable (Narratable, What), recorded per frame through closures, and only while the narrator asks (nothing is built or allocated otherwise).
  • crates/horizon-client-render/src/ui.rs, screen_draw.rs: ui::button, ui::slider, ui::EditBox::draw and the screen_draw widgets record themselves.

How it was tested

  • cargo test -p horizon-client-render --lib widgets.
  • clippy (all targets) clean at this tip; fmt.

🤖 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/5337 **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/05-recording` --- ### 📝 Commits (9) - [`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 - [`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 **27 files changed** (+1409 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/multiplayer.rs` (+45 -0) _...and 7 more files_ </details> ### 📄 Description > 🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo. **Part 5 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 #5336 — merge that first; until then this PR also shows its commits. Groundwork for screen narration; players see no change. Horizon's screens are drawn every frame instead of being widget trees, so the drawers now record what vanilla's widgets would narrate as they draw. ## What vanilla does `Screen.updateNarrationState` walks the screen's `NarratableEntry`s (`AbstractWidget.updateNarration`: `Button`, `AbstractSliderButton`, `EditBox`, `CycleButton`...) and `Screen.getNarrationMessage`. ## What changed - `crates/horizon-client-render/src/widgets.rs`: `begin_screen` (`ScreenInfo`: id, title, usage, overrides), `narratable` (`Narratable`, `What`), recorded per frame through closures, and only while the narrator asks (nothing is built or allocated otherwise). - `crates/horizon-client-render/src/ui.rs`, `screen_draw.rs`: `ui::button`, `ui::slider`, `ui::EditBox::draw` and the `screen_draw` widgets record themselves. ## How it was tested - `cargo test -p horizon-client-render --lib widgets`. - clippy (all targets) clean at this tip; fmt. 🤖 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:01 +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#6218
No description provided.