[PR #2661] [MERGED] Chat lines: server message bar and tooltip, item hover, run_command clicks, Shift insertion #4515

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2661
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/chat-click-hover-events


📝 Commits (3)

  • 180e2f6 Chat lines: server message bar and tooltip, item hover, run_command clicks, Shift insertion
  • 98ec18f Merge main into fix/chat-click-hover-events
  • 3a8706d Merge main into fix/chat-click-hover-events

📊 Changes

6 files changed (+140 additions, -52 deletions)

View changed files

📝 crates/horizon-client-core/src/component.rs (+18 -6)
📝 crates/horizon-client-core/src/text.rs (+24 -1)
📝 crates/horizon-client/src/chat.rs (+26 -11)
📝 crates/horizon-client/src/game/chat.rs (+62 -33)
📝 crates/horizon-client/src/game/remote.rs (+5 -1)
📝 crates/horizon-client/src/item_data.rs (+5 -0)

📄 Description

What and why

Gaps in how chat lines react to the mouse:

  • Server messages now get the grey bar at their left and the "Server message." tooltip when the cursor is on it. The connection's own chat (single player included) added them with no indicator.
  • Hovering a show_item event shows the item tooltip. Before, only show_text was read and the rest was dropped.
  • show_text tooltips keep their styles and wrap at half the screen width (at least 200), instead of keeping only the colour of each row.
  • run_command click events run the command as the player, without adding it to the chat history. A client mod's command goes first, as in vanilla. Vanilla asks for confirmation when the command does not parse; here the command is sent and the server answers it.
  • Shift+click on text with an insertion types it into the chat box, and without Shift the insertion is ignored. Right Shift counts too. The style model gets insertion, so player names from the server carry it.

Vanilla reference

  • ChatListener.handleSystemMessage / ChatComponent.addServerSystemMessage with GuiMessageTag.systemSinglePlayer (chat.tag.system_single_player), and DrawingFocusedGraphicsAccess.handleTag for the tooltip split at 210.
  • GuiGraphicsExtractor hover handling for ShowText (split at max(guiWidth / 2, 200)) and ShowItem.
  • Screen.defaultHandleGameClickEvent / clickCommandAction and ClientPacketListener.sendUnattendedCommand.
  • ChatScreen.handleComponentClicked and insertionClickMode (hasShiftDown).

Self-check

cargo check -p horizon-client passes.


🔄 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/2661 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/chat-click-hover-events` --- ### 📝 Commits (3) - [`180e2f6`](https://github.com/horizon-rust/horizon/commit/180e2f612a374fc47002465614b7770e806a25be) Chat lines: server message bar and tooltip, item hover, run_command clicks, Shift insertion - [`98ec18f`](https://github.com/horizon-rust/horizon/commit/98ec18fcfebc9ea5e3062dd647fb617453b287ab) Merge main into fix/chat-click-hover-events - [`3a8706d`](https://github.com/horizon-rust/horizon/commit/3a8706d0d7a0cd8c8190828a092982c036445ae9) Merge main into fix/chat-click-hover-events ### 📊 Changes **6 files changed** (+140 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-core/src/component.rs` (+18 -6) 📝 `crates/horizon-client-core/src/text.rs` (+24 -1) 📝 `crates/horizon-client/src/chat.rs` (+26 -11) 📝 `crates/horizon-client/src/game/chat.rs` (+62 -33) 📝 `crates/horizon-client/src/game/remote.rs` (+5 -1) 📝 `crates/horizon-client/src/item_data.rs` (+5 -0) </details> ### 📄 Description ## What and why Gaps in how chat lines react to the mouse: - Server messages now get the grey bar at their left and the "Server message." tooltip when the cursor is on it. The connection's own chat (single player included) added them with no indicator. - Hovering a `show_item` event shows the item tooltip. Before, only `show_text` was read and the rest was dropped. - `show_text` tooltips keep their styles and wrap at half the screen width (at least 200), instead of keeping only the colour of each row. - `run_command` click events run the command as the player, without adding it to the chat history. A client mod's command goes first, as in vanilla. Vanilla asks for confirmation when the command does not parse; here the command is sent and the server answers it. - Shift+click on text with an `insertion` types it into the chat box, and without Shift the insertion is ignored. Right Shift counts too. The style model gets `insertion`, so player names from the server carry it. ## Vanilla reference - `ChatListener.handleSystemMessage` / `ChatComponent.addServerSystemMessage` with `GuiMessageTag.systemSinglePlayer` (`chat.tag.system_single_player`), and `DrawingFocusedGraphicsAccess.handleTag` for the tooltip split at 210. - `GuiGraphicsExtractor` hover handling for `ShowText` (split at `max(guiWidth / 2, 200)`) and `ShowItem`. - `Screen.defaultHandleGameClickEvent` / `clickCommandAction` and `ClientPacketListener.sendUnattendedCommand`. - `ChatScreen.handleComponentClicked` and `insertionClickMode` (`hasShiftDown`). ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:44 +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#4515
No description provided.