fix(desktop): show complete repository trees - #5102
Open
evanchen7 wants to merge 3 commits into
Open
Conversation
Signed-off-by: Evan Chen <evanc@squareup.com> Co-authored-by: Codex <noreply@openai.com> Ai-assisted: true
Signed-off-by: Evan Chen <evanc@squareup.com> Co-authored-by: Codex <noreply@openai.com> Ai-assisted: true
evanchen7
marked this pull request as ready for review
August 6, 2026 21:25
Copilot stopped reviewing on behalf of
evanchen7 due to an error
August 6, 2026 21:42
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves repository browsing by paginating large folders in the UI and by ensuring the backend returns the full repository tree while limiting how many file previews are eagerly embedded.
Changes:
- Add UI pagination for repository folder entries with a “Show next” control.
- Introduce shared pagination helpers/constants for repository entry paging.
- Adjust Rust git parsing to stop truncating file lists while capping eager preview content; add a regression test.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx | Adds paginated rendering for large folders and resets paging on navigation. |
| desktop/src/features/projects/lib/projectsViewHelpers.ts | Adds page-size constant and helper to advance/clamp paging. |
| desktop/src/features/projects/lib/projectsViewHelpers.test.mjs | Adds unit test for the pagination helper. |
| desktop/src-tauri/src/commands/project_git.rs | Stops truncating returned entries; caps eager preview content and wires in Rust tests. |
| desktop/src-tauri/src/commands/project_git_tests.rs | Adds regression test ensuring paths beyond preview cap are still returned. |
Suppressed comments (1)
desktop/src-tauri/src/commands/project_git.rs:1
- The preview cap is keyed off
indexfrom.enumerate()beforefilter_map, so entries skipped byfilter_map(e.g., non-files) still consume preview slots. This can lead to fewer thanMAX_EAGER_FILE_PREVIEWSactual previews being included. Consider counting only successfully-emittedProjectRepoFileInfoitems (e.g., by moving the counter after filtering, or usingscanto increment only when a file is kept).
use super::project_git_exec::{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Evan Chen <evanc@squareup.com> Co-authored-by: Codex <noreply@openai.com> Ai-assisted: true
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.
Summary
Large repositories were silently limited to the first 250 lexicographically sorted paths, which could leave the Files tab showing only dot-directories. Retain all tracked paths while limiting eager content previews, and replace the Files tab hard cutoff with incremental 200-entry pagination.
Related issue
Fixes #4960. No duplicate PR found.
Testing
cargo test --manifest-path desktop/src-tauri/Cargo.toml parse_ls_tree_keeps_paths_after_eager_preview_limit --libnode --import ./test-loader.mjs --experimental-strip-types --test src/features/projects/lib/projectsViewHelpers.test.mjsjust cicurrently stops on pre-existing Clippy warnings incrates/buzz-acp/src/queue.rsandcrates/buzz-agent/src/hints.rs, outside this PR diffGenerated with Codex