[PR #1420] [MERGED] Chat: styled server components, click and hover events, legacy codes, message order #3509

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1420
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/st2-chat


📝 Commits (8)

  • c7abc8c Chat: styled server components, click and hover events, legacy codes, message order
  • 5d2f180 Merge branch 'fix/st2-entity-hands' into fix/st2-chat
  • 63baec3 Merge branch 'fix/st2-entity-hands' into fix/st2-chat
  • fe1d544 Merge remote-tracking branch 'origin/fix/st2-entity-hands' into mm1-1420
  • 8667cef Merge remote-tracking branch 'origin/main' into mm1-1420
  • 4d9baf6 Merge remote-tracking branch 'origin/fix/st2-entity-hands' into mm1-1420
  • ba8bdc7 Merge remote-tracking branch 'origin/main' into fix/st2-chat
  • 2a2b4ac Merge remote-tracking branch 'origin/main' into fix/st2-chat

📊 Changes

13 files changed (+297 additions, -62 deletions)

View changed files

📝 crates/horizon-client/examples/probe/hud_fixture/kinds.rs (+1 -0)
📝 crates/horizon-client/src/chat.rs (+40 -2)
📝 crates/horizon-client/src/chat_tests.rs (+42 -0)
📝 crates/horizon-client/src/component.rs (+19 -0)
📝 crates/horizon-client/src/game/agent.rs (+2 -0)
📝 crates/horizon-client/src/game/chat.rs (+34 -1)
📝 crates/horizon-client/src/game/commands.rs (+5 -0)
📝 crates/horizon-client/src/game/integrated.rs (+3 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+6 -5)
📝 crates/horizon-client/src/game/remote.rs (+46 -49)
📝 crates/horizon-client/src/settings.rs (+1 -0)
📝 crates/horizon-client/src/text.rs (+28 -0)
📝 tools/lan_e2e.py (+70 -4)

📄 Description

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

Stacked on #1419: it merges fix/st2-entity-hands, because both PRs add a check to tools/lan_e2e.py. Merge that PR first. This PR's own changes are in the commit "Chat: styled server components …".

Chat fixes from the single player audit.

  • Styled server components (#1372, #1389). The remote client turned every chat line into plain English text. Now:
    • SystemChat goes through the same remote_text path as the action bar, so it keeps colours, hex colours, bold, italic and underline, and is translated into the client's language;
    • player and disguised chat are built from the chat type's translation key, parameters and style (ChatType.Bound.decorate).
  • Click and hover events. Components now parse click_event (suggest_command and copy_to_clipboard; a server's open_file is never used) and hover_event show_text (#1377). The chat screen draws the tooltip of the hovered part (ChatComponent.getClickedComponentStyleAt → hover_at) (#1381).
  • Legacy § codes. With Chat Colors on, they colour the text; with it off, they are stripped (ComponentRenderUtils.wrapComponents) (#1379).
  • Command echo. On the integrated server, a command's operator broadcast went back to the player who ran it, as [Player: …]. It now skips that player, as broadcastToAdmins does (#1373). This also closes FEATURES.md 4p(f).
  • Advancement order. /give fires InventoryChangeTrigger before its own message (containerMenu.broadcastChanges). Guests' and the owner's advancement announcements are sent before the command's feedback (#1375).
  • Control socket. messages now returns styled: the chat lines as components.
  • lan_e2e styles, for the host and the guest:
    • a styled tellraw keeps its colour, bold, click and hover;
    • /give diamond after revoking: the Diamonds! announcement comes before "Gave 1 [Diamond]";
    • no [Name: …] echo.

Fixes #1372
Fixes #1373
Fixes #1375
Fixes #1377
Fixes #1379
Fixes #1381
Fixes #1389

Proof

  • python3 tools/lan_e2e.py --server-thread --check styles --check feedback --check chat: all PASS. The same three checks also pass in-frame.
  • Single player probes in both modes:
    • #1373, #1375: after a revoke, chat "/give @s cobblestone 2" and command give @s diamond show the advancement, then the give message, and no echo. Before the fix the server thread showed [Player: Gave …], and both modes showed the give message first.
    • #1389: with a French resource pack (lang:fr_fr), tellraw {"translate":"item.minecraft.diamond"} shows "Diamant", and /give shows the French feedback.
    • #1372, #1381: a screenshot on the server thread shows the red error and the green [Diamonds!]. Hovering [Diamonds!] shows the "Diamonds! / Acquire diamonds" tooltip.
  • New unit tests:
    • chat::tests::legacy_codes_colour_the_line_or_vanish_without_chat_colours
    • chat::tests::a_server_component_keeps_its_click_and_hover_events

Found but not fixed (FEATURES.md LATER): tellraw and title reach only the player who ran the command (player_targets in text_commands.rs), so tellraw @a never reaches the other players.

Self-check

  • cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test -p horizon-client: all pass
  • tools/parity.py --changed origin/main: 103 of 103 affected harnesses pass. This was one run over all four PRs merged together (8c9cdf9a: #1417 06b4c7fa, #1418 7e5e4697, #1419 337d7d7a, #1420 5d2f1804). The first run found that save_roundtrip saved an allay with InLove 0; #1418's second commit fixes that.

🤖 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/1420 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st2-chat` --- ### 📝 Commits (8) - [`c7abc8c`](https://github.com/horizon-rust/horizon/commit/c7abc8c718d6fd78bc5ed8f7766a3ab8491cb846) Chat: styled server components, click and hover events, legacy codes, message order - [`5d2f180`](https://github.com/horizon-rust/horizon/commit/5d2f1804e71f46e0898b486363c1ece1b19c750d) Merge branch 'fix/st2-entity-hands' into fix/st2-chat - [`63baec3`](https://github.com/horizon-rust/horizon/commit/63baec3ac8cfa6a5ebc36cd7b633f3d33f340ee9) Merge branch 'fix/st2-entity-hands' into fix/st2-chat - [`fe1d544`](https://github.com/horizon-rust/horizon/commit/fe1d544d021bc233c99fdc8d7ef81e5a92649ba1) Merge remote-tracking branch 'origin/fix/st2-entity-hands' into mm1-1420 - [`8667cef`](https://github.com/horizon-rust/horizon/commit/8667cef3a174a2ae9c4e70ebfd7317d093707932) Merge remote-tracking branch 'origin/main' into mm1-1420 - [`4d9baf6`](https://github.com/horizon-rust/horizon/commit/4d9baf60d4dff49d37b445e9a9406363ae55a588) Merge remote-tracking branch 'origin/fix/st2-entity-hands' into mm1-1420 - [`ba8bdc7`](https://github.com/horizon-rust/horizon/commit/ba8bdc7179161bb9d28fbc89a63f1fe1c1ff6e88) Merge remote-tracking branch 'origin/main' into fix/st2-chat - [`2a2b4ac`](https://github.com/horizon-rust/horizon/commit/2a2b4acb5ca7a2f3c28c341661d8d1dec76a23b3) Merge remote-tracking branch 'origin/main' into fix/st2-chat ### 📊 Changes **13 files changed** (+297 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/hud_fixture/kinds.rs` (+1 -0) 📝 `crates/horizon-client/src/chat.rs` (+40 -2) 📝 `crates/horizon-client/src/chat_tests.rs` (+42 -0) 📝 `crates/horizon-client/src/component.rs` (+19 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+2 -0) 📝 `crates/horizon-client/src/game/chat.rs` (+34 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+5 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+3 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+6 -5) 📝 `crates/horizon-client/src/game/remote.rs` (+46 -49) 📝 `crates/horizon-client/src/settings.rs` (+1 -0) 📝 `crates/horizon-client/src/text.rs` (+28 -0) 📝 `tools/lan_e2e.py` (+70 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Stacked on #1419**: it merges `fix/st2-entity-hands`, because both PRs add a check to `tools/lan_e2e.py`. Merge that PR first. This PR's own changes are in the commit "Chat: styled server components …". Chat fixes from the single player audit. - **Styled server components (#1372, #1389).** The remote client turned every chat line into plain English text. Now: - `SystemChat` goes through the same `remote_text` path as the action bar, so it keeps colours, hex colours, bold, italic and underline, and is translated into the client's language; - player and disguised chat are built from the chat type's translation key, parameters and style (`ChatType.Bound.decorate`). - **Click and hover events.** Components now parse `click_event` (`suggest_command` and `copy_to_clipboard`; a server's `open_file` is never used) and `hover_event` `show_text` (#1377). The chat screen draws the tooltip of the hovered part (`ChatComponent.getClickedComponentStyleAt` → `hover_at`) (#1381). - **Legacy `§` codes.** With Chat Colors on, they colour the text; with it off, they are stripped (`ComponentRenderUtils.wrapComponents`) (#1379). - **Command echo.** On the integrated server, a command's operator broadcast went back to the player who ran it, as `[Player: …]`. It now skips that player, as `broadcastToAdmins` does (#1373). This also closes FEATURES.md 4p(f). - **Advancement order.** `/give` fires `InventoryChangeTrigger` before its own message (`containerMenu.broadcastChanges`). Guests' and the owner's advancement announcements are sent before the command's feedback (#1375). - **Control socket.** `messages` now returns `styled`: the chat lines as components. - **lan_e2e `styles`**, for the host and the guest: - a styled tellraw keeps its colour, bold, click and hover; - `/give diamond` after revoking: the Diamonds! announcement comes before "Gave 1 [Diamond]"; - no `[Name: …]` echo. Fixes #1372 Fixes #1373 Fixes #1375 Fixes #1377 Fixes #1379 Fixes #1381 Fixes #1389 ## Proof - `python3 tools/lan_e2e.py --server-thread --check styles --check feedback --check chat`: all PASS. The same three checks also pass in-frame. - Single player probes in both modes: - **#1373, #1375**: after a revoke, `chat "/give @s cobblestone 2"` and `command give @s diamond` show the advancement, then the give message, and no echo. Before the fix the server thread showed `[Player: Gave …]`, and both modes showed the give message first. - **#1389**: with a French resource pack (`lang:fr_fr`), `tellraw {"translate":"item.minecraft.diamond"}` shows "Diamant", and `/give` shows the French feedback. - **#1372, #1381**: a screenshot on the server thread shows the red error and the green `[Diamonds!]`. Hovering `[Diamonds!]` shows the "Diamonds! / Acquire diamonds" tooltip. - New unit tests: - `chat::tests::legacy_codes_colour_the_line_or_vanish_without_chat_colours` - `chat::tests::a_server_component_keeps_its_click_and_hover_events` Found but not fixed (FEATURES.md LATER): `tellraw` and `title` reach only the player who ran the command (`player_targets` in text_commands.rs), so `tellraw @a` never reaches the other players. ## Self-check - `cargo fmt --all`; `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo test -p horizon-client`: all pass - `tools/parity.py --changed origin/main`: 103 of 103 affected harnesses pass. This was one run over all four PRs merged together (8c9cdf9a: #1417 06b4c7fa, #1418 7e5e4697, #1419 337d7d7a, #1420 5d2f1804). The first run found that `save_roundtrip` saved an allay with InLove 0; #1418's second commit fixes that. 🤖 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:10:02 +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#3509
No description provided.