bug fix for agent folder file naming missalignment#1633
Open
Douglasymlai wants to merge 1 commit into
Open
Conversation
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.
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.tsBefore: 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.tsxgetNormalizedTreeRelativePath: 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.