Skip to content

Fix Map tab showing no read/written files on Windows - #15

Open
Nekoraru22 wants to merge 1 commit into
yessGlory17:mainfrom
Nekoraru22:fix/map-windows-paths
Open

Nekoraru22 wants to merge 1 commit into
yessGlory17:mainfrom
Nekoraru22:fix/map-windows-paths

Conversation

@Nekoraru22

Copy link
Copy Markdown

Fix Map tab showing no read/written files on Windows

Problem

On Windows, the Map tab always shows READ 0 / WRITTEN 0 and only renders the top-level folders, even when the session contains Read/Write/Edit steps. The root node also displays the full path (c:\Users\...\project) instead of just the folder name.

Cause

MapTab.tsx decides whether a file belongs to the project with:

if (fp.startsWith(cwdNorm + '/'))

On Windows both cwd and file_path use backslashes (c:\Users\...), so this check never matches and every absolute path falls into the else { continue; } branch. All file events are dropped.

A second mismatch makes it worse: VS Code often reports the cwd with a lowercase drive letter (c:\) while tool calls use uppercase (C:\), so even with matching separators a plain string comparison fails.

The root node name and the cwd label use cwd.split('/'), which returns the whole path when there are no forward slashes.

Fix

  • Normalise both cwd and file_path to forward slashes before comparing.
  • Compare drive-letter paths case-insensitively (Windows paths are case-insensitive). The relative path keeps its original casing for display.
  • Split cwd on /[\\/]/ for the root node name and the cwd label.

POSIX paths behave exactly as before.

Testing

  • npm run compile, npm run build:webview and npm run lint pass (no new warnings).
  • Checked the path logic against:
    • cwd c:\Users\Neko\...\project + file C:\Users\Neko\...\project\data\agents.jsondata/agents.json
    • cwd c:\...\project + file c:/.../project/src/App.tsxsrc/App.tsx
    • cwd /home/a/proj + file /home/a/proj/src/x.tssrc/x.ts (unchanged)
    • cwd /home/a/proj + file /etc/x → skipped (unchanged)
  • Installed the packaged .vsix on Windows 11 with a Claude Code session started from the VS Code extension.

Notes

Other components extract file names with path.split('/').pop() (FlowTab, InsightsTab, GlobalSearch, DependencyGraph, sessionListViewProvider) and will show full Windows paths instead of file names. I kept this PR focused on the Map tab, but I'm happy to follow up with a shared path helper if you'd like.

Images

Before:
image

After:
image

@yessGlory17

Copy link
Copy Markdown
Owner

Congratulations 🎉 I’ll merge your pull request as soon as I’m available and include it in the next release.

Are you enjoying using my extension? And are there any new feature ideas that you think would be useful?

@Nekoraru22

Copy link
Copy Markdown
Author

Yeah it's pretty nice! thank you

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.

2 participants