Repository navigation
Description
Problem
The product's scale contract for a project is explicit: a folder import is allowed to bring in up to 5000 files (ui-packages/web/src/core/folder-import.ts:4, refused only above it, line 47), and folder import is a headline feature ("Organise files in projects, bring in folders", README). But the Files panel renders every one of those rows in the DOM: the tree maps buildFileTree(files) with no windowing (ui-packages/web/src/features/resources/resource-tree.tsx:103-107), and each filter keystroke recomputes the shown set and re-renders the rows (ui-packages/web/src/features/resources/resource-panel.tsx:104-111). The codebase already virtualizes the surface with the same shape — the spreadsheet grid renders only the rows on screen (ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:34-39, @tanstack/react-virtual) — so a 5000-file library opens the session mounting thousands of FileRow buttons and types laggy into the filter on modest hardware, while a 5000-row sheet scrolls fluently. The import cap invites the scale; the one list that must absorb it is the only long list not windowed.
Proposal
- Window the Files panel tree and flat views the way the spreadsheet grid already is: render visible rows plus overscan (
@tanstack/react-virtualis already a dependency), preserving folder expand/collapse state and the filter. - Recent/Starred need nothing — they are bounded (50 recents).
- The 5000-file import cap stays as the scale contract.
Goal
After this, a project holding the import cap's 5000 files opens with the Files panel mounting only visible rows, and typing in the filter feels the same as in a 50-file project; folder expansion and the reveal-on-open behavior are unchanged.
Verification
grep -rq "useVirtualizer" ui-packages/web/src/features/resources
pnpm --filter @gamma-reader/web test --silent
pnpm checkRefs
- ui-packages/web/src/core/folder-import.ts:4,47 —
maximumFolderFiles = 5000, the scale the import path allows - ui-packages/web/src/features/resources/resource-tree.tsx:103-107 — full unwindowed tree render
- ui-packages/web/src/features/resources/resource-panel.tsx:104-111 — per-keystroke filter recompute over all files
- ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:34-39 — the virtualization pattern already in the codebase
- README.md — "Organise files in projects, bring in folders and links"
- Bound Lab cell output — one large print can freeze the reading tab #55 — same family: bound what scale can freeze the reading tab (Lab output then, the Files panel list now)
Activity
bencode commentedon Oct 22, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@ebb0ee0.Evidence audit: all citations confirmed.
core/folder-import.ts:4,47-48—maximumFolderFiles = 5000, refused astoo-manyabove it.features/resources/resource-tree.tsx:103-107— the tree renders<TreeRows nodes={buildFileTree(files)}>unwindowed;useVirtualizerappears nowhere underfeatures/resources/(repo-wide its only home issheet-grid.tsx:1,34).features/resources/resource-panel.tsx:104-111—normalizeSearchTextat :104 andshownFiles/shownEntriesrecomputed by plainfilterper keystroke (unmemoized), re-rendering every matching row.@tanstack/react-virtualis already a dependency,sheet-grid.tsx:34uses it withoverscan: 12— the exact pattern mandated for reuse. Recents are indeed bounded (50, pinned byuse-file-navigation.test.tsx:31).Duplicate check: none. #55 (closed) is the same scale family on a different surface (Lab output, not the Files panel) and is correctly cross-referenced; #69 concerns the sheet grid. No open or closed issue covers windowing the Files panel.
Sensor: lint ✓; verify ✗ on main today — for the right reason:
useVirtualizerunderfeatures/resources/passes only when the mandated reuse actually lands (deliverable-shaped, same form as #68's repaired anchor). No Verification edit needed.Verdict: valid, keep open. Two sharpening notes for implementation:
isOpen/expanded/collapsedalready define "visible", so the flattening is mechanical; the regressions to pin with a test are the reveal-on-open path (resource-tree.tsx:87-95) and folder toggle state.bencode commentedon Oct 26, 2026
Independent re-review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@23a11fc(2026-10-26), four days of commits after the last review.Evidence re-audit: all anchors still hold, zero drift.
core/folder-import.ts:4—maximumFolderFiles = 5000; refused astoo-manyat :47–48.features/resources/resource-tree.tsx:105—<TreeRows nodes={buildFileTree(files)} …>still renders the whole tree unwindowed; nouseVirtualizerunderfeatures/resources/.features/resources/resource-panel.tsx:104,110–111—normalizeSearchText+shownFiles/shownAttachmentsstill recomputed by plainfilterper keystroke.sheet-grid.tsx:34–40(useVirtualizer,overscan: 12).Sensor: lint ✓; verify ✗ on main for the right reason — the
useVirtualizergrep underfeatures/resourcespasses only when the mandated reuse lands.Commits since the last review: none touch
features/resources/orfolder-import.ts. One adjacent change to account for:93563a2(2026-10-23) reworked file-row actions into a hover overlay on.resource-row(styles.css—position: relative, actions laid over the row's end instead of a reserved column). A windowed row keeps the identical DOM, so no conflict with virtualization; the fixed row height actually makesestimateSizeexact. The overlay is the only row-level CSS coupling — a windowing change should not reintroduce a reserved actions column, or it regresses that fix.Duplicates: re-scanned open + closed titles — none. #201 (transcript windowing), #69 (sheet Ctrl+F) and #55 (closed, Lab output) are the same family on different surfaces.
Verdict: valid — stays open. Prior sharpening stands: flatten visible rows from
isOpen/expanded/collapsedbefore windowing, and pin the reveal-on-open path (resource-tree.tsxreveal flow) with a test.bencode commentedon Oct 30, 2026
Independent re-review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@d05b6b6(2026-10-28), two days of commits after the last review.Evidence re-audit: all anchors hold in substance; line drift only.
core/folder-import.ts:4—maximumFolderFiles = 5000,too-manyrefusal at :46-48 — exact.resource-tree.tsx:95—<TreeRows nodes={buildFileTree(files)} …>still renders the whole tree unwindowed (cited :103-107; moved by16ff78c).resource-panel.tsx:107,113-114—normalizeSearchText+shownFiles/shownAttachmentsstill recomputed by plainfilterper keystroke (cited :104,110-111).useVirtualizernow atxlsx-reader/sheet-grid.tsx:94(cited :34-39; moved by7f7ac7a). Still nouseVirtualizeranywhere underfeatures/resources/.Material change since the last review:
16ff78c(PR #242, 2026-10-26) reworked the tree's expansion state. Folder expansion moved intouse-folder-expansion.ts; the filtered view now auto-opens every folder holding a match, with a separatecollapsedset kept apart from hand-opened folders and reset when the filter changes (resource-tree.tsx:86-93). Two consequences for the windowing work:isOpen(:92), which already merges both regimes (unfilteredexpanded∪ filtered auto-open −collapsed) — the exact predicateTreeRowsrecurses on.collapsed. The reveal/fold test the prior review asked for should cover the filtered regime too, or windowing can silently drop it.Sensor: lint ✓; verify ✗ on main for the right reason — the
useVirtualizergrep underfeatures/resources/passes only when the mandated reuse lands.Duplicate re-scan (open + closed): none. #233 (reading pane), #201 (transcript), #275 (workbook parse) are the same family on different surfaces.
Verdict: valid — stays open. Fixed row height keeps
estimateSizeexact; the hover-overlay coupling note from last review still applies.bencode commentedon Nov 3, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @
d05b6b6— fourth pass, quiet window (0 commits since the last re-audit at the same HEAD; no issue filed in any state since 2026-11-01). Still valid; stays open; no edits.core/folder-import.ts:4maximumFolderFiles = 5000with thetoo-manyrefusal at:46-48;resource-tree.tsx:95still renders<TreeRows nodes={buildFileTree(files)}>unwindowed, anduseVirtualizerstill appears nowhere underfeatures/resources/;resource-panel.tsx:107,113-114still recomputesnormalizeSearchText+shownFiles/shownAttachmentsby plainfilterper keystroke; the reuse precedent sits intact atxlsx-reader/sheet-grid.tsx:94-100(useVirtualizer,overscan: 12).useVirtualizer-under-features/resourcesgate is red for the right reason (deliverable-shaped).isOpen(which already merges unfilteredexpanded∪ filtered auto-open −collapsed), pin the reveal/fold test across the filtered regime too, and keep the hover-overlay row DOM so the93563a2fix isn't regressed.bencode commentedon Nov 14, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @
d05b6b6— fifth pass, quiet window (0 commits since the fourth pass at the same HEAD on 2026-11-03; nothing filed in any state since #295, 2026-11-05, and it touches another surface). Still valid; stays open; no edits.core/folder-import.ts:4maximumFolderFiles = 5000with thetoo-manyrefusal at:46-49;features/resources/resource-tree.tsx:95still renders<TreeRows nodes={buildFileTree(files)}>unwindowed,isOpenstill at:92;resource-panel.tsx:107,113-114still recomputesnormalizeSearchText+shownFiles/shownAttachmentsby plainfilterper keystroke;useVirtualizerstill appears nowhere underfeatures/resources/(0 matches) while the reuse precedent sits intact atfeatures/reader/xlsx-reader/sheet-grid.tsx:94.useVirtualizer-under-features/resourcesgate is red for the right reason (deliverable-shaped).isOpen(merges unfilteredexpanded∪ filtered auto-open −collapsed), pin the reveal/fold test across the filtered regime too, and keep the hover-overlay row DOM so the93563a2fix isn't regressed.