Skip to content

fix(web): files panel right-click and drag use each folder's real path - #337

Closed
LoganRupe wants to merge 1 commit into
multi-repo-workspacesfrom
bug/335/files-panel-context-menu-real-path
Closed

LoganRupe wants to merge 1 commit into
multi-repo-workspacesfrom
bug/335/files-panel-context-menu-real-path

Conversation

@LoganRupe

Copy link
Copy Markdown
Owner

What Changed

The files panel's right-click menu and drag-to-chat now resolve a row through its own folder, the way left-click already does. Open, Reveal and Open with target the real file. Copy mention, Add to chat and dragged mentions use the absolute path, like @ search. A folder's own top-level row targets that folder.

Why

In a tree with several folders, these actions joined the folder's display name to the workspace folder. Any folder not sitting at <workspace>/<name> got the wrong target: ../notes → ideas.md copied notes/ideas.md and revealed a folder without it, and notes/2026 → plan.md copied 2026/plan.md and Reveal did nothing.

Fixes #335

UI Changes

Before (feee30e) on the left, this branch on the right. The layout from #335; right-click → Copy mention on ideas.md, then plan.md.

Video:

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Claude Opus 5.5 in Claude Code, via T3 Code.

In a multi-folder tree, the context menu and drag-to-chat built paths from
the folder's display name joined to the workspace root. They now resolve
through the row's own folder, like left-click, and mentions use the
absolute path like @ search.

Fixes #335
Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:19
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 2, 2026
@LoganRupe LoganRupe closed this Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Search-generated ancestor rows can still resolve to nonexistent filesystem paths.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes file actions and drag mentions to resolve each file-tree row against its actual folder.

Changes:

  • Adds shared row-to-filesystem path resolution.
  • Uses resolved paths for context menus and drag mentions.
  • Adds focused path-resolution and drag tests.
File Description
FileBrowserPanel.tsx Applies resolved paths to file actions and mentions.
filePath.ts Adds row-location resolution.
filePath.test.ts Tests single-root and multi-root paths.
fileTreeDragMention.ts Supports host-resolved mention paths.
fileTreeDragMention.test.ts Tests resolved and omitted drag mentions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +213 to +215
: entry.path.startsWith(`${label}/`)
? entry.path.slice(label.length + 1)
: entry.path;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants