fix(editor): cap the function-tree category grid so the item list stays reachable - #593
Merged
Merged
Conversation
…ys reachable The root-category grid is `grid shrink-0` with `aspect-square` tiles over `functionTree`, which is embedder-supplied and unbounded. Row count grows with the taxonomy while the item list below is the only scroller, so past about 20 categories at 5 columns the list is pushed out of the panel and nothing can scroll it back. Same shape as the hosted "By room" panel bug in #562. `furnishTools` (the other header in this panel family) is a static 6-item array, so it cannot reach this state; this one can, because the array crosses the embedding boundary. Cap the grid at 40% of panel height and let it scroll independently. No visual change at today's category counts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The defensive fix I offered @yanrin13 in #562. That issue's bug is in our hosted
RoomsPanel, which isn't in this repo — but the same layout shape exists here and is reachable.The shape
FunctionTreePanelrenders root categories asgrid shrink-0 grid-cols-5withaspect-squaretiles (function-tree-panel.tsx:124), above the only scroller in the panel:Column count is fixed at 5, so row count is
ceil(functionTree.length / 5)and each row is as tall as it is wide. Because the header isshrink-0,flex-1on the list resolves toward zero as the header grows — past roughly 20 categories the list is off-panel with no way to scroll it back.Why this one and not its sibling
The other header in this panel family,
furnishTools(items-panel/index.tsx:197), is the sameshrink-0pattern but is a static 6-item array inui/action-menu/furnish-tools.tsx— bounded by code, so it can't reach this state. I left it alone.functionTreeis different: it's a prop, supplied by the embedder (items-panel/index.tsx:60,functionTree: FunctionTreeNode[]), so its length crosses the embedding boundary and this package can't bound it. That's exactly the invariant #562 broke — a header whose height is driven by data rather than by code.Fix
The header degrades to scrolling instead of consuming the panel. No visual change at today's category counts —
max-honly engages once the grid would exceed 40% of panel height.One note: I first wrote this with
subtle-scrollbar, the class the hosted app and several components here use alongsideoverflow-y-auto. It has no definition anywhere in this repo — it comes from the hosted app's stylesheet — so including it would have been a silent no-op. Dropped it; the scrollbar is the browser default, consistent with other open-source-side scrollers.Gates
check1600 files clean ·check-types9/9 ·test12/12🤖 Generated with Claude Code
Note
Low Risk
Small layout/CSS fix in the items sidebar with no auth, data, or API changes.
Overview
Caps the embedder-supplied root category tile grid in
FunctionTreePanelso a largefunctionTreecannot grow the header past the panel and squeeze the item list to zero height.The root grid gains
max-h-[40%]andoverflow-y-auto, so extra categories scroll inside the header instead of stealing space from the only main scroller below. A comment documents thatfunctionTreeis unbounded andaspect-squaretiles make row count scale with data.No behavior change at typical category counts—the limit only applies when the grid would exceed ~40% of panel height.
Reviewed by Cursor Bugbot for commit 9382208. Bugbot is set up for automated code reviews on this repo. Configure here.