[PR #1741] [MERGED] Server menus keep their styled titles #3733

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1741
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: feat/styled-menu-titles


📝 Commits (9)

  • 1d90d72 Server dialogs: the packets and the dialog model
  • a7f8650 Server dialogs: the dialog screen, its buttons and their actions
  • 1fdb119 Server menus keep their styled titles
  • 49dd31d Merge origin/main into feat/server-dialogs
  • 330a520 Merge feat/server-dialogs into feat/server-dialog-screen
  • c5cfab5 Merge feat/server-dialog-screen into feat/styled-menu-titles
  • b222dd9 Merge origin/main into feat/server-dialogs
  • a1ffa1a Merge feat/server-dialogs into feat/server-dialog-screen
  • d322c4b Merge feat/server-dialog-screen into feat/styled-menu-titles

📊 Changes

16 files changed (+2007 additions, -47 deletions)

View changed files

➕ crates/horizon-client/src/dialog.rs (+794 -0)
➕ crates/horizon-client/src/dialog_screen.rs (+304 -0)
📝 crates/horizon-client/src/game.rs (+23 -2)
📝 crates/horizon-client/src/game/agent.rs (+16 -0)
📝 crates/horizon-client/src/game/control.rs (+7 -0)
➕ crates/horizon-client/src/game/dialogs.rs (+450 -0)
📝 crates/horizon-client/src/game/machines.rs (+6 -5)
📝 crates/horizon-client/src/game/remote.rs (+26 -21)
📝 crates/horizon-client/src/game/remote_stations.rs (+1 -1)
📝 crates/horizon-client/src/game/stations.rs (+15 -11)
📝 crates/horizon-client/src/game/storage.rs (+4 -4)
📝 crates/horizon-client/src/lib.rs (+2 -0)
📝 crates/horizon-client/src/net.rs (+30 -0)
📝 crates/horizon-protocol/src/packets/configuration.rs (+52 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+60 -3)
➕ tools/server_e2e.py (+217 -0)

📄 Description

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

Stacked on #1734 (it uses that PR's tools/server_e2e.py harness): its base is feat/server-dialog-screen. The code change itself doesn't depend on dialogs.

Part of #1645: the menu titles. Item names in tooltips and the held-item label are contributor #1702 (RVZO6), which this PR leaves alone. Lore isn't covered by either PR. It touches the same files as #1702, so it can follow once that lands.

What players see

A server's menus keep their title styling. A plugin's gold and bold "Server Selector" chest used to show as plain grey "Server Selector". Now it shows in its colours, bold, italics and fonts. Workstation menus (crafting table, anvil, grindstone, …) used to ignore the server's title and showed their default name. They now show the title the server gave them.

Vanilla

ClientboundOpenScreenPacket.title is a Component. AbstractContainerScreen.extractLabels draws it in the label grey (0xFF404040, no shadow), and the component's own styles override that. § codes inside a literal are applied by the font (StringDecomposer.iterateFormatted). A component list is its first element with the rest as children, so they inherit its style.

Change

  • game/remote.rs: menu_title is now a Text, built with the component's styles and its § codes resolved. Before, it was text::plain().
  • Chests, hoppers, dispensers, droppers, brewing stands and the other workstations draw it with text_styled. Centred titles are measured with the styled width.
  • horizon-ctl's screen reports the server's title, span by span (text, colour, bold, italic).
  • tools/server_e2e.py, new check titles: on the vanilla server, a chest gets CustomName:[{text:"Server ",color:"gold",bold:true},{text:"Selector",color:"aqua"}]. The player opens it, and the title must come back as gold bold "Server " and aqua bold "Selector".

Evidence

python3 tools/server_e2e.py --check titles:

  • before (#1734's head): FAIL, the screen has no styled title. The menu draws a plain string in grey.
  • after: PASS, [{text: "Server ", color: #FFAA00, bold: true}, {text: "Selector", color: #55FFFF, bold: true}]. The screenshot shows the gold and aqua bold title on the chest.

The full harness (dialog then titles) passes in one run.

Self-check

pr_ready (tools/pr_ready.py --base origin/feat/server-dialog-screen on the Mac mini, 84 min)

Check Result
Scope ✅ 7 files, +80 −43
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ errors=2. The same 2 fail on main on macOS: OracleReuseTests.test_reuses_until_an_input_or_output_changes (fake java exits 127) and ParityRunnerTests.test_report_rejects_sources_changed_during_a_run (/private/var vs /var)
rustfmt / clippy ✅
tests: horizon-client ✅ 1207 passed
Parity ✅ 30 affected, 30 passed

No label: it's a fix.

🤖 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/1741 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/styled-menu-titles` --- ### 📝 Commits (9) - [`1d90d72`](https://github.com/horizon-rust/horizon/commit/1d90d72a64418071f943e404166fa39b09f50981) Server dialogs: the packets and the dialog model - [`a7f8650`](https://github.com/horizon-rust/horizon/commit/a7f8650c6b78f140fc0ea8f01bf4f0ecf9387690) Server dialogs: the dialog screen, its buttons and their actions - [`1fdb119`](https://github.com/horizon-rust/horizon/commit/1fdb119587b9cec955f8c925de403ceb85c1cc2a) Server menus keep their styled titles - [`49dd31d`](https://github.com/horizon-rust/horizon/commit/49dd31d36fd43c50a8a9804eeed09264abfaa7c6) Merge origin/main into feat/server-dialogs - [`330a520`](https://github.com/horizon-rust/horizon/commit/330a5205aeebe66bea95fe28b3f77d9dd6af47e4) Merge feat/server-dialogs into feat/server-dialog-screen - [`c5cfab5`](https://github.com/horizon-rust/horizon/commit/c5cfab5e075a412c5bc45499c2dacf67ee745390) Merge feat/server-dialog-screen into feat/styled-menu-titles - [`b222dd9`](https://github.com/horizon-rust/horizon/commit/b222dd91947c136c11252ba7c69187b445bf5f8a) Merge origin/main into feat/server-dialogs - [`a1ffa1a`](https://github.com/horizon-rust/horizon/commit/a1ffa1ac11042074271c2ea9e12f9293ae313aa7) Merge feat/server-dialogs into feat/server-dialog-screen - [`d322c4b`](https://github.com/horizon-rust/horizon/commit/d322c4b87052512636d8b06e8281d9c8be1cebd4) Merge feat/server-dialog-screen into feat/styled-menu-titles ### 📊 Changes **16 files changed** (+2007 additions, -47 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/src/dialog.rs` (+794 -0) ➕ `crates/horizon-client/src/dialog_screen.rs` (+304 -0) 📝 `crates/horizon-client/src/game.rs` (+23 -2) 📝 `crates/horizon-client/src/game/agent.rs` (+16 -0) 📝 `crates/horizon-client/src/game/control.rs` (+7 -0) ➕ `crates/horizon-client/src/game/dialogs.rs` (+450 -0) 📝 `crates/horizon-client/src/game/machines.rs` (+6 -5) 📝 `crates/horizon-client/src/game/remote.rs` (+26 -21) 📝 `crates/horizon-client/src/game/remote_stations.rs` (+1 -1) 📝 `crates/horizon-client/src/game/stations.rs` (+15 -11) 📝 `crates/horizon-client/src/game/storage.rs` (+4 -4) 📝 `crates/horizon-client/src/lib.rs` (+2 -0) 📝 `crates/horizon-client/src/net.rs` (+30 -0) 📝 `crates/horizon-protocol/src/packets/configuration.rs` (+52 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+60 -3) ➕ `tools/server_e2e.py` (+217 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #1734** (it uses that PR's `tools/server_e2e.py` harness): its base is `feat/server-dialog-screen`. The code change itself doesn't depend on dialogs. Part of #1645: the menu titles. Item names in tooltips and the held-item label are contributor #1702 (RVZO6), which this PR leaves alone. Lore isn't covered by either PR. It touches the same files as #1702, so it can follow once that lands. ## What players see A server's menus keep their title styling. A plugin's gold and bold "Server Selector" chest used to show as plain grey "Server Selector". Now it shows in its colours, bold, italics and fonts. Workstation menus (crafting table, anvil, grindstone, …) used to ignore the server's title and showed their default name. They now show the title the server gave them. ## Vanilla `ClientboundOpenScreenPacket.title` is a `Component`. `AbstractContainerScreen.extractLabels` draws it in the label grey (`0xFF404040`, no shadow), and the component's own styles override that. `§` codes inside a literal are applied by the font (`StringDecomposer.iterateFormatted`). A component list is its first element with the rest as children, so they inherit its style. ## Change - `game/remote.rs`: `menu_title` is now a `Text`, built with the component's styles and its `§` codes resolved. Before, it was `text::plain()`. - Chests, hoppers, dispensers, droppers, brewing stands and the other workstations draw it with `text_styled`. Centred titles are measured with the styled width. - horizon-ctl's `screen` reports the server's title, span by span (text, colour, bold, italic). - `tools/server_e2e.py`, new check `titles`: on the vanilla server, a chest gets `CustomName:[{text:"Server ",color:"gold",bold:true},{text:"Selector",color:"aqua"}]`. The player opens it, and the title must come back as gold bold "Server " and aqua bold "Selector". ## Evidence `python3 tools/server_e2e.py --check titles`: - before (#1734's head): FAIL, the screen has no styled title. The menu draws a plain string in grey. - after: PASS, `[{text: "Server ", color: #FFAA00, bold: true}, {text: "Selector", color: #55FFFF, bold: true}]`. The screenshot shows the gold and aqua bold title on the chest. The full harness (`dialog` then `titles`) passes in one run. ## Self-check **pr_ready** (`tools/pr_ready.py --base origin/feat/server-dialog-screen` on the Mac mini, 84 min) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +80 −43 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ errors=2. The same 2 fail on `main` on macOS: `OracleReuseTests.test_reuses_until_an_input_or_output_changes` (fake `java` exits 127) and `ParityRunnerTests.test_report_rejects_sources_changed_during_a_run` (`/private/var` vs `/var`) | | rustfmt / clippy | ✅ | | tests: horizon-client | ✅ 1207 passed | | Parity | ✅ 30 affected, 30 passed | No label: it's a fix. 🤖 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 04:11: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#3733
No description provided.