[PR #7095] [MERGED] Port ledger: CommonComponents.joinForNarration is ported #7334

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • 160c052 Port ledger: joinForNarration is ported

📊 Changes

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

View changed files

📝 tools/port_map/rest-011.tsv (+1 -1)

📄 Description

Corrects one stale row in tools/port_map/rest-011.tsv, checked against upstream/main (26.3).

row was now
CommonComponents.joinForNarration skip:other — "screen-reader narration text; Horizon has no narrator output (the narrator option is only stored)" port crates/horizon-client-render/src/widgets.rs::join_for_narration

Citations:

  • widgets.rs:641-644: join_for_narration(parts: &[&str]) -> String is parts.join(". "), and its doc names CommonComponents.joinForNarration. Vanilla builds the same text: joinForNarration(Component...) starts from Component.empty(), appends each part and puts NARRATION_SEPARATOR between the parts (<clinit> makes that separator Component.literal(". ")), so both give "Title. Message" for two parts.
  • Every narrated screen with a title and a message goes through it: game/screen_info.rs:26 (the restricted-chat usage), :68 (the book page indicator), :101 and :106 (the confirm and popup screens, ConfirmScreen and PopupScreen's narration), title.rs:658 (the locked world entry), game/stats_screen.rs:515, game/lan_screen.rs:343, title/flat.rs:660 and :668, title/create_world.rs:452-453, game/screens.rs:605, game/dialogs.rs:418, and in the renderer pack_screen.rs:837 and options_ui.rs:3341. Its test is widgets.rs:957: join_for_narration(&["Title", "Message"]) == "Title. Message".
  • The ledger's own build already lists the method as ported, with this fn as its port, so the map row was the one thing still saying it wasn't.

map-check:

$ PORT_LEDGER_OUT=/tmp/pledger-n1 python3 tools/port_ledger.py map-check tools/port_map/rest-011.tsv
150 rows, no problems.

Proven: join_for_narration exists in this tree at the cited path, takes the parts and returns them joined with ". " — the separator string read out of the 26.3 client jar (CommonComponents.<clinit> puts Component.literal(". ") in NARRATION_SEPARATOR, and joinForNarration appends it only between parts, never after the last one), so the joined text is the same as vanilla's. Its callers are the screens that narrate a title together with a message, which is what vanilla uses joinForNarration for. The rest of the file is unchanged and map-check is clean before and after.

Not proven: the parts are &str, not Components, so a style on a vanilla part is dropped; narration is read aloud, and no caller here narrates styled text differently from its plain form, but that is read, not tested. Nothing compares the produced sentences with vanilla's at run time, and the only test is the unit test above — no screen-level test asserts the joined string a real screen records.


🔄 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/7095 **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-011` --- ### 📝 Commits (1) - [`160c052`](https://github.com/horizon-rust/horizon/commit/160c052dbef1f22a18dcecb75133fa9213f54d5b) Port ledger: joinForNarration is ported ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-011.tsv` (+1 -1) </details> ### 📄 Description Corrects one stale row in `tools/port_map/rest-011.tsv`, checked against `upstream/main` (26.3). | row | was | now | | --- | --- | --- | | `CommonComponents.joinForNarration` | `skip:other` — "screen-reader narration text; Horizon has no narrator output (the narrator option is only stored)" | `port` `crates/horizon-client-render/src/widgets.rs::join_for_narration` | Citations: - `widgets.rs:641-644`: `join_for_narration(parts: &[&str]) -> String` is `parts.join(". ")`, and its doc names `CommonComponents.joinForNarration`. Vanilla builds the same text: `joinForNarration(Component...)` starts from `Component.empty()`, appends each part and puts `NARRATION_SEPARATOR` between the parts (`<clinit>` makes that separator `Component.literal(". ")`), so both give "Title. Message" for two parts. - Every narrated screen with a title and a message goes through it: `game/screen_info.rs:26` (the restricted-chat usage), `:68` (the book page indicator), `:101` and `:106` (the confirm and popup screens, `ConfirmScreen` and `PopupScreen`'s narration), `title.rs:658` (the locked world entry), `game/stats_screen.rs:515`, `game/lan_screen.rs:343`, `title/flat.rs:660` and `:668`, `title/create_world.rs:452-453`, `game/screens.rs:605`, `game/dialogs.rs:418`, and in the renderer `pack_screen.rs:837` and `options_ui.rs:3341`. Its test is `widgets.rs:957`: `join_for_narration(&["Title", "Message"]) == "Title. Message"`. - The ledger's own build already lists the method as ported, with this fn as its port, so the map row was the one thing still saying it wasn't. map-check: ``` $ PORT_LEDGER_OUT=/tmp/pledger-n1 python3 tools/port_ledger.py map-check tools/port_map/rest-011.tsv 150 rows, no problems. ``` **Proven:** `join_for_narration` exists in this tree at the cited path, takes the parts and returns them joined with ". " — the separator string read out of the 26.3 client jar (`CommonComponents.<clinit>` puts `Component.literal(". ")` in `NARRATION_SEPARATOR`, and `joinForNarration` appends it only between parts, never after the last one), so the joined text is the same as vanilla's. Its callers are the screens that narrate a title together with a message, which is what vanilla uses `joinForNarration` for. The rest of the file is unchanged and `map-check` is clean before and after. **Not proven:** the parts are `&str`, not `Component`s, so a style on a vanilla part is dropped; narration is read aloud, and no caller here narrates styled text differently from its plain form, but that is read, not tested. Nothing compares the produced sentences with vanilla's at run time, and the only test is the unit test above — no screen-level test asserts the joined string a real screen records. --- <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:51 +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#7334
No description provided.