From 0f7658d77c06ada39bf109b298ecbe11f4f4f1ee Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Tue, 7 Jul 2026 12:12:00 -0700 Subject: [PATCH] Make center split divider more visible (#7701) * fix: address review findings * Improve split divider contrast and refactor tab split context menus - Increase contrast of `--tab-group-split-divider` colors in light and dark modes to achieve at least 3:1 contrast against `--card`. - Refactor `TerminalTabSplitMenuSection` to use the shared `TabWorkspaceLayoutMenuSection` for moving tabs between splits. - Clarify terminal-specific split action labels in the context menu. - Remove redundant icon margins in `EditorFileTabContextMenu`. --- src/renderer/src/assets/main.css | 56 ++++++++++++++ .../components/tab-bar/BrowserTab.test.tsx | 15 ++++ .../src/components/tab-bar/BrowserTab.tsx | 23 +++--- .../components/tab-bar/EditorFileTab.test.tsx | 18 +++++ .../tab-bar/EditorFileTabContextMenu.test.tsx | 24 ++++++ .../tab-bar/EditorFileTabContextMenu.tsx | 32 ++++++-- .../SortableTab.rename-shortcut.test.tsx | 24 ++++++ .../tab-bar/SortableTabContextMenu.test.tsx | 16 +++- .../tab-bar/SortableTabContextMenu.tsx | 61 +++++++--------- .../tab-bar/TabWorkspaceLayoutMenuSection.tsx | 24 +++++- .../tab-bar/TerminalTabSplitMenuSection.tsx | 73 +++++++++++++++++++ .../components/tab-group/TabGroupPanel.tsx | 16 +++- .../tab-group/TabGroupSplitLayout.tsx | 32 +++++++- 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 + 18 files changed, 368 insertions(+), 61 deletions(-) create mode 100644 src/renderer/src/components/tab-bar/TerminalTabSplitMenuSection.tsx diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index f028b6413..b77b58a5c 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -101,6 +101,8 @@ --color-status-success: var(--status-success); --color-status-success-background: var(--status-success-background); --color-status-success-border: var(--status-success-border); + --color-tab-group-split-divider: var(--tab-group-split-divider); + --color-tab-group-split-divider-strong: var(--tab-group-split-divider-strong); --color-git-graph-ref: var(--git-graph-ref); --color-git-graph-remote-ref: var(--git-graph-remote-ref); --color-git-graph-base-ref: var(--git-graph-base-ref); @@ -202,6 +204,11 @@ --git-graph-lane-4: #40b0a6; --git-graph-lane-5: #b66dff; --annotation-highlight: #f59e0b; + /* Why: tab-group splits use a dedicated divider — `--border` is too faint on + card/editor surfaces when panes are side-by-side or stacked. Default must + meet >=3:1 against `--card`, not only the hover/drag strong state. */ + --tab-group-split-divider: #868690; + --tab-group-split-divider-strong: #71717a; } /* ── Dark Mode ───────────────────────────────────────── */ @@ -285,6 +292,9 @@ --git-graph-lane-4: #40b0a6; --git-graph-lane-5: #b66dff; --annotation-highlight: #fbbf24; + /* Brighter than terminal defaults so the always-visible line clears 3:1 on `--card`. */ + --tab-group-split-divider: #71717a; + --tab-group-split-divider-strong: #a1a1aa; } .linear-priority-bars { @@ -618,6 +628,52 @@ overflow: hidden; } +/* Tab-group split resize handle — wide hit area, visible center line. */ +.tab-group-split-resize-handle { + flex-shrink: 0; + position: relative; + background: transparent; +} + +.tab-group-split-resize-handle.is-vertical { + width: 6px; + cursor: col-resize; +} + +.tab-group-split-resize-handle.is-horizontal { + height: 6px; + cursor: row-resize; +} + +.tab-group-split-resize-handle::after { + content: ''; + position: absolute; + border-radius: 1px; + background: var(--tab-group-split-divider); + transition: background 100ms ease; +} + +.tab-group-split-resize-handle.is-vertical::after { + top: 0; + bottom: 0; + left: 50%; + width: 3px; + transform: translateX(-50%); +} + +.tab-group-split-resize-handle.is-horizontal::after { + left: 0; + right: 0; + top: 50%; + height: 3px; + transform: translateY(-50%); +} + +.tab-group-split-resize-handle:hover::after, +.tab-group-split-resize-handle.is-dragging::after { + background: var(--tab-group-split-divider-strong); +} + /* ── Titlebar ────────────────────────────────────────── */ /* Why: Radix portals (dropdowns, popovers, dialogs, sheets) render at the diff --git a/src/renderer/src/components/tab-bar/BrowserTab.test.tsx b/src/renderer/src/components/tab-bar/BrowserTab.test.tsx index f4dc863f8..2dfd84d87 100644 --- a/src/renderer/src/components/tab-bar/BrowserTab.test.tsx +++ b/src/renderer/src/components/tab-bar/BrowserTab.test.tsx @@ -42,6 +42,18 @@ vi.mock('@dnd-kit/sortable', () => ({ })) vi.mock('lucide-react', () => ({ + ArrowDown: function ArrowDown(props: Record) { + return { type: 'ArrowDown', props } + }, + ArrowLeft: function ArrowLeft(props: Record) { + return { type: 'ArrowLeft', props } + }, + ArrowRight: function ArrowRight(props: Record) { + return { type: 'ArrowRight', props } + }, + ArrowUp: function ArrowUp(props: Record) { + return { type: 'ArrowUp', props } + }, Columns2: function Columns2(props: Record) { return { type: 'Columns2', props } }, @@ -60,6 +72,9 @@ vi.mock('lucide-react', () => ({ PinOff: function PinOff(props: Record) { return { type: 'PinOff', props } }, + PanelRightClose: function PanelRightClose(props: Record) { + return { type: 'PanelRightClose', props } + }, Rows2: function Rows2(props: Record) { return { type: 'Rows2', props } }, diff --git a/src/renderer/src/components/tab-bar/BrowserTab.tsx b/src/renderer/src/components/tab-bar/BrowserTab.tsx index 0dfb97a9a..45bc82e79 100644 --- a/src/renderer/src/components/tab-bar/BrowserTab.tsx +++ b/src/renderer/src/components/tab-bar/BrowserTab.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { useSortable } from '@dnd-kit/sortable' -import { Globe, X, ExternalLink, Copy, Pin, PinOff } from 'lucide-react' +import { Globe, X, ExternalLink, Copy, Pin, PinOff, PanelRightClose } from 'lucide-react' import { DropdownMenu, DropdownMenuContent, @@ -279,37 +279,36 @@ export default function BrowserTab({ sideOffset={0} align="start" > + - + {translate('auto.components.tab.bar.BrowserTab.5d6e89891f', 'Duplicate Tab')} - {isPinned ? ( - - ) : ( - - )} + {isPinned ? : } {isPinned ? translate('auto.components.tab.bar.BrowserTab.c5aaee8c39', 'Unpin Tab') : translate('auto.components.tab.bar.BrowserTab.911542656f', 'Pin Tab')} - !isPinned && onClose()} disabled={isPinned}> + {translate('auto.components.tab.bar.BrowserTab.1611a1324b', 'Close')} + {translate('auto.components.tab.bar.BrowserTab.9dd880bd56', 'Close Tabs To The Right')} void window.api.shell.openUrl(openInBrowserUrl)} disabled={!isHttpUrl} > - + {translate('auto.components.tab.bar.BrowserTab.6e0bc8f3a8', 'Open In Browser')} diff --git a/src/renderer/src/components/tab-bar/EditorFileTab.test.tsx b/src/renderer/src/components/tab-bar/EditorFileTab.test.tsx index 59a1c18bc..66071a7da 100644 --- a/src/renderer/src/components/tab-bar/EditorFileTab.test.tsx +++ b/src/renderer/src/components/tab-bar/EditorFileTab.test.tsx @@ -58,6 +58,18 @@ vi.mock('@dnd-kit/sortable', () => ({ })) vi.mock('lucide-react', () => ({ + ArrowDown: function ArrowDown(props: Record) { + return { type: 'ArrowDown', props } + }, + ArrowLeft: function ArrowLeft(props: Record) { + return { type: 'ArrowLeft', props } + }, + ArrowRight: function ArrowRight(props: Record) { + return { type: 'ArrowRight', props } + }, + ArrowUp: function ArrowUp(props: Record) { + return { type: 'ArrowUp', props } + }, Columns2: function Columns2(props: Record) { return { type: 'Columns2', props } }, @@ -70,6 +82,12 @@ vi.mock('lucide-react', () => ({ Eye: function Eye(props: Record) { return { type: 'Eye', props } }, + ListX: function ListX(props: Record) { + return { type: 'ListX', props } + }, + PanelRightClose: function PanelRightClose(props: Record) { + return { type: 'PanelRightClose', props } + }, GitCompareArrows: function GitCompareArrows(props: Record) { return { type: 'GitCompareArrows', props } }, diff --git a/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx b/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx index 8167bdbda..092574986 100644 --- a/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx +++ b/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx @@ -36,12 +36,33 @@ vi.mock('@/components/ui/dropdown-menu', () => ({ })) vi.mock('lucide-react', () => ({ + ArrowDown: function ArrowDown(props: Record) { + return { type: 'ArrowDown', props } + }, + ArrowLeft: function ArrowLeft(props: Record) { + return { type: 'ArrowLeft', props } + }, + ArrowRight: function ArrowRight(props: Record) { + return { type: 'ArrowRight', props } + }, + ArrowUp: function ArrowUp(props: Record) { + return { type: 'ArrowUp', props } + }, Copy: function Copy(props: Record) { return { type: 'Copy', props } }, ExternalLink: function ExternalLink(props: Record) { return { type: 'ExternalLink', props } }, + Eye: function Eye(props: Record) { + return { type: 'Eye', props } + }, + ListX: function ListX(props: Record) { + return { type: 'ListX', props } + }, + PanelRightClose: function PanelRightClose(props: Record) { + return { type: 'PanelRightClose', props } + }, Columns2: function Columns2(props: Record) { return { type: 'Columns2', props } }, @@ -56,6 +77,9 @@ vi.mock('lucide-react', () => ({ }, PinOff: function PinOff(props: Record) { return { type: 'PinOff', props } + }, + X: function X(props: Record) { + return { type: 'X', props } } })) diff --git a/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx b/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx index 184c05d2d..bbf9a75d7 100644 --- a/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx +++ b/src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx @@ -1,4 +1,14 @@ -import { Copy, ExternalLink, Pencil, Pin, PinOff } from 'lucide-react' +import { + Copy, + ExternalLink, + Eye, + ListX, + PanelRightClose, + Pencil, + Pin, + PinOff, + X +} from 'lucide-react' import { DropdownMenu, DropdownMenuContent, @@ -107,6 +117,11 @@ export function EditorFileTabContextMenu({ event.preventDefault() }} > + { @@ -115,24 +130,25 @@ export function EditorFileTabContextMenu({ onOpenRenameInput() }} > - + {translate('auto.components.tab.bar.EditorFileTabContextMenu.68cc610e7f', 'Rename')} {renameShortcut ? {renameShortcut} : null} - {isPinned ? : } + {isPinned ? : } {isPinned ? translate('auto.components.tab.bar.EditorFileTabContextMenu.8e9d603a09', 'Unpin Tab') : translate('auto.components.tab.bar.EditorFileTabContextMenu.fdd29eb669', 'Pin Tab')} - !isPinned && onClose()} disabled={isPinned}> + {translate('auto.components.tab.bar.EditorFileTabContextMenu.1ba8492c5b', 'Close')} {closeShortcut ? {closeShortcut} : null} + {translate( 'auto.components.tab.bar.EditorFileTabContextMenu.ba1369dd24', 'Close All Editor Tabs' @@ -142,6 +158,7 @@ export function EditorFileTabContextMenu({ ) : null} + {translate( 'auto.components.tab.bar.EditorFileTabContextMenu.e5ff31ccaf', 'Close Tabs To The Right' @@ -165,6 +182,7 @@ export function EditorFileTabContextMenu({ ) }} > + {translate( 'auto.components.tab.bar.EditorFileTabContextMenu.bfd5797ef4', 'Open Markdown Preview' @@ -178,7 +196,7 @@ export function EditorFileTabContextMenu({ void window.api.ui.writeClipboardText(file.filePath) }} > - + {translate('auto.components.tab.bar.EditorFileTabContextMenu.5b85754786', 'Copy Path')} - + {translate( 'auto.components.tab.bar.EditorFileTabContextMenu.52ce4f4605', 'Copy Relative Path' @@ -208,7 +226,7 @@ export function EditorFileTabContextMenu({ window.api.shell.openPath(file.filePath) }} > - + {revealLabel} diff --git a/src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx b/src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx index bb4e757d1..d183891b6 100644 --- a/src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx +++ b/src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx @@ -72,6 +72,18 @@ vi.mock('@dnd-kit/sortable', () => ({ })) vi.mock('lucide-react', () => ({ + ArrowDown: function ArrowDown(props: Record) { + return { type: 'ArrowDown', props } + }, + ArrowLeft: function ArrowLeft(props: Record) { + return { type: 'ArrowLeft', props } + }, + ArrowRight: function ArrowRight(props: Record) { + return { type: 'ArrowRight', props } + }, + ArrowUp: function ArrowUp(props: Record) { + return { type: 'ArrowUp', props } + }, Columns2: function Columns2(props: Record) { return { type: 'Columns2', props } }, @@ -84,6 +96,15 @@ vi.mock('lucide-react', () => ({ PanelRightClose: function PanelRightClose(props: Record) { return { type: 'PanelRightClose', props } }, + ListX: function ListX(props: Record) { + return { type: 'ListX', props } + }, + MessageSquare: function MessageSquare(props: Record) { + return { type: 'MessageSquare', props } + }, + Pencil: function Pencil(props: Record) { + return { type: 'Pencil', props } + }, Pin: function Pin(props: Record) { return { type: 'Pin', props } }, @@ -95,6 +116,9 @@ vi.mock('lucide-react', () => ({ }, X: function X(props: Record) { return { type: 'X', props } + }, + SquareTerminal: function SquareTerminal(props: Record) { + return { type: 'SquareTerminal', props } } })) diff --git a/src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx b/src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx index 71b067fa8..6fb148212 100644 --- a/src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx +++ b/src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx @@ -50,10 +50,20 @@ vi.mock('@/components/ui/dropdown-menu', () => ({ })) vi.mock('lucide-react', () => ({ + ArrowDown: () => null, + ArrowLeft: () => null, + ArrowRight: () => null, + ArrowUp: () => null, + Columns2: () => null, + ListX: () => null, + MessageSquare: () => null, PanelBottomClose: () => null, PanelRightClose: () => null, + Pencil: () => null, Pin: () => null, - PinOff: () => null + PinOff: () => null, + SquareTerminal: () => null, + X: () => null })) vi.mock('@/i18n/i18n', () => ({ @@ -218,6 +228,7 @@ describe('SortableTabContextMenu', () => { const { container } = renderMenu() expect(container.textContent).toContain('Move Tab to Split') + expect(container.textContent).toContain('Split terminal') act(() => getButton(container, 'Right').click()) expect(storeMock.dropUnifiedTab).toHaveBeenCalledWith('tab-1', { @@ -226,7 +237,7 @@ describe('SortableTabContextMenu', () => { }) }) - it('hides split actions for a single-tab group', () => { + it('hides move-tab split actions for a single-tab group', () => { storeMock.state = { ...storeMock.state, groupsByWorktree: { @@ -243,5 +254,6 @@ describe('SortableTabContextMenu', () => { const { container } = renderMenu() expect(container.textContent).not.toContain('Move Tab to Split') + expect(container.textContent).toContain('Split terminal right') }) }) diff --git a/src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx b/src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx index f93afd46d..469c4f715 100644 --- a/src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx +++ b/src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx @@ -1,10 +1,12 @@ import { MessageSquare, - PanelBottomClose, PanelRightClose, Pin, PinOff, - SquareTerminal + Pencil, + SquareTerminal, + X, + ListX } from 'lucide-react' import { DropdownMenu, @@ -18,8 +20,7 @@ import type { TerminalTab } from '../../../../shared/types' import { useAppStore } from '../../store' import { formatShortcutLabel, useOptionalShortcutLabel } from '@/hooks/useShortcutLabel' import { translate } from '@/i18n/i18n' -import { TabWorkspaceLayoutMenuSection } from './TabWorkspaceLayoutMenuSection' -import { requestActiveTerminalPaneSplit } from './request-active-terminal-pane-split' +import { TerminalTabSplitMenuSection } from './TerminalTabSplitMenuSection' const TAB_COLORS = [ { @@ -138,12 +139,6 @@ export function SortableTabContextMenu({ const splitRightShortcut = formatShortcutLabel('terminal.splitRight', keybindings) const splitDownShortcut = formatShortcutLabel('terminal.splitDown', keybindings) - const splitActiveTerminalPane = (direction: 'vertical' | 'horizontal'): void => { - if (!isActive) { - onActivate(tab.id) - } - requestActiveTerminalPaneSplit({ tabId: tab.id, direction }) - } const closeShortcut = useOptionalShortcutLabel('tab.close') const renameShortcut = useOptionalShortcutLabel('tab.rename') @@ -158,13 +153,23 @@ export function SortableTabContextMenu({ /> - {canToggleViewMode && onToggleViewMode && ( + + {canToggleViewMode && onToggleViewMode ? ( <> + {isChatView ? ( - + ) : ( - + )} {isChatView ? translate( @@ -176,42 +181,31 @@ export function SortableTabContextMenu({ 'Switch to chat view' )} - - )} - splitActiveTerminalPane('vertical')}> - - {translate( - 'auto.components.tab.bar.SortableTabContextMenu.splitTerminalRight', - 'Split terminal right' - )} - {splitRightShortcut} - - splitActiveTerminalPane('horizontal')}> - - {translate( - 'auto.components.tab.bar.SortableTabContextMenu.splitTerminalDown', - 'Split terminal down' - )} - {splitDownShortcut} - - + ) : null} - {isPinned ? : } + {isPinned ? ( + + ) : ( + + )} {isPinned ? translate('auto.components.tab.bar.SortableTabContextMenu.417722e9c2', 'Unpin Tab') : translate('auto.components.tab.bar.SortableTabContextMenu.60f958ec75', 'Pin Tab')} !isPinned && onClose(tab.id)} disabled={isPinned}> + {translate('auto.components.tab.bar.SortableTabContextMenu.89359a36f7', 'Close')} {closeShortcut ? {closeShortcut} : null} onCloseOthers(tab.id)} disabled={tabCount <= 1}> + {translate('auto.components.tab.bar.SortableTabContextMenu.8d16f9cd30', 'Close Others')} onCloseToRight(tab.id)} disabled={!hasTabsToRight}> + {translate( 'auto.components.tab.bar.SortableTabContextMenu.c1ee099c7e', 'Close Tabs To The Right' @@ -219,6 +213,7 @@ export function SortableTabContextMenu({ + {translate('auto.components.tab.bar.SortableTabContextMenu.2f697b3c31', 'Change Title')} {renameShortcut ? {renameShortcut} : null} diff --git a/src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx b/src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx index 819bb6d32..b1ae2d1cf 100644 --- a/src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx +++ b/src/renderer/src/components/tab-bar/TabWorkspaceLayoutMenuSection.tsx @@ -5,12 +5,26 @@ import { DropdownMenuSubTrigger, DropdownMenuItem } from '@/components/ui/dropdown-menu' +import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Columns2 } from 'lucide-react' import type { TabSplitDirection } from '../../store/slices/tabs' import { translate } from '@/i18n/i18n' import { canMoveTabToNewPaneColumn, moveTabToNewPaneColumn } from './tab-move-to-pane-column' const PANE_COLUMN_DIRECTIONS: TabSplitDirection[] = ['right', 'left', 'down', 'up'] +function paneColumnDirectionIcon(direction: TabSplitDirection): React.JSX.Element { + switch (direction) { + case 'right': + return + case 'left': + return + case 'down': + return + case 'up': + return + } +} + function paneColumnDirectionLabel(direction: TabSplitDirection): string { switch (direction) { case 'right': @@ -26,10 +40,12 @@ function paneColumnDirectionLabel(direction: TabSplitDirection): string { export function TabWorkspaceLayoutMenuSection({ unifiedTabId, - groupId + groupId, + trailingSeparator = false }: { unifiedTabId: string groupId: string + trailingSeparator?: boolean }): React.JSX.Element | null { if (!canMoveTabToNewPaneColumn(unifiedTabId, groupId)) { return null @@ -37,9 +53,9 @@ export function TabWorkspaceLayoutMenuSection({ return ( <> - - + + {translate( 'auto.components.tab.bar.TabWorkspaceLayoutMenuSection.moveToPaneColumn', 'Move Tab to Split' @@ -53,11 +69,13 @@ export function TabWorkspaceLayoutMenuSection({ moveTabToNewPaneColumn({ unifiedTabId, groupId, direction }) }} > + {paneColumnDirectionIcon(direction)} {paneColumnDirectionLabel(direction)} ))} + {trailingSeparator ? : null} ) } diff --git a/src/renderer/src/components/tab-bar/TerminalTabSplitMenuSection.tsx b/src/renderer/src/components/tab-bar/TerminalTabSplitMenuSection.tsx new file mode 100644 index 000000000..7b75e42f4 --- /dev/null +++ b/src/renderer/src/components/tab-bar/TerminalTabSplitMenuSection.tsx @@ -0,0 +1,73 @@ +import { + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger +} from '@/components/ui/dropdown-menu' +import { PanelBottomClose, PanelRightClose, SquareTerminal } from 'lucide-react' +import { translate } from '@/i18n/i18n' +import { TabWorkspaceLayoutMenuSection } from './TabWorkspaceLayoutMenuSection' +import { requestActiveTerminalPaneSplit } from './request-active-terminal-pane-split' + +export function TerminalTabSplitMenuSection({ + unifiedTabId, + groupId, + tabId, + isActive, + onActivate, + splitRightShortcut, + splitDownShortcut, + trailingSeparator = false +}: { + unifiedTabId: string + groupId: string + tabId: string + isActive: boolean + onActivate: (tabId: string) => void + splitRightShortcut: string + splitDownShortcut: string + trailingSeparator?: boolean +}): React.JSX.Element { + const splitActiveTerminalPane = (direction: 'vertical' | 'horizontal'): void => { + if (!isActive) { + onActivate(tabId) + } + requestActiveTerminalPaneSplit({ tabId, direction }) + } + + return ( + <> + + + + + {translate( + 'auto.components.tab.bar.TerminalTabSplitMenuSection.splitTerminal', + 'Split terminal' + )} + + + splitActiveTerminalPane('vertical')}> + + {translate( + 'auto.components.tab.bar.SortableTabContextMenu.splitTerminalRight', + 'Split terminal right' + )} + {splitRightShortcut} + + splitActiveTerminalPane('horizontal')}> + + {translate( + 'auto.components.tab.bar.SortableTabContextMenu.splitTerminalDown', + 'Split terminal down' + )} + {splitDownShortcut} + + + + {trailingSeparator ? : null} + + ) +} diff --git a/src/renderer/src/components/tab-group/TabGroupPanel.tsx b/src/renderer/src/components/tab-group/TabGroupPanel.tsx index 57dbf5946..e6f237c9b 100644 --- a/src/renderer/src/components/tab-group/TabGroupPanel.tsx +++ b/src/renderer/src/components/tab-group/TabGroupPanel.tsx @@ -29,6 +29,10 @@ export default function TabGroupPanel({ hasSplitGroups, touchesRightEdge, touchesLeftEdge, + touchesBottomEdge = false, + suppressLeftBorder = false, + suppressRightBorder = false, + suppressBottomBorder = false, reserveClosedExplorerToggleSpace, reserveCollapsedSidebarHeaderSpace, isTabDragActive = false, @@ -40,6 +44,10 @@ export default function TabGroupPanel({ hasSplitGroups: boolean touchesRightEdge: boolean touchesLeftEdge: boolean + touchesBottomEdge?: boolean + suppressLeftBorder?: boolean + suppressRightBorder?: boolean + suppressBottomBorder?: boolean reserveClosedExplorerToggleSpace: boolean reserveCollapsedSidebarHeaderSpace: boolean isTabDragActive?: boolean @@ -205,7 +213,13 @@ export default function TabGroupPanel({ // border-l/border-r in those spots stacks a second 1px line // next to it, reading as a ~2px bar below the drag strip // (where the sibling border continues alone above). - ` ${touchesLeftEdge ? '' : 'border-l'} ${touchesRightEdge ? '' : 'border-r'} border-border border-b ${isFocused ? 'border-b-accent' : 'opacity-95'}` + ` ${ + touchesLeftEdge || suppressLeftBorder ? '' : 'border-l' + } ${touchesRightEdge || suppressRightBorder ? '' : 'border-r'} ${ + touchesBottomEdge || suppressBottomBorder ? '' : 'border-b' + } border-border ${ + isFocused && !touchesBottomEdge && !suppressBottomBorder ? 'border-b-accent' : '' + } ${isFocused ? '' : 'opacity-95'}` : '' }`} onPointerDown={commands.focusGroup} diff --git a/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx b/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx index db37a19d2..04cc65362 100644 --- a/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx +++ b/src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx @@ -103,9 +103,9 @@ function ResizeHandle({ return (
) @@ -121,6 +121,10 @@ function SplitNode({ touchesTopEdge, touchesRightEdge, touchesLeftEdge, + touchesBottomEdge, + suppressLeftBorder, + suppressRightBorder, + suppressBottomBorder, isTabDragActive, hoveredTabInsertion }: { @@ -133,6 +137,10 @@ function SplitNode({ touchesTopEdge: boolean touchesRightEdge: boolean touchesLeftEdge: boolean + touchesBottomEdge: boolean + suppressLeftBorder: boolean + suppressRightBorder: boolean + suppressBottomBorder: boolean isTabDragActive: boolean hoveredTabInsertion: HoveredTabInsertion | null }): React.JSX.Element { @@ -152,6 +160,10 @@ function SplitNode({ hasSplitGroups={hasSplitGroups} touchesRightEdge={touchesRightEdge} touchesLeftEdge={touchesLeftEdge} + touchesBottomEdge={touchesBottomEdge} + suppressLeftBorder={suppressLeftBorder} + suppressRightBorder={suppressRightBorder} + suppressBottomBorder={suppressBottomBorder} reserveClosedExplorerToggleSpace={touchesTopEdge && touchesRightEdge} reserveCollapsedSidebarHeaderSpace={touchesTopEdge && touchesLeftEdge} isTabDragActive={isTabDragActive} @@ -181,6 +193,12 @@ function SplitNode({ touchesTopEdge={touchesTopEdge} touchesRightEdge={isHorizontal ? false : touchesRightEdge} touchesLeftEdge={touchesLeftEdge} + touchesBottomEdge={isHorizontal ? touchesBottomEdge : false} + suppressLeftBorder={suppressLeftBorder} + // Why: the resize handle paints the inner seam — pane borders here + // stack into a triple-line bar beside the divider. + suppressRightBorder={isHorizontal ? true : suppressRightBorder} + suppressBottomBorder={isHorizontal ? suppressBottomBorder : true} isTabDragActive={isTabDragActive} hoveredTabInsertion={hoveredTabInsertion} /> @@ -201,6 +219,10 @@ function SplitNode({ touchesTopEdge={isHorizontal ? touchesTopEdge : false} touchesRightEdge={touchesRightEdge} touchesLeftEdge={isHorizontal ? false : touchesLeftEdge} + touchesBottomEdge={touchesBottomEdge} + suppressLeftBorder={isHorizontal ? true : suppressLeftBorder} + suppressRightBorder={suppressRightBorder} + suppressBottomBorder={suppressBottomBorder} isTabDragActive={isTabDragActive} hoveredTabInsertion={hoveredTabInsertion} /> @@ -275,6 +297,10 @@ export default function TabGroupSplitLayout({ touchesTopEdge={true} touchesRightEdge={true} touchesLeftEdge={true} + touchesBottomEdge={false} + suppressLeftBorder={false} + suppressRightBorder={false} + suppressBottomBorder={false} isTabDragActive={dragSplit.activeDrag !== null} hoveredTabInsertion={dragSplit.hoveredTabInsertion} /> diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 7ea7146ec..d15a81c46 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -2771,6 +2771,9 @@ "EditorFileTabCloseButton": { "4655cf570e": "Close tab", "a768f428f1": "Close tab" + }, + "TerminalTabSplitMenuSection": { + "splitTerminal": "Split terminal" } } }, diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index cc51dd41b..84d5a861a 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -2771,6 +2771,9 @@ "EditorFileTabCloseButton": { "4655cf570e": "Cerrar pestaña", "a768f428f1": "Cerrar pestaña" + }, + "TerminalTabSplitMenuSection": { + "splitTerminal": "Split terminal" } } }, diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index a70953da3..20e253a58 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -2771,6 +2771,9 @@ "EditorFileTabCloseButton": { "4655cf570e": "タブを閉じる", "a768f428f1": "タブを閉じる" + }, + "TerminalTabSplitMenuSection": { + "splitTerminal": "Split terminal" } } }, diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 511f3b1e3..cd83a58fa 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -2771,6 +2771,9 @@ "EditorFileTabCloseButton": { "4655cf570e": "탭 닫기", "a768f428f1": "탭 닫기" + }, + "TerminalTabSplitMenuSection": { + "splitTerminal": "Split terminal" } } }, diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index d46dfc98f..5be008913 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -2771,6 +2771,9 @@ "EditorFileTabCloseButton": { "4655cf570e": "关闭选项卡", "a768f428f1": "关闭选项卡" + }, + "TerminalTabSplitMenuSection": { + "splitTerminal": "Split terminal" } } },