perf(sheet): avoid full inventory description rebuild on targeted refresh #127
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Athemis/ds4#127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Reduce the amount of work required to refresh inventory state after consume-related changes. Right now inventory refresh still runs through sheet context preparation that enriches every item description, even when only a single consumable row changed. That means consume-triggered rerenders can scale with the full actor inventory instead of the one item that was updated.
A follow-up should avoid rebuilding expensive per-item display data for unrelated inventory entries when the consume path only needs to refresh one part of the sheet.
Context
Evidence:
src/apps/actor/base-sheet.js:121tosrc/apps/actor/base-sheet.js:137loops over all actor items during_prepareContext().src/apps/actor/base-sheet.js:128enriches every item description viaenrichItemDescription(item).templates/sheets/actor/parts/inventory-tab.hbs:7totemplates/sheets/actor/parts/inventory-tab.hbs:13shows thatinventory-tabcovers the full inventory area, not just consumables.This looks more like a sheet-architecture hotspot than a consume-specific bug, but consume actions trigger it frequently enough to merit its own follow-up issue.