Skip to content

bug fix for agent folder file naming missalignment#1633

Merged
4pmtong merged 1 commit into
testfrom
fix/agent-folder-file-naming
Jun 3, 2026
Merged

bug fix for agent folder file naming missalignment#1633
4pmtong merged 1 commit into
testfrom
fix/agent-folder-file-naming

Conversation

@Douglasymlai
Copy link
Copy Markdown
Contributor

This branch fixes mismatched paths and labels between the Electron-side project file listing and the Folder tree (agent workspace): files were grouped or shown under the wrong segments because relativePath and the UI’s notion of “tree path” did not always include the file name the same way, and listing only immediate task_* directories did not match a full recursive layout.

electron/main/fileReader.ts
Before: Only scanned top-level task_* folders, walked each with getFilesRecursive, and set relativePath to the path relative to the project root but without consistently encoding the same shape the UI expects.

After: Recursively lists the whole project from the project root, sets relativePath to the full path from the project root, and parses task_id from the first task_ segment in that relative path. Sorting is simplified to a single path sort.

src/components/Folder/index.tsx
getNormalizedTreeRelativePath: When relativePath points at a directory but the file’s name is not already the last segment, it appends the file name so the tree path is not “missing” the leaf.

Breadcrumbs: Built from the same normalized path segments so labels match the tree.

Tree build: Refactors folder creation into ensureFolderNode, sorts files as before, and handles folder entries (isFolder) by creating folder nodes only (no bogus file leaf). Files are attached under the parent derived from the normalized path segments.

@4pmtong 4pmtong added this to the Sprint 23 milestone May 25, 2026
@4pmtong 4pmtong merged commit 07e51f1 into test Jun 3, 2026
1 check passed
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.

3 participants