Skip to content

feat(agent-manager): add open-file button to diff panel#6359

Open
marius-kilocode wants to merge 6 commits intomainfrom
feat/agent-manager-diff-open-file
Open

feat(agent-manager): add open-file button to diff panel#6359
marius-kilocode wants to merge 6 commits intomainfrom
feat/agent-manager-diff-open-file

Conversation

@marius-kilocode
Copy link
Collaborator

Summary

  • Adds an "Open file" icon button to each file header in the agent-manager diff panel
  • Clicking the button opens the file in VS Code, resolved against the correct worktree path
  • Worktree path resolution is handled extension-side in AgentManagerProvider via a dedicated agentManager.openFile message, keeping the webview free of path construction logic

Changes

  • DiffPanel.tsx: Added onOpenFile callback prop and an IconButton (using the existing open-file icon) in each accordion file header
  • AgentManagerApp.tsx: Passes onOpenFile handler that sends agentManager.openFile with session ID and relative path
  • AgentManagerProvider.ts: New openWorktreeFile() method that resolves the worktree path from the session state and opens the file via vscode.workspace.openTextDocument

Each file in the git diff accordion now has an open-file icon button
that opens the file in VS Code, resolved against the correct worktree
path. The worktree path resolution happens extension-side in
AgentManagerProvider via a dedicated agentManager.openFile message.
Addresses all three review comments:
- Prefix-matching bypass: appends path.sep for directory boundary check
- Symlink traversal: fs.realpathSync resolves both root and target
- Cross-platform: path.sep/path.resolve/realpathSync are Windows-aware
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.

1 participant