[PR #7100] [MERGED] Port ledger: the narrator's status gate and GameNarrator are in the tree #7339

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7100
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/narrator-rest-003


📝 Commits (1)

  • 1755ea5 Port ledger: the narrator's status gate and GameNarrator are in the tree

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 tools/port_map/rest-003.tsv (+2 -2)

📄 Description

Corrects two stale rows in tools/port_map/rest-003.tsv, checked against upstream/main (26.3). The second was not worded with "no narrator", so a search for that phrase misses it: it says there is no text-to-speech at all.

row was now
NarratorStatus.shouldNarrateSystemOrChat missing — "minor: no narrator output" port crates/horizon-narrator/src/lib.rs::Status::should_narrate_system_or_chat
GameNarrator missing — "minor: no text-to-speech; the narrator option is stored but nothing is spoken" home crates/horizon-narrator/src/lib.rs,crates/horizon-client/src/game/narrator.rs

Citations:

  • lib.rs:62-64: Status::should_narrate_system_or_chat is true for All, System and Chat, which is the test 26.3's NarratorStatus.shouldNarrateSystemOrChat makes (bytecode compares this against ALL, SYSTEM and CHAT). Its only vanilla caller is GameNarrator.saySystemChatQueued, which is if (getStatus().shouldNarrateSystemOrChat()) narrateNotInterruptingMessage(component); the Rust caller is GameNarrator::say_system_chat_queued at lib.rs:125-129, the same shape over say_system_chat_queued. The other two gates sit next to it (should_narrate_chat at :56, should_narrate_system at :59).
  • GameNarrator is the struct at lib.rs:82 with set_status, say_chat_queued, say_system_chat_queued, say_system_queued, say_system_now, update_status, is_active and clear (:109-182), plus the free functions the game calls (:238-266); its doc names GameNarrator and Minecraft.narrator. The game-side half is crates/horizon-client/src/game/narrator.rs: start (Minecraft's new GameNarrator and checkStatus, :20), sync (the options, :41), update_status (the NARRATOR_TOGGLE toast, :50), is_hotkey/cycle_status (Ctrl+B, :94, :159), and narrate_input/narrate_key (:116, :144).
  • docs/narrator.md:50 already puts GameNarrator in crates/horizon-narrator/src/lib.rs, and the ledger's own build gives the class those two files as its home and matches seven of its methods to lib.rs functions (checkStatus, clear, sayChatQueued, saySystemChatQueued, saySystemNow, saySystemQueued, updateNarratorStatus). The class row was the one thing still saying the class does not exist.

map-check (run from the branch, the same command as the file's other checks):

$ PORT_LEDGER_OUT=/tmp/pledger-n1 python3 tools/port_ledger.py map-check tools/port_map/rest-003.tsv
tools/port_map/rest-003.tsv:67 KeyboardHandler.textEditing: no fn crates/horizon-client/src/game.rs::ime_preedit
tools/port_map/rest-003.tsv:68 KeyboardHandler.submitPreeditEvent: no fn crates/horizon-client/src/game.rs: WindowEvent::Ime arm
tools/port_map/rest-003.tsv:76 Minecraft.run: no fn crates/horizon-client/src/game.rs::run
tools/port_map/rest-003.tsv:120 Minecraft.onTextInputFocusChange: no fn crates/horizon-client/src/game.rs::sync_ime
tools/port_map/rest-003.tsv:123 MouseHandler.onDrop: no fn crates/horizon-client/src/game.rs:16709 -> title::drop_file

Those five rows are untouched here and fail the same way on upstream/main: their where cells hold prose and line numbers instead of file::fn, which map-check cannot resolve. Neither corrected row is among them.

Proven: both fns exist at the cited paths and do what the vanilla methods do — the status gate is the same three-way test, called from the same place, and GameNarrator lives in the two files the row now names (struct and say/status methods in lib.rs, the start, option, hotkey, toast and input glue in game/narrator.rs), which is also where docs/narrator.md and the ledger's home for the class put it. A rebuild that includes these rows (PORT_LEDGER_OUT=/tmp/pledger-narr3) reports NarratorStatus.shouldNarrateSystemOrChat as ported to lib.rs:62 and no longer marks the class's methods absent.

Not proven: the class row changes what the build does with the methods it cannot place: <init>, <clinit>, getStatus, logNarratedMessage, narrateMessage and narrateNotInterruptingMessage were previously swept up by the missing class row and now show as unanswered, so they will appear in todo until rows name them (some have obvious counterparts, status() and narrate/narrate_not_interrupting, but that is a separate batch and I did not add rows for them here). Nothing was built or run: the claims come from reading the Rust and the 26.3 bytecode, and the other rows of the file were left as they were.


🔄 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/7100 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/narrator-rest-003` --- ### 📝 Commits (1) - [`1755ea5`](https://github.com/horizon-rust/horizon/commit/1755ea5c93c6e3ee787e6d7e7ce601ad605ad85e) Port ledger: the narrator's status gate and GameNarrator are in the tree ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-003.tsv` (+2 -2) </details> ### 📄 Description Corrects two stale rows in `tools/port_map/rest-003.tsv`, checked against `upstream/main` (26.3). The second was not worded with "no narrator", so a search for that phrase misses it: it says there is no text-to-speech at all. | row | was | now | | --- | --- | --- | | `NarratorStatus.shouldNarrateSystemOrChat` | `missing` — "minor: no narrator output" | `port` `crates/horizon-narrator/src/lib.rs::Status::should_narrate_system_or_chat` | | `GameNarrator` | `missing` — "minor: no text-to-speech; the narrator option is stored but nothing is spoken" | `home` `crates/horizon-narrator/src/lib.rs,crates/horizon-client/src/game/narrator.rs` | Citations: - `lib.rs:62-64`: `Status::should_narrate_system_or_chat` is true for `All`, `System` and `Chat`, which is the test 26.3's `NarratorStatus.shouldNarrateSystemOrChat` makes (bytecode compares `this` against `ALL`, `SYSTEM` and `CHAT`). Its only vanilla caller is `GameNarrator.saySystemChatQueued`, which is `if (getStatus().shouldNarrateSystemOrChat()) narrateNotInterruptingMessage(component)`; the Rust caller is `GameNarrator::say_system_chat_queued` at `lib.rs:125-129`, the same shape over `say_system_chat_queued`. The other two gates sit next to it (`should_narrate_chat` at `:56`, `should_narrate_system` at `:59`). - `GameNarrator` is the struct at `lib.rs:82` with `set_status`, `say_chat_queued`, `say_system_chat_queued`, `say_system_queued`, `say_system_now`, `update_status`, `is_active` and `clear` (`:109-182`), plus the free functions the game calls (`:238-266`); its doc names `GameNarrator` and `Minecraft.narrator`. The game-side half is `crates/horizon-client/src/game/narrator.rs`: `start` (Minecraft's `new GameNarrator` and `checkStatus`, `:20`), `sync` (the options, `:41`), `update_status` (the `NARRATOR_TOGGLE` toast, `:50`), `is_hotkey`/`cycle_status` (Ctrl+B, `:94`, `:159`), and `narrate_input`/`narrate_key` (`:116`, `:144`). - `docs/narrator.md:50` already puts `GameNarrator` in `crates/horizon-narrator/src/lib.rs`, and the ledger's own build gives the class those two files as its home and matches seven of its methods to `lib.rs` functions (`checkStatus`, `clear`, `sayChatQueued`, `saySystemChatQueued`, `saySystemNow`, `saySystemQueued`, `updateNarratorStatus`). The class row was the one thing still saying the class does not exist. map-check (run from the branch, the same command as the file's other checks): ``` $ PORT_LEDGER_OUT=/tmp/pledger-n1 python3 tools/port_ledger.py map-check tools/port_map/rest-003.tsv tools/port_map/rest-003.tsv:67 KeyboardHandler.textEditing: no fn crates/horizon-client/src/game.rs::ime_preedit tools/port_map/rest-003.tsv:68 KeyboardHandler.submitPreeditEvent: no fn crates/horizon-client/src/game.rs: WindowEvent::Ime arm tools/port_map/rest-003.tsv:76 Minecraft.run: no fn crates/horizon-client/src/game.rs::run tools/port_map/rest-003.tsv:120 Minecraft.onTextInputFocusChange: no fn crates/horizon-client/src/game.rs::sync_ime tools/port_map/rest-003.tsv:123 MouseHandler.onDrop: no fn crates/horizon-client/src/game.rs:16709 -> title::drop_file ``` Those five rows are untouched here and fail the same way on `upstream/main`: their `where` cells hold prose and line numbers instead of `file::fn`, which `map-check` cannot resolve. Neither corrected row is among them. **Proven:** both fns exist at the cited paths and do what the vanilla methods do — the status gate is the same three-way test, called from the same place, and `GameNarrator` lives in the two files the row now names (struct and say/status methods in `lib.rs`, the start, option, hotkey, toast and input glue in `game/narrator.rs`), which is also where `docs/narrator.md` and the ledger's home for the class put it. A rebuild that includes these rows (`PORT_LEDGER_OUT=/tmp/pledger-narr3`) reports `NarratorStatus.shouldNarrateSystemOrChat` as ported to `lib.rs:62` and no longer marks the class's methods absent. **Not proven:** the class row changes what the build does with the methods it cannot place: `<init>`, `<clinit>`, `getStatus`, `logNarratedMessage`, `narrateMessage` and `narrateNotInterruptingMessage` were previously swept up by the `missing` class row and now show as unanswered, so they will appear in `todo` until rows name them (some have obvious counterparts, `status()` and `narrate`/`narrate_not_interrupting`, but that is a separate batch and I did not add rows for them here). Nothing was built or run: the claims come from reading the Rust and the 26.3 bytecode, and the other rows of the file were left as they were. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:37:57 +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#7339
No description provided.