Skip to content

fix(desktop): show complete repository trees - #5102

Open
evanchen7 wants to merge 3 commits into
mainfrom
evanc/4960-repo-file-truncation
Open

fix(desktop): show complete repository trees#5102
evanchen7 wants to merge 3 commits into
mainfrom
evanc/4960-repo-file-truncation

Conversation

@evanchen7

Copy link
Copy Markdown

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

  • Targeted Rust regression: cargo test --manifest-path desktop/src-tauri/Cargo.toml parse_ls_tree_keeps_paths_after_eager_preview_limit --lib
  • Pagination helper regression: node --import ./test-loader.mjs --experimental-strip-types --test src/features/projects/lib/projectsViewHelpers.test.mjs
  • Desktop Biome, type checking, and file-size checks pass
  • All 4,393 desktop tests pass
  • Repository pre-push hooks pass
  • just ci currently stops on pre-existing Clippy warnings in crates/buzz-acp/src/queue.rs and crates/buzz-agent/src/hints.rs, outside this PR diff

Generated with Codex

evanchen7 and others added 2 commits August 6, 2026 09:06
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 evanchen7 closed this Aug 6, 2026
@evanchen7 evanchen7 reopened this Aug 6, 2026
@evanchen7
evanchen7 requested a lite review from Copilot August 6, 2026 21:25
@evanchen7
evanchen7 marked this pull request as ready for review August 6, 2026 21:25
@evanchen7
evanchen7 requested a review from a team as a code owner August 6, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 index from .enumerate() before filter_map, so entries skipped by filter_map (e.g., non-files) still consume preview slots. This can lead to fewer than MAX_EAGER_FILE_PREVIEWS actual previews being included. Consider counting only successfully-emitted ProjectRepoFileInfo items (e.g., by moving the counter after filtering, or using scan to 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.

Comment thread desktop/src-tauri/src/commands/project_git.rs
Comment thread desktop/src/features/projects/ui/ProjectRepositoryPanel.tsx
Signed-off-by: Evan Chen <evanc@squareup.com>
Co-authored-by: Codex <noreply@openai.com>
Ai-assisted: true
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.

GH Repo directories and files aren't being picked up by the relay

2 participants