Repository navigation
fix(files): reach folders past the project tree's 10,000-row cap - #20523
Conversation
4e16560 to
a5cae18
Compare
a5cae18 to
d04d7b2
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check on Windows that expanding a cut folder still works there: it skips git, ignores [DESIGN-REVIEWED] 9b5c1f7 Description read[DESCRIPTION-READ] f77c897150a5a4781abe12f1469466b4382dc3030d793932cd0d0f78ae642780 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Expanding a folded "packages / core" row splits it into separate rows with no visible link between the two forms, and the cut-folder row is clipped mid-sentence. Watch
Suggestions
[UX-REVIEWED] 9b5c1f7 Description read[DESCRIPTION-READ] 3c15850903b85c69bc9b88f7fbc5f0009aa40e6b88d217b8d7e0e9b9ecb1dc4f That sha256 names everything this verdict read: the PR description, plus the 23 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The poll that re-reads loaded folders goes past the Goal: it keeps folders fresh, while the Goal only asks that they be reachable. Refresh and re-expanding already re-read them. Not justified as shipped
What this change shipsInventory (10 items) — 7 justifiedIntent: let someone working on a project with more than 10,000 items find and open any folder from the Files rail. FIX.
[FIRST-PRINCIPLES-REVIEWED] 9b5c1f7 Description read[DESCRIPTION-READ] de9520cb057fdde9e631fdda0d76b38800caa6599809c3802eb09a95b4c676e5 That sha256 names the PR description this verdict read. Recompute it with |
d04d7b2 to
63465a1
Compare
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted (Design PASS punchline: latency of sending name queries to /api/file-search)
|
63465a1 to
fa23c9d
Compare
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
ecc702e to
1268bbf
Compare
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] fixed
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted (PASS punchline)
|
|
[operator: bolichen97] Rebased onto origin/main (head 1268bbf), together with the shared search-failure map and the 404 whole-listing re-read. Re-ran locally: tsc, PierreWorkspaceTreeImpl, FileBrowserRail, FolderPanel, treeFolderListings (236 passed), docs-lint. |
1268bbf to
9b5c1f7
Compare
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted
|
|
[operator: bolichen97] rebutted (PASS punchline)
|
|
Holding at 9b5c1f7 for human review. I found no defect. This change adds a caller-supplied |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by a maintainer who read the review lane findings on this head and accepted them as follow-up work; the findings stay on the record for whoever picks them up.
Problem / Motivation
Goal: On a project with more than 10,000 items, every folder can be reached from the Files rail.
The project tree listing stops at 10,000 rows (files and folders together, #16029). On a bigger project, a folder past the cap is not a row at all. The rail's name filter only searches the rows the tree holds, so that folder cannot be found or opened from the rail.
Why it matters
Large monorepos and non-git folders are exactly the projects where the Files rail is most useful, and there it silently loses folders. The Design and UX lanes on #16029 flagged it.
Not a goal
/api/project/tree.FolderPanel), which already sends a truncated tree's query to the search.What changed (motivation → approach → change)
The cap hides folders, so the rail needs ways past it that do not raise the cap. The issue names three; this PR does the first two, which meet its acceptance (every folder reachable from the rail). Task 3, a folder-scoped "Search this folder", is split out to #20632.
GET /api/project/treetakes an optionaldir=and lists just that folder, same cap, paths still project-relative and the echoeddirredacted like every path. All the existing checks onpathrun first, unchanged. Thendirmust be a plain relative path, link-free, strictly inside the project root, and not sensitive. Otherwise it is refused (403dir_refused, 404dir_not_found, both audited). The checked folder is then pinned through the sharedpinned_fs.open_pinned_descendant_dir(_project_tree_pin; a descriptor walk refusing a link at every component, POSIX; Windows keeps that helper's documented by-name residual): the walk reads it only while it is still that folder, and git lists it from the project root with a literal pathspec instead of using it as the working directory, so an ancestor swapped for a link after the check reads nothing outside the project. Known limitation: on Windows, where git follows junctions, a folder listing takes that walk instead of git, so it does not honour.gitignorethere (heavy tool folders are still skipped).truncatedDirectoriesfetches its own listing, and the tree merges it in (pierre/treeFolderListings.ts, at most 20 per mount and 40,000 rows across them; a folder the bound drops while open is not reloaded until it is closed, so the bound cannot cycle). Folder listings are not polled on their own: each whole-tree poll that lands re-reads at most three of the loaded folders that are open, in turn (a change inside a folder past the cap is invisible to the whole listing), and Refresh re-reads them all. A listing whose latest read fails is named in a notice above the tree, also when its earlier rows are still shown, with its own Retry button. A folder that answers 404 gets "no longer exists" and one that answers 403 gets "can't be opened here: it's a link or a protected folder", each with dismiss and no retry, since none can change it. A 404 also re-reads the whole listing once, so the tree stops showing the deleted folder. This includes a folder opened through a folded chain row./api/file-search(files and folders), under the folder tab's own note (search_beyond_tree): the same budgeted search, the same caveat. The cut tree's own matching files join its hits through the folder tab's ownmergeTreeMatches, now shared inwebsite/src/lib/treeSearchMatches.ts, also when the search fails. Its failure copy is the folder tab's own map,SEARCH_FAILURE_KEYS, moved intowebsite/src/lib/searchErrorCause.tsbeside its sibling maps so both surfaces read one copy. A folder hit opens that folder in the tree; a file hit opens the file.website/src/pierre/config.ts).Files: backend in
src/kiro_crew/dashboard/file_api/project_tree.py(re-exported fromhandlers/files.py), client inwebsite/src/api/client/files.ts, rail inwebsite/src/pages/chat/FileBrowserRail.tsx, tree inwebsite/src/pierre/. Four new catalog keys (folder_listing_failed,folder_listing_retry,folder_gone,folder_refused) inwebsite/src/i18n/locales/, translated in every shipped language. The spec paragraph inlearn-cron-dashboard.mdis updated. The!config signal iswebsite/src/pierre/config.ts: it adds one CSS rule so this one state row takes the pointer.Backwards compatibility
Compatible:
diris a new, optional query parameter, andapi.projectTreegets an optional second argument. A request withoutdirtakes the same code path as before (the listing body only moved into_project_tree_listing). A gateway that ignoresdiranswers with the whole tree, which has nodirfield, and the merge skips it.Removes nothing: no route, key, field or check is removed or narrowed. The old
row_truncatedlabel stays for hosts with no folder search.Tests
test/test_project_tree_folder_listing.py::TestProjectTreeFolderListing: a folder cut by the cap is listed on its own, inside a repo too...,../outside,a/../../outside,./a,a//b,/etc,a/,a/.and a NUL are refused. A link out of the project is refused, and so is a path beneath it, with nothing outside read.TestProjectTreeFolderListingIsPinned: an ancestor swapped for a link to an outside folder right after the check lists nothing outside, on the walk (red without the pin) and on git. A sensitive folder is refused, a missing folder or a file gives 404, and an unknown project still gets 403 beforediris read.website/src/test/treeFolderListings.test.ts: merge un-cuts a loaded folder, keeps a still-cut one cut, ignores another root, and bounds the listing count and the total rows (oldest dropped, newest kept), and un-cuts folders beneath a listed folder unless its listing cuts them again. A loaded folder that answers 404 or 403 is dropped and not reloaded until closed, while its notice stays until dismissed or a later load succeeds; a revealed folder is selected.website/src/test/PierreWorkspaceTreeImpl.test.tsx("folders past the row cap"): expand loads the folder and feeds its rows. A chain row loads it and keeps it open. An open loaded folder is re-read when the whole-tree poll lands, a closed one is not, and at most three per poll. A gone (404) or refused (403) folder is dropped with its notice kept until dismissed, and one that stays open is not reloaded (the test hangs in the reload loop without the guard). A reveal loads and expands, and tells the host it was consumed so a remount cannot replay it. A failed folder listing is named in a notice whose Retry re-reads it and clears it on success; a refused one has no Retry. A folder the 20-listing bound drops while still open is not reloaded on later store events (without the guard this test runs out of memory in the reload loop).website/src/test/FileBrowserRail.test.tsx("past the tree row cap"): a whole tree keeps the local filter. A truncated tree sends the query to the search, a file hit opens and a folder hit reveals. Rows the cut tree holds that the search missed join the hits, also when the search fails. A folder hit from a Windows gateway (backslash paths) reveals.Determinism: the new frontend tests ran 3 times with
--sequence.shuffleplus the three files together shuffled. All passed.test/test_project_tree.pyandtest/test_project_tree_folder_listing.py(split out of it for the file line cap) pass with-n 0and-n 2.Manual verification
Driven in Chromium with the real rail, tree and catalogs via
website/capture/files-rail-past-tree-cap.html(/api/project/treeand/api/file-searchstubbed at fetch). Each frame was reached by typing and clicking (website/scripts/capture-files-rail-past-tree-cap.mjs). Local gates: related backend tests ran. 18 failures are host-environment ones intest_acp_spawn_offload.pyandtest_auto_improvement_members.py, and the same 18 fail on a cleanorigin/mainworktree. flake8, isort, black, mypy on the changed module, semgrep (diff-scoped), the flake ratchet,tsc, eslint andi18n:check(withI18N_BASE_REF=origin/main) are all clean. The clone has no git hooks installed, so no commit hook ran. Local AI review subagents were not dispatched; CI's review lanes are the review.Screenshots / video
Cut tree, then
packagesexpanded: its own listing brings the folders the cap hid.A name query on a cut tree searches past the cap; clicking the folder hit opens it in the tree.
A folder still cut on its own listing keeps its limit row (main's wording).
A cut folder that answers 404: its own notice says it no longer exists, with dismiss and no Retry, and the re-read tree no longer lists it. One that answers 403: its notice says it is a link or a protected folder, also dismiss only. A cut folder whose own listing fails: the notice above names it with its own Retry, the folder keeps its cut. The search in flight, and refused, with the tree's own matches kept.
Dark theme, all frames
Related Issues
Closes #16819
Follow-up: #20632 (Task 3, folder-scoped "Search this folder", split out)
Pattern harvest
Not generalizable: a capped listing needing a per-part follow-up read is specific to this tree's 10,000-row budget.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)