Skip to content

Make inventory item viewport scrollable (fix Space Age overflow)#16

Open
olafrose wants to merge 1 commit into
wormeyman:wormeyman-space-age-supportfrom
olafrose:fix/inventory-scroll
Open

Make inventory item viewport scrollable (fix Space Age overflow)#16
olafrose wants to merge 1 commit into
wormeyman:wormeyman-space-age-supportfrom
olafrose:fix/inventory-scroll

Conversation

@olafrose

Copy link
Copy Markdown

Problem

The InventoryDialog is a fixed 404×442 panel. With Space Age, item groups (e.g. logistics) contain far more items than fit in the fixed height, and there was no clipping or scrolling — so the lower rows overflowed, were drawn over by the recipe panel, and could not be reached.

Fix

In packages/editor/src/UI/InventoryDialog.ts:

  • Add a PixiJS mask over the items viewport so content clips cleanly to the dialog bounds.
  • Add mouse-wheel scrolling of the active group's items, clamped to the content bounds.
  • Add a scrollbar thumb that reflects scroll position and hides when a group's contents fit.
  • Refresh the scrollbar when switching groups (resets sensibly per group).

No changes to the dialog's outer dimensions, so surrounding layout is unaffected.

Testing

  • Verified in the running dev build (Space Age data):
    • Logistics (overflowing) → scrollbar appears, wheel scrolls, clamps at top and bottom, last row reachable.
    • Production (fits) → no scrollbar, all items visible.
    • Switching group tabs resets to top and refreshes the scrollbar.
  • npm run type-check → 0 errors; vp lint / vp fmt --check clean for the changed file.

🤖 Generated with Claude Code

Space Age groups contain far more items than fit in the fixed-height
InventoryDialog (404x442). Previously the overflowing rows were hidden
with no way to reach them, since Panel does no clipping and the recipe
panel drew over the lower rows.

Add a PixiJS mask over the items viewport so content clips cleanly,
mouse-wheel scrolling clamped to the content bounds, and a scrollbar
thumb that reflects scroll position and hides when a group fits. The
scrollbar refreshes on group switch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant