[PR #1702] [CLOSED] Client: retain styled server item names in tooltips and held labels #3700

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1702
Author: @RVZO6
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/styled-server-item-names


📝 Commits (1)

  • ca66621 Preserve structured custom item names in tooltips and held labels

📊 Changes

8 files changed (+216 additions, -22 deletions)

View changed files

📝 crates/horizon-client/examples/probe/tooltip_display_fixture.rs (+30 -0)
📝 crates/horizon-client/src/game/recipe_book.rs (+16 -4)
📝 crates/horizon-client/src/game/stations.rs (+39 -9)
📝 crates/horizon-client/src/game/titles.rs (+5 -3)
📝 crates/horizon-client/src/item_data.rs (+74 -2)
📝 crates/horizon-client/src/item_tooltip.rs (+19 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaTooltipDisplayOracle.java (+14 -0)
📝 tools/test_tooltip_display_parity.py (+19 -4)

📄 Description

🤖 Opened by RVZO6's AI agent (OpenAI Codex, gpt-6.1-sol), not by RVZO6.

What and why

Server item names were flattened to plain strings. Tooltips and the selected-item label therefore lost colours, bold, explicit non-italic spans, and fonts even when the item packet decoded successfully.

Preserve structured custom-name components alongside the existing plain search/rename cache. Keep them through save encoding; ignore and clear a stale component when a rename changes or removes its plain name. Render tooltip names as styled text and measure their styled widths. Feed the same structured name to the held-item label. Other tooltip lines retain their existing legacy-format handling.

This does not implement display entities or all item data components. It is independent of the upstream item-wire decoding fix.

Vanilla reference

Pinned 26.3 ItemStack.getStyledHoverName, inspected with javap -c: the original hover-name component is appended under rarity colour and, for a custom name, italic style. Child styles (including explicit false) remain authoritative. Extend VanillaTooltipDisplayOracle and its Rust fixture to compare resolved colour/bold/italic/decoration values for every character, independent of span segmentation.

Verification

  • Formatting and cargo check -p horizon-client --lib --bins: passed.
  • Client library tests: 1,075 passed, 26 ignored on the initial patch. Added a structured-name save/rename/removal and custom-font regression test.
  • 13 tooltip/name fixtures match the pinned Java implementation, including nested styles, RGB colour, component lists, and Unicode. This local run compiled the oracle against the checksum-verified server JAR; the standard client-JAR harness cannot run here because the local client dependency cache lacks the pinned jtracy native JAR. No game artifacts are included in this PR.
  • Python tests: 252 passed.
  • Client Clippy (lib/bins/tests/examples): passed with only the existing clippy::boxed_local warning in untouched streaming.rs:640 allowed (-D warnings -A clippy::boxed_local).
  • The stock pr_ready.py --quick rerun passed 1,201 Rust tests and doc tests; its only failed step was the same pre-existing Clippy lint. An isolated vanilla 26.3 Java server sent a gold/bold/explicitly non-italic custom-named sword to the optimized Rust client. The rendered held-item label visibly retained those styles. The test used fresh data directories and did not access real player saves.

🤖 Generated with OpenAI Codex.


🔄 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/1702 **Author:** [@RVZO6](https://github.com/RVZO6) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/styled-server-item-names` --- ### 📝 Commits (1) - [`ca66621`](https://github.com/horizon-rust/horizon/commit/ca666213f10bd1aac948af662dfe63da5d4a8434) Preserve structured custom item names in tooltips and held labels ### 📊 Changes **8 files changed** (+216 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/tooltip_display_fixture.rs` (+30 -0) 📝 `crates/horizon-client/src/game/recipe_book.rs` (+16 -4) 📝 `crates/horizon-client/src/game/stations.rs` (+39 -9) 📝 `crates/horizon-client/src/game/titles.rs` (+5 -3) 📝 `crates/horizon-client/src/item_data.rs` (+74 -2) 📝 `crates/horizon-client/src/item_tooltip.rs` (+19 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaTooltipDisplayOracle.java` (+14 -0) 📝 `tools/test_tooltip_display_parity.py` (+19 -4) </details> ### 📄 Description > 🤖 Opened by RVZO6's AI agent (OpenAI Codex, gpt-6.1-sol), not by RVZO6. ## What and why Server item names were flattened to plain strings. Tooltips and the selected-item label therefore lost colours, bold, explicit non-italic spans, and fonts even when the item packet decoded successfully. Preserve structured custom-name components alongside the existing plain search/rename cache. Keep them through save encoding; ignore and clear a stale component when a rename changes or removes its plain name. Render tooltip names as styled text and measure their styled widths. Feed the same structured name to the held-item label. Other tooltip lines retain their existing legacy-format handling. This does not implement display entities or all item data components. It is independent of the upstream item-wire decoding fix. ## Vanilla reference Pinned 26.3 `ItemStack.getStyledHoverName`, inspected with `javap -c`: the original hover-name component is appended under rarity colour and, for a custom name, italic style. Child styles (including explicit false) remain authoritative. Extend `VanillaTooltipDisplayOracle` and its Rust fixture to compare resolved colour/bold/italic/decoration values for every character, independent of span segmentation. ## Verification - Formatting and `cargo check -p horizon-client --lib --bins`: passed. - Client library tests: 1,075 passed, 26 ignored on the initial patch. Added a structured-name save/rename/removal and custom-font regression test. - 13 tooltip/name fixtures match the pinned Java implementation, including nested styles, RGB colour, component lists, and Unicode. This local run compiled the oracle against the checksum-verified server JAR; the standard client-JAR harness cannot run here because the local client dependency cache lacks the pinned jtracy native JAR. No game artifacts are included in this PR. - Python tests: 252 passed. - Client Clippy (lib/bins/tests/examples): passed with only the existing `clippy::boxed_local` warning in untouched `streaming.rs:640` allowed (`-D warnings -A clippy::boxed_local`). - The stock `pr_ready.py --quick` rerun passed 1,201 Rust tests and doc tests; its only failed step was the same pre-existing Clippy lint. An isolated vanilla 26.3 Java server sent a gold/bold/explicitly non-italic custom-named sword to the optimized Rust client. The rendered held-item label visibly retained those styles. The test used fresh data directories and did not access real player saves. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/). --- <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:32 +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#3700
No description provided.