perf(sheet): avoid full inventory description rebuild on targeted refresh #127

Closed
opened 2026-03-15 18:52:01 +00:00 by Athemis · 0 comments
Owner

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:121 to src/apps/actor/base-sheet.js:137 loops over all actor items during _prepareContext().
  • src/apps/actor/base-sheet.js:128 enriches every item description via enrichItemDescription(item).
  • templates/sheets/actor/parts/inventory-tab.hbs:7 to templates/sheets/actor/parts/inventory-tab.hbs:13 shows that inventory-tab covers 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.

### 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:121` to `src/apps/actor/base-sheet.js:137` loops over all actor items during `_prepareContext()`. - `src/apps/actor/base-sheet.js:128` enriches every item description via `enrichItemDescription(item)`. - `templates/sheets/actor/parts/inventory-tab.hbs:7` to `templates/sheets/actor/parts/inventory-tab.hbs:13` shows that `inventory-tab` covers 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.
Athemis self-assigned this 2026-03-15 20:18:21 +00: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
Athemis/ds4#127
No description provided.