diff --git a/apps/emdash-desktop/src/renderer/features/tasks/task-titlebar.tsx b/apps/emdash-desktop/src/renderer/features/tasks/task-titlebar.tsx index 0e830e1fe2..b9aad97f8c 100644 --- a/apps/emdash-desktop/src/renderer/features/tasks/task-titlebar.tsx +++ b/apps/emdash-desktop/src/renderer/features/tasks/task-titlebar.tsx @@ -30,10 +30,18 @@ import { import { ConnectionStatusDot } from '@renderer/lib/components/connection-status-dot'; import { OpenInMenu } from '@renderer/lib/components/titlebar/open-in-menu'; import { Titlebar } from '@renderer/lib/components/titlebar/Titlebar'; +import { toast } from '@renderer/lib/hooks/use-toast'; import { rpc } from '@renderer/lib/ipc'; import { useNavigate } from '@renderer/lib/layout/navigation-provider'; +import { useShowModal } from '@renderer/lib/modal/modal-provider'; import { Badge } from '@renderer/lib/ui/badge'; import { Button } from '@renderer/lib/ui/button'; +import { + ContextMenu, + ContextMenuContent, + ContextMenuItem, + ContextMenuTrigger, +} from '@renderer/lib/ui/context-menu'; import { MicroLabel } from '@renderer/lib/ui/label'; import { Popover, PopoverContent, PopoverTrigger } from '@renderer/lib/ui/popover'; import { Separator } from '@renderer/lib/ui/separator'; @@ -106,6 +114,7 @@ const ActiveTaskTitlebar = observer(function ActiveTaskTitlebar({ const taskPayload = getRegisteredTaskData(projectId, taskId); const workspace = useWorkspace(); const taskView = useWorkspaceViewModel(); + const showRename = useShowModal('renameTaskModal'); const { hasUpstream, @@ -133,6 +142,28 @@ const ActiveTaskTitlebar = observer(function ActiveTaskTitlebar({ if (!taskStore || !taskPayload) return null; const isRemoteProject = projectStore?.data.type === 'ssh'; + const branchName = workspace.gitWorktree.branchName; + const handleRename = () => + showRename({ + projectId, + taskId, + currentName: taskStore.data.name, + }); + const handleCopyBranchName = async () => { + if (!branchName) return; + + try { + await navigator.clipboard.writeText(branchName); + toast({ title: 'Branch name copied' }); + } catch { + toast({ + title: 'Copy failed', + description: 'The branch name could not be copied to the clipboard.', + variant: 'destructive', + }); + } + }; + return ( / - - - - {taskDisplayName(taskStore)} - - - - - } - /> - Link to issue - + + + + + + {taskDisplayName(taskStore)} + + + + + } + /> + Link to issue + + + + void handleCopyBranchName()} disabled={!branchName}> + Copy branch name + + Rename + +
Task @@ -168,7 +209,7 @@ const ActiveTaskTitlebar = observer(function ActiveTaskTitlebar({
- {workspace.gitWorktree.branchName} + {branchName}
{hasUpstream ? (