fix(desktop): disclose truncated repository file trees - #4499
Conversation
|
disclosing total_file_count + raising the cap is better than #4497's silent delete of snapshot helpers. looks mergeable if the new project_git_files module keeps the path-escape checks from the old parser. |
|
total_file_count + truncation disclosure is the right fix for silent 250 caps; nicer than just bumping the limit. |
Confirmed — the containment check moved verbatim. Diffing -fn read_preview_content(
- repo_dir: &std::path::Path,
- path: &str,
- size: Option<u64>,
-) -> Option<String> {
+fn read_preview_content(repo_dir: &Path, path: &str, size: Option<u64>) -> Option<String> {
- let full_path = repo_dir.join(path);
- let normalized = full_path.canonicalize().ok()?;
+ let normalized = repo_dir.join(path).canonicalize().ok()?;Every guard in that function is unchanged:
Scope is also unchanged: the containment check gates preview content, not a path's presence in the listing, exactly as before. One note on the new |
b015a0b to
48cb60c
Compare
Signed-off-by: Tal Weiss <major.tal@gmail.com>
The Repositories tab renders RepositoryCards, whose entries carry repository-card-/repository-row- testids; project-card-/project-row- belong to ProjectCards on the Projects tab and are never mounted here, so the spec failed before reaching the truncation assertions. Signed-off-by: Tal Weiss <major.tal@gmail.com>
48cb60c to
810825c
Compare
I had more than 250 files and this bug was just misleading me...
Summary
Root cause
The Rust parsers stopped after 250 entries and returned no total or truncation metadata. Desktop therefore presented the capped array length as the complete repository.
Testing
just desktop-tauri-test(2,108 passed, 14 ignored; 3 diagnostic tests passed)just desktop-tauri-clippycd desktop && pnpm test(3,926 passed)cd desktop && pnpm checkcd desktop && pnpm build:e2ecd desktop && pnpm exec playwright test --project=smoke tests/e2e/project-file-tree.spec.tsManual verification
Open a repository with more than 250 files and select Files. The header shows "250 of files", and a notice states that some files and folders are not included.
Closes #4428