Skip to content

fix: show full file path in edit tool view#1599

Open
reverb256 wants to merge 3 commits intoPostHog:mainfrom
reverb256:fix/1194-show-edited-file-path
Open

fix: show full file path in edit tool view#1599
reverb256 wants to merge 3 commits intoPostHog:mainfrom
reverb256:fix/1194-show-edited-file-path

Conversation

@reverb256
Copy link
Copy Markdown
Contributor

Problem

When the agent edits a file, the edit tool view only shows the filename (e.g. ActionSelector.tsx), not the full path. When working across many files with the same name in different directories, this makes it hard to know which file was changed.

Fixes #1194

Solution

Updated FileMentionChip to show the relative directory path before the filename:

  • Before: 📄 ActionSelector.tsx
  • After: 📄 src/renderer/components/action-selector/ActionSelector.tsx

The directory portion uses text-gray-9 (muted) for visual hierarchy, keeping the filename prominent. Uses the existing toRelativePath utility already in the same file.

Files Changed

  • apps/code/src/renderer/features/sessions/components/session-update/FileMentionChip.tsx — 9 lines added

FileMentionChip now displays the relative directory path (muted)
before the filename, so users can see which file was edited
at a glance without expanding the diff.

Before: 📄 ActionSelector.tsx
After:  📄 src/renderer/components/action-selector/ActionSelector.tsx

The directory portion uses text-gray-9 for visual hierarchy,
keeping the filename prominent.

Fixes PostHog#1194
>
<Text size="1">
<FileIcon filename={filename} size={12} />
{directory && (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tiny nitpick: there is a bit of a gap between the two spans now, can we tighten that up a bit please?Screenshot 2026-04-09 at 1.40.20 PM.png

Copy link
Copy Markdown
Contributor

@adboio adboio left a comment

Choose a reason for hiding this comment

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

left a small comment, otherwise looks great :)

Wrap directory and filename in a single span to eliminate
whitespace gap between them.
@reverb256
Copy link
Copy Markdown
Contributor Author

Good catch! Tightened the spacing by wrapping directory and filename in a single span. Pushed the fix 👍

@reverb256
Copy link
Copy Markdown
Contributor Author

@adboio ready for re-review whenever you get a chance 👍

@reverb256
Copy link
Copy Markdown
Contributor Author

Hey @adboio 👋 Tightened the spacing between directory and filename in the latest commit. Ready for another look whenever you get a chance!

Use inline-flex on the wrapper span to collapse whitespace text
nodes between directory and filename, eliminating the visible gap.
@reverb256
Copy link
Copy Markdown
Contributor Author

Tightened the spacing — wrapped directory + separator + filename in an inline-flex span so whitespace text nodes between them are collapsed. PTAL 🙏

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.

Clearly show the edited file's path

2 participants