[PR #2428] [CLOSED] Render retained module contributions in native item tooltips #4305

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2428
Author: @evilchinesefood
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: codex/retained-tooltip-rendering


📝 Commits (2)

  • e6f1dd2 Add experimental retained tooltip rules to the module SDK and runtime
  • 9b4ef83 Render retained module contributions in native item tooltips

📊 Changes

23 files changed (+1089 additions, -18 deletions)

View changed files

📝 Cargo.lock (+7 -0)
📝 Cargo.toml (+1 -1)
📝 crates/horizon-client/src/enchant.rs (+19 -4)
📝 crates/horizon-client/src/game/stations.rs (+21 -0)
📝 crates/horizon-client/src/item_tooltip.rs (+1 -1)
📝 crates/horizon-client/src/lib.rs (+3 -0)
➕ crates/horizon-client/src/mod_tooltip.rs (+319 -0)
📝 crates/horizon-mod-sdk/src/lib.rs (+2 -2)
📝 crates/horizon-mod-sdk/wit/horizon.wit (+31 -1)
📝 crates/horizon-mods/Cargo.toml (+4 -0)
📝 crates/horizon-mods/src/api_level.rs (+14 -2)
📝 crates/horizon-mods/src/lib.rs (+7 -0)
📝 crates/horizon-mods/src/manifest.rs (+34 -2)
📝 crates/horizon-mods/src/runtime.rs (+27 -0)
➕ crates/horizon-mods/src/tooltip.rs (+171 -0)
📝 crates/horizon-mods/tests/api_reference.rs (+3 -0)
📝 crates/horizon-mods/tests/sandbox.rs (+4 -3)
➕ crates/horizon-mods/tests/tooltip_guest/Cargo.toml (+15 -0)
➕ crates/horizon-mods/tests/tooltip_guest/src/lib.rs (+73 -0)
➕ crates/horizon-mods/tests/tooltip_sandbox.rs (+206 -0)

...and 3 more files

📄 Description

🤖 Opened by David Ayers's AI agent (OpenAI Codex), not by David himself.

What and why

Render the retained tooltip rules registered through the preceding SDK/runtime change. Applied and stored enchantment contributions follow their matching visible vanilla enchantment in canonical order; item contributions follow vanilla details.

Game::stack_tooltip → visibility → exact selector → current translation → native wrapping

The host resolves active-language text with English fallback, omits missing keys, wraps using the existing font, and limits output to 16 lines per module and 32 total. Whole-tooltip and section hiding remain authoritative. No module function runs during hover. The host contains no enchantment-description mappings or module identities.

Depends on #2426 (SDK/runtime) and #2425 (server inventory visibility). Kept as a draft until those prerequisites merge. This main-targeting PR currently includes the API commit; the renderer-only comparison isolates its five client files. Rebase after #2426 merges to leave only rendering in the main comparison. It preserves the existing no-mod path.

Vanilla reference

Horizon-only contribution API, integrated into existing vanilla tooltip ordering and visibility behavior. Enchantments::tooltip retains its existing output; a new ID-preserving helper supplies typed selector matching.

Self-check

Five native assembly tests pass for canonical interleaving, colors, whole/section hiding, Unicode wrapping, budgets, per-hover translation resolution, English fallback and missing keys. The combined stack passed the required quick gate (below).

Screenshots

Before: with the standalone package disabled or removed, vanilla enchantment names remain and description lines are absent. After: installing the same .hmod adds German descriptions below matching enchantments and uses English for a missing German soul-speed description. Hidden sections suppress both the vanilla section and its contributions; creative whole hiding retains only the item name.

Visual review passed 18 actual inventory-hover captures in each of the default integrated-server and in-frame paths, including restart-based disable/remove/reinstall. Screenshots were captured and visually reviewed locally; they have not been uploaded. Separate LAN clients, live UI toggles and recipe-book hover were not tested. These development-host checks do not establish released-stock compatibility.

Publication baseline

Prepared on upstream 72e678be8cc68700bc1853db058386fc5254650f. No relevant SDK/runtime/tooltip files changed from the original validation base. The original combined-stack gate below is retained with its exact base; it is not presented as a gate run on the rebased PR heads. Public-tree/history and patch-whitespace checks passed again before publication. On the rebased combined integration tree, 24 client tooltip tests and 5 module tooltip tests passed (two pre-existing client tests ignored).

Combined-stack gate

pr_ready (tools/pr_ready.py --quick --base 60109e0d911fa592b4669eeb3db10684f8b496cc on Davids-MacBook-Pro, against 60109e0d91 at 60109e0d9, 9 min 31 s)

Check Result
Scope ⚠️ 25 files, +1309 −16; 899 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (1 min 7 s)
tests: workspace ✅ 2266 passed (6 min 0 s)
doc tests ✅ 2 passed (30 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (46 s)
launcher tests ✅ 137 passed (1 min 0 s)
Parity ➖ 345 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 333 more

The scope warning applies to the full stack. The wire, SDK/runtime and renderer were separated into review units. The renderer draft includes its API dependency until that PR merges; its renderer-only commit is independently reviewable. The 345 broader parity harnesses were not run locally. A subsequent documentation-generator whitespace fix and WIT comment correction passed all four API-reference tests.

Merge Danger

Door: Two-way. No save-format changes.

Blast Radius: Tooltips. The mod-enabled native inventory tooltip path gains bounded optional contributions.

🤖 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/2428 **Author:** [@evilchinesefood](https://github.com/evilchinesefood) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/retained-tooltip-rendering` --- ### 📝 Commits (2) - [`e6f1dd2`](https://github.com/horizon-rust/horizon/commit/e6f1dd2b8661f25300f0450f87266e0138ac4677) Add experimental retained tooltip rules to the module SDK and runtime - [`9b4ef83`](https://github.com/horizon-rust/horizon/commit/9b4ef836a45563360a2730eedf500e8c4956999d) Render retained module contributions in native item tooltips ### 📊 Changes **23 files changed** (+1089 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+7 -0) 📝 `Cargo.toml` (+1 -1) 📝 `crates/horizon-client/src/enchant.rs` (+19 -4) 📝 `crates/horizon-client/src/game/stations.rs` (+21 -0) 📝 `crates/horizon-client/src/item_tooltip.rs` (+1 -1) 📝 `crates/horizon-client/src/lib.rs` (+3 -0) ➕ `crates/horizon-client/src/mod_tooltip.rs` (+319 -0) 📝 `crates/horizon-mod-sdk/src/lib.rs` (+2 -2) 📝 `crates/horizon-mod-sdk/wit/horizon.wit` (+31 -1) 📝 `crates/horizon-mods/Cargo.toml` (+4 -0) 📝 `crates/horizon-mods/src/api_level.rs` (+14 -2) 📝 `crates/horizon-mods/src/lib.rs` (+7 -0) 📝 `crates/horizon-mods/src/manifest.rs` (+34 -2) 📝 `crates/horizon-mods/src/runtime.rs` (+27 -0) ➕ `crates/horizon-mods/src/tooltip.rs` (+171 -0) 📝 `crates/horizon-mods/tests/api_reference.rs` (+3 -0) 📝 `crates/horizon-mods/tests/sandbox.rs` (+4 -3) ➕ `crates/horizon-mods/tests/tooltip_guest/Cargo.toml` (+15 -0) ➕ `crates/horizon-mods/tests/tooltip_guest/src/lib.rs` (+73 -0) ➕ `crates/horizon-mods/tests/tooltip_sandbox.rs` (+206 -0) _...and 3 more files_ </details> ### 📄 Description > 🤖 Opened by David Ayers's AI agent (OpenAI Codex), not by David himself. ## What and why Render the retained tooltip rules registered through the preceding SDK/runtime change. Applied and stored enchantment contributions follow their matching visible vanilla enchantment in canonical order; item contributions follow vanilla details. ```text Game::stack_tooltip → visibility → exact selector → current translation → native wrapping ``` The host resolves active-language text with English fallback, omits missing keys, wraps using the existing font, and limits output to 16 lines per module and 32 total. Whole-tooltip and section hiding remain authoritative. No module function runs during hover. The host contains no enchantment-description mappings or module identities. Depends on #2426 (SDK/runtime) and #2425 (server inventory visibility). Kept as a draft until those prerequisites merge. This main-targeting PR currently includes the API commit; the [renderer-only comparison](https://github.com/evilchinesefood/horizon/compare/e6f1dd2b8661f25300f0450f87266e0138ac4677...9b4ef836a45563360a2730eedf500e8c4956999d) isolates its five client files. Rebase after #2426 merges to leave only rendering in the main comparison. It preserves the existing no-mod path. ## Vanilla reference Horizon-only contribution API, integrated into existing vanilla tooltip ordering and visibility behavior. `Enchantments::tooltip` retains its existing output; a new ID-preserving helper supplies typed selector matching. ## Self-check Five native assembly tests pass for canonical interleaving, colors, whole/section hiding, Unicode wrapping, budgets, per-hover translation resolution, English fallback and missing keys. The combined stack passed the required quick gate (below). ## Screenshots Before: with the standalone package disabled or removed, vanilla enchantment names remain and description lines are absent. After: installing the same `.hmod` adds German descriptions below matching enchantments and uses English for a missing German soul-speed description. Hidden sections suppress both the vanilla section and its contributions; creative whole hiding retains only the item name. Visual review passed 18 actual inventory-hover captures in each of the default integrated-server and in-frame paths, including restart-based disable/remove/reinstall. Screenshots were captured and visually reviewed locally; they have not been uploaded. Separate LAN clients, live UI toggles and recipe-book hover were not tested. These development-host checks do not establish released-stock compatibility. ## Publication baseline Prepared on upstream `72e678be8cc68700bc1853db058386fc5254650f`. No relevant SDK/runtime/tooltip files changed from the original validation base. The original combined-stack gate below is retained with its exact base; it is not presented as a gate run on the rebased PR heads. Public-tree/history and patch-whitespace checks passed again before publication. On the rebased combined integration tree, 24 client tooltip tests and 5 module tooltip tests passed (two pre-existing client tests ignored). ## Combined-stack gate **pr_ready** (`tools/pr_ready.py --quick --base 60109e0d911fa592b4669eeb3db10684f8b496cc` on Davids-MacBook-Pro, against 60109e0d911fa592b4669eeb3db10684f8b496cc at 60109e0d9, 9 min 31 s) | Check | Result | | --- | --- | | Scope | ⚠️ 25 files, +1309 −16; 899 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 7 s) | | tests: workspace | ✅ 2266 passed (6 min 0 s) | | doc tests | ✅ 2 passed (30 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (46 s) | | launcher tests | ✅ 137 passed (1 min 0 s) | | Parity | ➖ 345 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 333 more | The scope warning applies to the full stack. The wire, SDK/runtime and renderer were separated into review units. The renderer draft includes its API dependency until that PR merges; its renderer-only commit is independently reviewable. The 345 broader parity harnesses were not run locally. A subsequent documentation-generator whitespace fix and WIT comment correction passed all four API-reference tests. ## Merge Danger **Door:** Two-way. No save-format changes. **Blast Radius:** Tooltips. The mod-enabled native inventory tooltip path gains bounded optional contributions. 🤖 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:16:13 +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#4305
No description provided.