[PR #5892] [MERGED] Chat: a new line slides in and fades in (Smooth chat extra) #6544

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5892
Author: @Domanffe
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/chat-animation


📝 Commits (5)

  • e1babb9 Chat: a new line slides in and fades in (Smooth chat extra)
  • 20f6800 Tests: build the smooth chat test's Chat in one go
  • 2b50470 Chat: vanilla's fade keeps whole ticks while Smooth chat is off
  • 4f6522c Merge main into feat/chat-animation (chat extras beside splitscreen and uiSoundReserve)
  • 83927e4 Merge main into chat-animation (extras: hideBlockParticles beside the chat extras)

📊 Changes

6 files changed (+159 additions, -25 deletions)

View changed files

📝 crates/horizon-client-render/src/chat.rs (+50 -17)
📝 crates/horizon-client-render/src/chat_tests.rs (+56 -1)
📝 crates/horizon-client-render/src/extras.rs (+34 -2)
📝 crates/horizon-client/examples/probe/hud_fixture/kinds.rs (+1 -1)
📝 crates/horizon-client/src/game/chat.rs (+6 -3)
📝 docs/extras.md (+12 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

Two Extras under a new "Chat" header on the Extras page: Smooth chat (chatAnimation, off by default) and Message indicator (chatIndicator, on by default, so nothing changes for a vanilla-minded player).

Smooth chat: a new line slides in from the left while it fades in, over 5 ticks, instead of appearing whole on the tick it arrives. Chat::layout eases the line's alpha and carries it on a PoseOp::Translate while it moves, so the line's background and its indicator bar travel with it. chatIndicator off removes the coloured bar at a line's left, as the same mod offers.

The idea is ported from the ChatAnimation mod (MIT, 25.1M downloads, 2.4k followers) from its description and its demo GIF; none of its code was read. It cannot be a native mod here: Horizon has no chat hook point, and the lines live in Chat::layout's private state, so a bundle would have to OVERWRITE that function and pin a Nightly for a purely visual ramp.

The one change worth a look

Chat::layout and Chat::draw take ticks: f32, and draw_chat passes self.ticks + self.clock.fraction(). Without the fraction the slide would step 20 times a second; vanilla's own 200-tick fade reads the same value and gains the same smoothness.

Only the unfocused HUD chat animates. With the chat screen open, lines are drawn where vanilla draws them, which is where click_at maps a click, so nothing a player clicks moves under the cursor.

With the extra off, no draw op is added: slide != 0.0 gates the translate, so the draw list is exactly vanilla's and the chat screen parity harness is untouched.

Checks

  • cargo fmt --all --check clean.
  • cargo check -p horizon-client --all-targets clean.
  • cargo test -p horizon-client-render --lib -- --test-threads=1: 826 passed, 0 failed. The new smooth_chat_slides_a_line_in_and_can_hide_the_indicator pins the slide, the fade and the removed bar; everything_is_off_by_default_and_round_trips carries the two new keys.
  • In the game, a --profile fast build of this branch, one world, consecutive frames from horizon-ctl screenshot. With the extra on, the newest line's left edge (the screen clips it while it slides) reads 0 → 4 → 7 → 8 device px on four consecutive frames, its mean text brightness 503 → 646 → 733 → 765. With the extra off, it is at 8 px and full brightness on the first frame. The /time set noon system line's bar reads #D0D0D0 at x 0..3 while chatIndicator is on and the world's own colour with it off.

The serial run is deliberate: the parallel one hangs on this Windows machine inside gfx:: (a thread spins). Checked against a stashed tree: gfx:: alone hangs on clean main the same way, and the whole suite serially is green, so that flake is not this branch's.

The pr_ready block follows as a comment on this PR.

Not observed

Chat scales other than the defaults (the captures ran at guiScale 2, chatScale 1), and a LAN guest's or a splitscreen player's chat window.


🔄 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/5892 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/chat-animation` --- ### 📝 Commits (5) - [`e1babb9`](https://github.com/horizon-rust/horizon/commit/e1babb91327bfc0a69570ab56fceb0418e1ac35d) Chat: a new line slides in and fades in (Smooth chat extra) - [`20f6800`](https://github.com/horizon-rust/horizon/commit/20f68001d8721c3fea14a2776fe3fc2e72512c7a) Tests: build the smooth chat test's Chat in one go - [`2b50470`](https://github.com/horizon-rust/horizon/commit/2b50470645524353e0b0b832e625e840e0d64755) Chat: vanilla's fade keeps whole ticks while Smooth chat is off - [`4f6522c`](https://github.com/horizon-rust/horizon/commit/4f6522cbeba2f3961f8cf0f67258a9b44288794a) Merge main into feat/chat-animation (chat extras beside splitscreen and uiSoundReserve) - [`83927e4`](https://github.com/horizon-rust/horizon/commit/83927e425b2ae37a758b2277e574891fd1c7f705) Merge main into chat-animation (extras: hideBlockParticles beside the chat extras) ### 📊 Changes **6 files changed** (+159 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chat.rs` (+50 -17) 📝 `crates/horizon-client-render/src/chat_tests.rs` (+56 -1) 📝 `crates/horizon-client-render/src/extras.rs` (+34 -2) 📝 `crates/horizon-client/examples/probe/hud_fixture/kinds.rs` (+1 -1) 📝 `crates/horizon-client/src/game/chat.rs` (+6 -3) 📝 `docs/extras.md` (+12 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Two Extras under a new "Chat" header on the Extras page: **Smooth chat** (`chatAnimation`, off by default) and **Message indicator** (`chatIndicator`, on by default, so nothing changes for a vanilla-minded player). Smooth chat: a new line slides in from the left while it fades in, over 5 ticks, instead of appearing whole on the tick it arrives. `Chat::layout` eases the line's alpha and carries it on a `PoseOp::Translate` while it moves, so the line's background and its indicator bar travel with it. `chatIndicator` off removes the coloured bar at a line's left, as the same mod offers. The idea is ported from the [ChatAnimation](https://modrinth.com/mod/chatanimation) mod (MIT, 25.1M downloads, 2.4k followers) from its description and its demo GIF; none of its code was read. It cannot be a native mod here: Horizon has no chat hook point, and the lines live in `Chat::layout`'s private state, so a bundle would have to OVERWRITE that function and pin a Nightly for a purely visual ramp. ### The one change worth a look `Chat::layout` and `Chat::draw` take `ticks: f32`, and `draw_chat` passes `self.ticks + self.clock.fraction()`. Without the fraction the slide would step 20 times a second; vanilla's own 200-tick fade reads the same value and gains the same smoothness. Only the unfocused HUD chat animates. With the chat screen open, lines are drawn where vanilla draws them, which is where `click_at` maps a click, so nothing a player clicks moves under the cursor. With the extra off, no draw op is added: `slide != 0.0` gates the translate, so the draw list is exactly vanilla's and the chat screen parity harness is untouched. ### Checks - `cargo fmt --all --check` clean. - `cargo check -p horizon-client --all-targets` clean. - `cargo test -p horizon-client-render --lib -- --test-threads=1`: 826 passed, 0 failed. The new `smooth_chat_slides_a_line_in_and_can_hide_the_indicator` pins the slide, the fade and the removed bar; `everything_is_off_by_default_and_round_trips` carries the two new keys. - In the game, a `--profile fast` build of this branch, one world, consecutive frames from `horizon-ctl screenshot`. With the extra on, the newest line's left edge (the screen clips it while it slides) reads 0 → 4 → 7 → 8 device px on four consecutive frames, its mean text brightness 503 → 646 → 733 → 765. With the extra off, it is at 8 px and full brightness on the first frame. The `/time set noon` system line's bar reads #D0D0D0 at x 0..3 while `chatIndicator` is on and the world's own colour with it off. The serial run is deliberate: the parallel one hangs on this Windows machine inside `gfx::` (a thread spins). Checked against a stashed tree: `gfx::` alone hangs on clean `main` the same way, and the whole suite serially is green, so that flake is not this branch's. The `pr_ready` block follows as a comment on this PR. ### Not observed Chat scales other than the defaults (the captures ran at guiScale 2, chatScale 1), and a LAN guest's or a splitscreen player's chat window. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:40 +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#6544
No description provided.