From 14eb4091fdfbd2b0b0816b937e1412b82eba24df Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sat, 20 Jun 2026 17:51:03 -0700 Subject: [PATCH] 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. --- .../sidebar/WorktreeContextMenu.tsx | 101 +++++++++--------- src/renderer/src/i18n/locales/en.json | 3 +- src/renderer/src/i18n/locales/es.json | 3 +- src/renderer/src/i18n/locales/ja.json | 3 +- src/renderer/src/i18n/locales/ko.json | 3 +- src/renderer/src/i18n/locales/zh.json | 3 +- 6 files changed, 62 insertions(+), 54 deletions(-) diff --git a/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx b/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx index fa29c8bbd89..18aee2f5aff 100644 --- a/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx +++ b/src/renderer/src/components/sidebar/WorktreeContextMenu.tsx @@ -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} > + + {translate('auto.components.sidebar.WorktreeContextMenu.workspaceSection', 'Workspace')} + + {!isMultiContext && ( + + + {translate('auto.components.sidebar.WorktreeContextMenu.439fa94d53', 'Update')} + + )} + + + + {isMultiContext + ? translate( + 'auto.components.sidebar.WorktreeContextMenu.56cde9e8e6', + 'Move Statuses To' + ) + : translate( + 'auto.components.sidebar.WorktreeContextMenu.84cdbb7e30', + 'Move to Status' + )} + + + + {workspaceStatuses.map((status) => { + const meta = getWorkspaceStatusVisualMeta(status) + return ( + handleAssignWorkspaceStatus(status.id)} + > + + {status.label} + + ) + })} + + + + {!isMultiContext && ( <> )} - {isMultiContext && ( + {isMultiContext && hasAnyContextLineage ? ( <> - {hasAnyContextLineage && ( - - - {translate( - 'auto.components.sidebar.WorktreeContextMenu.579b1a8e61', - 'Remove from Parent' - )} - - )} + + + {translate( + 'auto.components.sidebar.WorktreeContextMenu.579b1a8e61', + 'Remove from Parent' + )} + - )} - - - - {isMultiContext - ? translate( - 'auto.components.sidebar.WorktreeContextMenu.56cde9e8e6', - 'Move Statuses To' - ) - : translate( - 'auto.components.sidebar.WorktreeContextMenu.84cdbb7e30', - 'Move to Status' - )} - - - - {workspaceStatuses.map((status) => { - const meta = getWorkspaceStatusVisualMeta(status) - return ( - handleAssignWorkspaceStatus(status.id)} - > - - {status.label} - - ) - })} - - - - {!isMultiContext && ( - - - {translate('auto.components.sidebar.WorktreeContextMenu.439fa94d53', 'Update')} - - )} - + ) : null} +