feat(ui): drive toolbar use state from selection

Port the retail selected-object availability predicate into Core and project it through the shared interaction owner. The imported hand now follows canonical selection/object notices, keeps weapon and targeted-tool activation on the existing wield/use cursor paths, and ghosts empty or explicitly unusable selections per the connected UX requirement.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-23 08:07:47 +02:00
parent 0134122c28
commit 60387668d0
11 changed files with 269 additions and 16 deletions

View file

@ -12,14 +12,14 @@ The active work order is
It closes six remaining retail interaction surfaces before larger M4 subsystem
bodies begin: spell-bar overflow controls, status-bar Use/Assess commands,
assessment information, equipped-child picking, vendor browsing, and
server-authoritative vendor transactions. Slice 1 is active and ports the
DAT-authored arrow-only favorite-spell scrollbar through the shared retained
scrollbar/list model. The corrected import preserves authored arrow sides and
rollover/pressed media, passive refresh preserves manual offsets, and the
mixed-parent DAT anchor chain produces the fixed retail capacity of 18 visible
favorite cells (nine numbered plus nine unnumbered). Its
implementation and complete Release suite pass; connected overflow-arrow
visual acceptance is pending.
server-authoritative vendor transactions. Slice 1's DAT-authored arrow-only
favorite-spell scrollbar, fixed 18-cell capacity, authored arrow sides/media,
and persistent manual offset passed the connected gate. Slice 2 is active: the
status hand now follows canonical selection/object notices, ghosts empty and
unusable selections, and routes enabled weapons, direct-use items, and
use-on-target tools through the existing interaction transaction and cursor
owners. Its connected hand-state gate is pending; the magnifying-glass Assess
command follows in the same slice.
---

View file

@ -89,6 +89,11 @@ transactions. This is deliberately using the extracted interaction owners and
canonical shared main-panel host before quest/emote/character-creation bodies
broaden the feature surface.
Slice 1's 18-cell favorite-spell overflow bar is user-accepted. Slice 2 is
active: the status hand's selected-object availability and existing
Use/AutoWield/use-on-target command routing are code-complete, with the
connected state/cursor gate pending before the Assess half continues.
Carried:
#153 far-teleport residual, #116 slide-response, the remaining R6 ownership cleanup plus
registered TS-50/TS-51/TS-53 timing residuals (the complete-root-Frame/object-workset

View file

@ -1,6 +1,7 @@
# World interaction completion — pre-M4 program
**Status:** Slice 1 code-complete 2026-07-23; connected visual gate pending.
**Status:** Slice 1 user-accepted 2026-07-23. Slice 2 Use-hand state and command
path code-complete; connected visual gate pending before Assess continues.
**Milestone:** M4 prerequisite/preamble.
**Architecture:** retained gameplay UI over shared selection, object, and
interaction state. `GameWindow` remains a composition/callback shell.
@ -52,9 +53,21 @@ spells. Passive object/endowment refresh preserves a manual offset. The mixed
producing exactly 18 visible 32-pixel favorite cells (nine numbered plus nine
unnumbered) without consuming the overflow. The initial 57-test/full-suite gate passed;
the corrective 104-test focus set, 3,472 App tests / 3 skips, Release solution
build, and 7,845 complete-solution tests / 5 skips pass. The connected gate is
pending after user feedback on arrow sides, rollover, width, and offset
persistence.
build, and 7,845 complete-solution tests / 5 skips pass. The corrected
18-cell bar and both overflow directions passed the connected gate.
Slice 2 now drives the toolbar hand from canonical `SelectionState` changes and
live `ClientObjectTable` updates. The pure Core predicate ports
`gmToolbarUI::HandleSelectionChanged`: combat-use items, armor/clothing/jewelry,
and `ItemUses` values without `USEABLE_NO` remain active. Clicking still enters
the existing `ItemInteractionController` command path, so weapons use the
server-confirmed AutoWield transaction and targeted tools enter the existing
use-on-target cursor. Empty selection and explicitly unusable spell components
are ghosted and ignore clicks. Empty-selection ghosting is the user's explicit
choice over retail's generic `TARGET_MODE_USE` entry and is registered as
AP-122. The 14-test Core interaction focus, 49-test toolbar focus, Release
solution build, 3,474 App tests / 3 skips, and 7,848 complete-solution tests /
5 skips pass.
## Slice 1 — spell-bar overflow arrows
@ -115,3 +128,27 @@ Named retail references and executable pseudocode are recorded in
- Existing stack, combat-power, chat, inventory, spellbook, and external
container scrollbars retain their current behavior.
- No substantial feature body enters `GameWindow`.
## Slice 2 — status Use/Assess commands
### Use-hand implementation
1. `ItemInteractionPolicy.IsToolbarUseEnabled` is the pure named-retail
selection predicate.
2. `ItemInteractionController.IsToolbarUseEnabled` adapts the selected live
object without triggering a request or consuming the use throttle.
3. `ToolbarController` subscribes to canonical `SelectionState.Changed` and
selected-object add/update/remove notices, then sets the imported button's
normal or ghosted state through `UiButton.Enabled`.
4. Enabled clicks retain the one existing activation path:
equipment enters `AutoWieldController`, ordinary use enters the normal Use
request owner, and targeted items enter `UseItemOnTarget`, which already
owns the retail target cursor.
### Remaining Slice 2 work
- Port the magnifying-glass Assess command state and activation.
- Run the connected Use-hand visual gate: no selection, spell component,
weapon, and health kit.
- Continue directly into the Assess information slice after the combined
status-control gate.