Charged items: revert greyed-on-cooldown override, keep RequestLayout fix - #112
Merged
Conversation
Test Results948 tests +3 948 ✅ +3 1s ⏱️ -1s Results for commit 1b2d531. ± Comparison against base commit b4b4724. This pull request removes 41 and adds 44 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Co-authored-by: argium <15852038+argium@users.noreply.github.com>
- resolveFirstItem: show icon as missing (greyed) when item has an active cooldown, regardless of showIfMissing setting. Fixes the root cause: consumed items (count = 0) now remain visible with their cooldown timer, matching UX for potions that have multiple charges. - OnBagUpdateCooldown: also call RequestLayout so the layout is re-evaluated when any item cooldown changes, ensuring icons are properly hidden once the cooldown clears and the item is still absent. - Tests: three new cases covering the new behaviour and the preserved hide-when-no-cooldown path. Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix health stones cooldown update while in combat
Fix healthstone icon not showing cooldown after use in combat
Jul 9, 2026
… charge use - resolveFirstItem: revert to showIfMissing gate only. Consumed items (count=0) are hidden regardless of active cooldown. Only showIfMissing entries remain visible as greyed icons when absent. - OnBagUpdateCooldown: keep RequestLayout call. This is the real fix for use-charge items (Healthstones with multiple charges): BAG_UPDATE_DELAYED does not fire when a charge is consumed but the item stays in the bag, so RequestLayout ensures the layout is re-evaluated and the cooldown shown. - Tests: replace "greyed with cooldown" test (wrong behaviour) with "hidden even with active cooldown" test (correct behaviour); rename RequestLayout test to accurately reflect its purpose. Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Copilot
AI
changed the title
Fix healthstone icon not showing cooldown after use in combat
Charged items: revert greyed-on-cooldown override, keep RequestLayout fix
Jul 9, 2026
argium
requested changes
Jul 10, 2026
There was a problem hiding this comment.
Pull request overview
Fixes charged-item (e.g., Healthstone) cooldown display updates by ensuring the ExtraIcons bar re-evaluates layout on BAG_UPDATE_COOLDOWN, while restoring the intended behavior that fully-consumed items (count = 0) do not remain visible/greyed unless explicitly configured (showIfMissing).
Changes:
- Trigger a layout re-evaluation on bag cooldown changes by calling
ns.Runtime.RequestLayoutinExtraIcons:OnBagUpdateCooldown. - Update/expand specs to (a) assert the new
RequestLayoutbehavior and (b) verify consumed item-stacks are hidden regardless of cooldown state. - Update Serena project configuration/documentation comments (no runtime impact).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Modules/ExtraIcons.lua | Requests layout on OnBagUpdateCooldown to keep charged items visible while their cooldown updates. |
| Tests/Modules/ExtraIcons_spec.lua | Adds coverage for the new layout request and validates consumed items are hidden with/without cooldown. |
| .serena/project.yml | Updates Serena project config comments/fields for LSP indexing/workspace folders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#111
The previous fix overcorrected: it kept consumed items (count=0) on bars as greyed icons while a cooldown was active. For use-charge items like Healthstones, the item stays in the bag (count stays >0) until all charges are spent — so the "show greyed when consumed" path was never the right fix. When the last charge is used and the item is consumed, the icon should disappear like any other item.
The actual fix is
RequestLayoutinOnBagUpdateCooldown: when a non-last charge is used,BAG_UPDATE_DELAYEDdoesn't fire (bag contents unchanged), so onlyBAG_UPDATE_COOLDOWNfires. TheRequestLayoutcall ensures layout re-evaluates and the icon stays visible with the updated cooldown.Changes
resolveFirstItem: Revert toshowIfMissinggate only. Consumed items (count=0) are always hidden unlessshowIfMissingis explicitly configured.OnBagUpdateCooldown: Unchanged —RequestLayoutcall is retained as the correct mechanism for refreshing charge-based item icons.