[PR #5335] [MERGED] Narrate chat, overlays and the game's messages; horizon-ctl narration #6219

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/5335
Author: @leifiyoo
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: narrator/03-messages


📝 Commits (3)

  • 19c2a6f Narrate chat, overlays and the game's messages where vanilla does
  • b309894 Add horizon-ctl narration: the narrator's status and recent messages
  • 73bdc8e Merge main into #5335

📊 Changes

18 files changed (+502 additions, -88 deletions)

View changed files

📝 crates/horizon-client-render/src/chat.rs (+34 -4)
📝 crates/horizon-client-render/src/chat_tests.rs (+33 -0)
📝 crates/horizon-client-render/src/tab_list.rs (+44 -1)
📝 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)
📝 crates/horizon-client/src/title.rs (+8 -0)
📝 docs/horizon-ctl-commands.md (+1 -0)

📄 Description

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

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

The narrator now reads chat and the game's messages as vanilla does: "Steve says hi" for player chat, system chat and the action bar, "Joining the world", "Ready to play", Now Playing, LAN worlds found, the selected command suggestion. Scripts can read what it said with the new horizon-ctl narration.

What vanilla does

  • ChatListener.handlePlayerChatMessage / showMessageToPlayer / handleDisguisedChatMessage: once a message shows (after Chat Delay, past Only Show Secure Chat and the Chat option) it is said with narrateChatMessage → sayChatQueued(ChatType.Bound.decorateNarration(...)), from the message's own decorated content. handleSystemMessage → saySystemChatQueued; handleOverlay → saySystemQueued.
  • saySystemNow: JukeboxSong's Now Playing (Gui.setNowPlaying), the creative hotbar's saved message, ConnectScreen's "narrator.joining" every 2 s, LevelLoadingScreen.onClose's "narrator.ready_to_play".
  • CommandSuggestions.SuggestionsList.select: "narration.suggestion(.tooltip)" once per entry (lastNarratedEntry), at once when Tab asked.
  • PlayerTabOverlay narrates the names as it comes up; ServerSelectionList the LAN worlds found; WorldOptions' publish messages; Minecraft.disconnect / clearClientLevel clear the narrator.

What changed

  • crates/horizon-client/src/game/remote.rs: chat types' narration decoration from the server's registry (chat_type_decorate, Decoration), the narration riding along with each queued message (QueuedChat, kept with its signature and trust level so deletions, secure chat and Chat Delay work as before), system/overlay narration, "joining" / "ready to play", clearing on disconnect and reconfiguration.
  • crates/horizon-client-render/src/chat.rs: suggestion narration; tab_list.rs: the names.
  • Adapted to main's newer secure chat: the chat-validation error line main now shows (handleChatMessageError) is narrated as vanilla does, saySystemChatQueued(decorateNarration(chat.validation_error)); main's message validation, chat sessions and waypoint clearing on reconfiguration are kept as they are.
  • game/jukebox.rs, game/creative_hotbar.rs, game/debug_keys.rs, game/lan_screen.rs, game/scoreboard.rs, lan/discovery.rs, multiplayer.rs, title.rs, game/narrator.rs: the other callers.
  • bin/horizon-ctl/commands.rs, game/control.rs, docs/horizon-ctl-commands.md: horizon-ctl narration (status, availability, last 32 messages).

Only the window's game narrates, never a server thread in the same process; single player and LAN reach it as packets like any server.

How it was tested

  • cargo test -p horizon-client --bins chat_is_narrated_with_its_chat_types_narration_decoration, cargo test -p horizon-client-render --lib a_suggestion_is_narrated_by_its_place_once, cargo test -p horizon-client-render --lib the_list_is_narrated_once_as_it_comes_up_with_its_names_in_order, cargo test -p horizon-client --lib found_worlds_are_taken_once.
  • clippy (all targets) clean at this tip; fmt.

Known differences from vanilla

  • The client doesn't apply FilterMasks yet (before this PR too), so a filtered message's filtered content isn't what is shown or narrated.

