From 6a06d57a953a8f184c5ad5293454c7af3d328149 Mon Sep 17 00:00:00 2001 From: wienans <40465543+wienans@users.noreply.github.com> Date: Wed, 7 Jan 2026 20:50:48 +0100 Subject: [PATCH] Add Copy Worktree Path in More Icon for Agent Manager (#115) --- .../views/agent-manager/AgentGroupDetail.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/ui/src/components/views/agent-manager/AgentGroupDetail.tsx b/packages/ui/src/components/views/agent-manager/AgentGroupDetail.tsx index 03d4594c..29700338 100644 --- a/packages/ui/src/components/views/agent-manager/AgentGroupDetail.tsx +++ b/packages/ui/src/components/views/agent-manager/AgentGroupDetail.tsx @@ -4,6 +4,7 @@ import { RiArrowDownSLine, RiCheckLine, RiMore2Line, + RiFileCopyLine, } from '@remixicon/react'; import { toast } from 'sonner'; import { Button } from '@/components/ui/button'; @@ -82,6 +83,21 @@ export const AgentGroupDetail: React.FC = ({ // Check if the current OpenCode session matches the selected agent group session const isSessionSynced = selectedSession?.id === currentSessionId; + const handleCopyWorktreePath = React.useCallback(() => { + if (!selectedSession?.path) { + toast.error('No worktree path available'); + return; + } + navigator.clipboard + .writeText(selectedSession.path) + .then(() => { + toast.success('Worktree path copied'); + }) + .catch(() => { + toast.error('Failed to copy path'); + }); + }, [selectedSession?.path]); + const handleRemoveSelectedWorktree = React.useCallback(async () => { if (!selectedSession) return; setWorktreeDialog({ kind: 'remove', path: selectedSession.path, label: selectedSession.displayLabel }); @@ -234,6 +250,16 @@ export const AgentGroupDetail: React.FC = ({ > Leave this one, remove others + { + e.stopPropagation(); + handleCopyWorktreePath(); + }} + disabled={!selectedSession?.path} + > + + Copy Worktree Path +