Move workspace options to the top of worktree context menu (#5948)
Move the "Update" and "Move to Status" options under a new "Workspace" section header at the very top of the worktree context menu. This improves usability and groups workspace-management actions together.
This commit is contained in:
parent
a856dee5d9
commit
14eb4091fd
|
|
@ -4,6 +4,7 @@ import {
|
|||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuRadioGroup,
|
||||
DropdownMenuRadioItem,
|
||||
DropdownMenuSeparator,
|
||||
|
|
@ -653,6 +654,47 @@ const WorktreeContextMenu = React.memo(function WorktreeContextMenu({
|
|||
onClickCapture={suppressOpeningPointerEvent}
|
||||
onCloseAutoFocus={handleCloseAutoFocus}
|
||||
>
|
||||
<DropdownMenuLabel className="px-2 py-1 text-[11px] font-medium text-muted-foreground">
|
||||
{translate('auto.components.sidebar.WorktreeContextMenu.workspaceSection', 'Workspace')}
|
||||
</DropdownMenuLabel>
|
||||
{!isMultiContext && (
|
||||
<DropdownMenuItem onSelect={handleRename} disabled={isDeleting}>
|
||||
<Pencil className="size-3.5" />
|
||||
{translate('auto.components.sidebar.WorktreeContextMenu.439fa94d53', 'Update')}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger disabled={deletingContext}>
|
||||
<Kanban className="size-3.5" />
|
||||
{isMultiContext
|
||||
? translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.56cde9e8e6',
|
||||
'Move Statuses To'
|
||||
)
|
||||
: translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.84cdbb7e30',
|
||||
'Move to Status'
|
||||
)}
|
||||
</DropdownMenuSubTrigger>
|
||||
<DropdownMenuSubContent className="w-44">
|
||||
<DropdownMenuRadioGroup value={contextWorkspaceStatus}>
|
||||
{workspaceStatuses.map((status) => {
|
||||
const meta = getWorkspaceStatusVisualMeta(status)
|
||||
return (
|
||||
<DropdownMenuRadioItem
|
||||
key={status.id}
|
||||
value={status.id}
|
||||
onSelect={() => handleAssignWorkspaceStatus(status.id)}
|
||||
>
|
||||
<meta.icon className={cn('size-3.5', meta.tone)} />
|
||||
{status.label}
|
||||
</DropdownMenuRadioItem>
|
||||
)
|
||||
})}
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuSub>
|
||||
<DropdownMenuSeparator />
|
||||
{!isMultiContext && (
|
||||
<>
|
||||
<WorktreeOpenInSubMenu
|
||||
|
|
@ -765,58 +807,19 @@ const WorktreeContextMenu = React.memo(function WorktreeContextMenu({
|
|||
)}
|
||||
</>
|
||||
)}
|
||||
{isMultiContext && (
|
||||
{isMultiContext && hasAnyContextLineage ? (
|
||||
<>
|
||||
{hasAnyContextLineage && (
|
||||
<DropdownMenuItem onSelect={handleRemoveParentLink} disabled={deletingContext}>
|
||||
<Unlink className="size-3.5" />
|
||||
{translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.579b1a8e61',
|
||||
'Remove from Parent'
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuItem onSelect={handleRemoveParentLink} disabled={deletingContext}>
|
||||
<Unlink className="size-3.5" />
|
||||
{translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.579b1a8e61',
|
||||
'Remove from Parent'
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
</>
|
||||
)}
|
||||
<DropdownMenuSub>
|
||||
<DropdownMenuSubTrigger disabled={deletingContext}>
|
||||
<Kanban className="size-3.5" />
|
||||
{isMultiContext
|
||||
? translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.56cde9e8e6',
|
||||
'Move Statuses To'
|
||||
)
|
||||
: translate(
|
||||
'auto.components.sidebar.WorktreeContextMenu.84cdbb7e30',
|
||||
'Move to Status'
|
||||
)}
|
||||
</DropdownMenuSubTrigger>
|
||||
<DropdownMenuSubContent className="w-44">
|
||||
<DropdownMenuRadioGroup value={contextWorkspaceStatus}>
|
||||
{workspaceStatuses.map((status) => {
|
||||
const meta = getWorkspaceStatusVisualMeta(status)
|
||||
return (
|
||||
<DropdownMenuRadioItem
|
||||
key={status.id}
|
||||
value={status.id}
|
||||
onSelect={() => handleAssignWorkspaceStatus(status.id)}
|
||||
>
|
||||
<meta.icon className={cn('size-3.5', meta.tone)} />
|
||||
{status.label}
|
||||
</DropdownMenuRadioItem>
|
||||
)
|
||||
})}
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuSubContent>
|
||||
</DropdownMenuSub>
|
||||
{!isMultiContext && (
|
||||
<DropdownMenuItem onSelect={handleRename} disabled={isDeleting}>
|
||||
<Pencil className="size-3.5" />
|
||||
{translate('auto.components.sidebar.WorktreeContextMenu.439fa94d53', 'Update')}
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
<DropdownMenuSeparator />
|
||||
) : null}
|
||||
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<DropdownMenuItem
|
||||
|
|
|
|||
|
|
@ -3877,7 +3877,8 @@
|
|||
"697d0f6e1b": "Unpin",
|
||||
"250de158fd": "Remove Workspace",
|
||||
"changeParentWorkspace": "Change Parent Worktree...",
|
||||
"setParentWorkspace": "Set Parent Worktree..."
|
||||
"setParentWorkspace": "Set Parent Worktree...",
|
||||
"workspaceSection": "Workspace"
|
||||
},
|
||||
"WorktreeList": {
|
||||
"7a8b9c0d1e": "Update required",
|
||||
|
|
|
|||
|
|
@ -3863,7 +3863,8 @@
|
|||
"697d0f6e1b": "Desprender",
|
||||
"250de158fd": "Remove Workspace",
|
||||
"changeParentWorkspace": "Cambiar árbol de trabajo padre...",
|
||||
"setParentWorkspace": "Establecer árbol de trabajo padre..."
|
||||
"setParentWorkspace": "Establecer árbol de trabajo padre...",
|
||||
"workspaceSection": "Espacio de trabajo"
|
||||
},
|
||||
"WorktreeList": {
|
||||
"d880ea0744": "Crea un grupo y mueve este proyecto a él.",
|
||||
|
|
|
|||
|
|
@ -3844,7 +3844,8 @@
|
|||
"697d0f6e1b": "固定を解除する",
|
||||
"250de158fd": "Remove Workspace",
|
||||
"changeParentWorkspace": "親ワークツリーを変更...",
|
||||
"setParentWorkspace": "親ワークツリーを設定..."
|
||||
"setParentWorkspace": "親ワークツリーを設定...",
|
||||
"workspaceSection": "ワークスペース"
|
||||
},
|
||||
"WorktreeList": {
|
||||
"d880ea0744": "グループを作成し、このプロジェクトをそのグループに移動します。",
|
||||
|
|
|
|||
|
|
@ -3844,7 +3844,8 @@
|
|||
"697d0f6e1b": "고정 해제",
|
||||
"250de158fd": "워크스페이스 제거",
|
||||
"changeParentWorkspace": "상위 워크트리 변경...",
|
||||
"setParentWorkspace": "상위 워크트리 설정..."
|
||||
"setParentWorkspace": "상위 워크트리 설정...",
|
||||
"workspaceSection": "워크스페이스"
|
||||
},
|
||||
"WorktreeList": {
|
||||
"d880ea0744": "그룹을 만들고 이 프로젝트를 그룹으로 이동하세요.",
|
||||
|
|
|
|||
|
|
@ -3844,7 +3844,8 @@
|
|||
"697d0f6e1b": "取消固定",
|
||||
"250de158fd": "移除工作区",
|
||||
"changeParentWorkspace": "更改父工作树...",
|
||||
"setParentWorkspace": "设置父工作树..."
|
||||
"setParentWorkspace": "设置父工作树...",
|
||||
"workspaceSection": "工作区"
|
||||
},
|
||||
"WorktreeList": {
|
||||
"d880ea0744": "创建一个组并将该项目移入其中。",
|
||||
|
|
|
|||
Loading…
Reference in New Issue