🤖 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/5335 **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/03-messages` --- ### 📝 Commits (3) - [`19c2a6f`](https://github.com/horizon-rust/horizon/commit/19c2a6ff82507ef54d26cfb381f8ecc01c9565fb) Narrate chat, overlays and the game's messages where vanilla does - [`b309894`](https://github.com/horizon-rust/horizon/commit/b309894c945d30637be8a347b8ff34a020520f5c) Add horizon-ctl narration: the narrator's status and recent messages - [`73bdc8e`](https://github.com/horizon-rust/horizon/commit/73bdc8ef5a4229307a8bbc6ae6ba5914865ac9f0) Merge main into #5335 ### 📊 Changes **18 files changed** (+502 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chat.rs` (+34 -4) 📝 `crates/horizon-client-render/src/chat_tests.rs` (+33 -0) 📝 `crates/horizon-client-render/src/tab_list.rs` (+44 -1) 📝 `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) 📝 `crates/horizon-client/src/title.rs` (+8 -0) 📝 `docs/horizon-ctl-commands.md` (+1 -0) </details> ### 📄 Description > 🤖 Opened by leifiyoo's AI agent (Claude), not by leifiyoo. **Part 3 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 #5334 — merge that first; until then this PR also shows its commits. The narrator now reads chat and the game's messages as vanilla does: "Steve says hi" for player chat, system chat and the action bar, "Joining the world", "Ready to play", Now Playing, LAN worlds found, the selected command suggestion. Scripts can read what it said with the new `horizon-ctl narration`. ## What vanilla does - `ChatListener.handlePlayerChatMessage` / `showMessageToPlayer` / `handleDisguisedChatMessage`: once a message shows (after Chat Delay, past Only Show Secure Chat and the Chat option) it is said with `narrateChatMessage` → `sayChatQueued(ChatType.Bound.decorateNarration(...))`, from the message's own decorated content. `handleSystemMessage` → `saySystemChatQueued`; `handleOverlay` → `saySystemQueued`. - `saySystemNow`: `JukeboxSong`'s Now Playing (`Gui.setNowPlaying`), the creative hotbar's saved message, `ConnectScreen`'s "narrator.joining" every 2 s, `LevelLoadingScreen.onClose`'s "narrator.ready_to_play". - `CommandSuggestions.SuggestionsList.select`: "narration.suggestion(.tooltip)" once per entry (`lastNarratedEntry`), at once when Tab asked. - `PlayerTabOverlay` narrates the names as it comes up; `ServerSelectionList` the LAN worlds found; `WorldOptions`' publish messages; `Minecraft.disconnect` / `clearClientLevel` clear the narrator. ## What changed - `crates/horizon-client/src/game/remote.rs`: chat types' `narration` decoration from the server's registry (`chat_type_decorate`, `Decoration`), the narration riding along with each queued message (`QueuedChat`, kept with its signature and trust level so deletions, secure chat and Chat Delay work as before), system/overlay narration, "joining" / "ready to play", clearing on disconnect and reconfiguration. - `crates/horizon-client-render/src/chat.rs`: suggestion narration; `tab_list.rs`: the names. - Adapted to main's newer secure chat: the chat-validation error line main now shows (`handleChatMessageError`) is narrated as vanilla does, `saySystemChatQueued(decorateNarration(chat.validation_error))`; main's message validation, chat sessions and waypoint clearing on reconfiguration are kept as they are. - `game/jukebox.rs`, `game/creative_hotbar.rs`, `game/debug_keys.rs`, `game/lan_screen.rs`, `game/scoreboard.rs`, `lan/discovery.rs`, `multiplayer.rs`, `title.rs`, `game/narrator.rs`: the other callers. - `bin/horizon-ctl/commands.rs`, `game/control.rs`, `docs/horizon-ctl-commands.md`: `horizon-ctl narration` (status, availability, last 32 messages). Only the window's game narrates, never a server thread in the same process; single player and LAN reach it as packets like any server. ## How it was tested - `cargo test -p horizon-client --bins chat_is_narrated_with_its_chat_types_narration_decoration`, `cargo test -p horizon-client-render --lib a_suggestion_is_narrated_by_its_place_once`, `cargo test -p horizon-client-render --lib the_list_is_narrated_once_as_it_comes_up_with_its_names_in_order`, `cargo test -p horizon-client --lib found_worlds_are_taken_once`. - clippy (all targets) clean at this tip; fmt. ## Known differences from vanilla - The client doesn't apply `FilterMask`s yet (before this PR too), so a filtered message's filtered content isn't what is shown or narrated. 🤖 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#6219
No description provided.