Skip to content

Fixes incorrect folder highlighting in webview file trees#4911

Merged
d13 merged 1 commit intomainfrom
fix/4801-tree-component-same-name-folders-highlight
Feb 3, 2026
Merged

Fixes incorrect folder highlighting in webview file trees#4911
d13 merged 1 commit intomainfrom
fix/4801-tree-component-same-name-folders-highlight

Conversation

@d13
Copy link
Member

@d13 d13 commented Jan 21, 2026

Problem

Selecting a folder in the webview file tree incorrectly highlights other folders with the same name, causing confusion in navigation and selection.

Solution

  • Updates folder selection logic to use each folder's relative path for highlighting, ensuring only the intended folder is visually selected.
  • Prevents ambiguity when multiple folders share the same name but reside at different locations in the tree.

Benefit

Improves user experience and accuracy when working with nested folders in file trees within webview panels.

Fixes #4801

@augmentcode
Copy link

augmentcode bot commented Jan 21, 2026

🤖 Augment PR Summary

Summary: Fixes incorrect folder highlighting in webview file trees by using each folder’s relative path as the node identifier.
Changes: Updates commit details and patch details tree model generation (plus changelog) so folder TreeModel.path uses relativePath, avoiding collisions for same-named folders.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

branch: false,
expanded: true,
path: name,
path: relativePath,
Copy link

Choose a reason for hiding this comment

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

relativePath from makeHierarchical is built using (...parts) => parts.join('/'), which results in top-level folder paths like /foo because the seed starts as an empty string. If any consumers expect folder path values to match file.path formatting (foo/bar without a leading slash), this could cause selection/lookups to behave unexpectedly.

Other Locations
  • src/webviews/apps/plus/patchDetails/components/gl-tree-base.ts:135

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@d13 d13 added this to the 17.10 milestone Jan 21, 2026
@d13 d13 requested a review from sergeibbb January 29, 2026 15:21
Copy link
Member

@sergeibbb sergeibbb left a comment

Choose a reason for hiding this comment

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

@d13
Looks good to me

@d13 d13 force-pushed the fix/4801-tree-component-same-name-folders-highlight branch from e5621aa to 715107a Compare February 3, 2026 16:57
@d13 d13 merged commit 74ecb26 into main Feb 3, 2026
4 checks 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.

Explorer bug when two folders have the same name in the tree view

2 participants