diff --git a/src/renderer/src/components/feature-wall/FeatureTourPreview.tsx b/src/renderer/src/components/feature-wall/FeatureTourPreview.tsx index 8f42e4f40c5..3c05f393078 100644 --- a/src/renderer/src/components/feature-wall/FeatureTourPreview.tsx +++ b/src/renderer/src/components/feature-wall/FeatureTourPreview.tsx @@ -12,6 +12,7 @@ import { FEATURE_TOUR_PREVIEW_COPY } from './feature-tour-preview-copy' import { FeatureTourWorkspaceCard } from './FeatureTourWorkspaceCard' +import { TerminalFrame } from './FeatureTourTerminalFrame' import { translate } from '@/i18n/i18n' export { FEATURE_TOUR_PREVIEW_COPY } from './feature-tour-preview-copy' @@ -291,125 +292,6 @@ function TasksFrame(): JSX.Element { ) } -function TerminalFrame(): JSX.Element { - return ( -
-
- {translate( - 'auto.components.feature.wall.FeatureTourPreview.1aa8a9a24a', - 'Splittable terminal' - )} -
-
-
- - - - - {translate('auto.components.feature.wall.FeatureTourPreview.04d54d50ec', 'orca · zsh')} - -
-
-
-
- $ - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.6218a9014d', - 'pnpm playwright test' - )} - -
-
-
- {translate( - 'auto.components.feature.wall.FeatureTourPreview.8279e9d95b', - 'Running 12 tests' - )} -
-
- ✓ - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.24fedd5a52', - 'login.spec.ts' - )} - -
-
- - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.6ed43cb0e0', - 'dashboard.spec.ts' - )} - -
-
-
-
-
- $ - - {translate('auto.components.feature.wall.FeatureTourPreview.771d8881c2', 'claude')} - -
-
-
- - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.952d3ddd9a', - 'session started' - )} - -
-
- - {translate('auto.components.feature.wall.FeatureTourPreview.1170621527', '>')} - - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.ef8b164dd1', - 'review src/auth' - )} - -
-
- - - {translate( - 'auto.components.feature.wall.FeatureTourPreview.304ad0dfc1', - 'Thinking...' - )} - -
-
-
-
-
-
- ) -} - export function FeatureTourPreview(props: { className?: string }): JSX.Element { return (
+
+ {translate( + 'auto.components.feature.wall.FeatureTourPreview.1aa8a9a24a', + 'Splittable terminal' + )} +
+
+
+ + + + + {translate('auto.components.feature.wall.FeatureTourPreview.04d54d50ec', 'orca · zsh')} + +
+
+
+
+ $ + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.6218a9014d', + 'pnpm playwright test' + )} + +
+
+
+ {translate( + 'auto.components.feature.wall.FeatureTourPreview.8279e9d95b', + 'Running 12 tests' + )} +
+
+ ✓ + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.24fedd5a52', + 'login.spec.ts' + )} + +
+
+ + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.6ed43cb0e0', + 'dashboard.spec.ts' + )} + +
+
+
+
+
+ $ + + {translate('auto.components.feature.wall.FeatureTourPreview.771d8881c2', 'claude')} + +
+
+
+ + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.952d3ddd9a', + 'session started' + )} + +
+
+ + {translate('auto.components.feature.wall.FeatureTourPreview.1170621527', '>')} + + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.ef8b164dd1', + 'review src/auth' + )} + +
+
+ + + {translate( + 'auto.components.feature.wall.FeatureTourPreview.304ad0dfc1', + 'Thinking...' + )} + +
+
+
+
+
+
+ ) +} diff --git a/src/renderer/src/components/settings/TerminalWindowSection.tsx b/src/renderer/src/components/settings/TerminalWindowSection.tsx index 79deff85d0c..9feaeba68dc 100644 --- a/src/renderer/src/components/settings/TerminalWindowSection.tsx +++ b/src/renderer/src/components/settings/TerminalWindowSection.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from 'react' import { RotateCw } from 'lucide-react' -import type { GlobalSettings, TerminalColorOverrides } from '../../../../shared/types' +import type { GlobalSettings } from '../../../../shared/types' import { Button } from '../ui/button' import { Label } from '../ui/label' import { ColorField, NumberField } from './SettingsFormControls' @@ -8,354 +8,13 @@ import { SearchableSetting } from './SearchableSetting' import { clampNumber } from '@/lib/terminal-theme' import { useMountedRef } from '@/hooks/useMountedRef' import { translate } from '@/i18n/i18n' +import { COLOR_OVERRIDE_GROUPS } from './terminal-color-override-groups' type TerminalWindowSectionProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void } -const COLOR_OVERRIDE_GROUPS: { - label: string - keys: { key: keyof TerminalColorOverrides; label: string; description: string }[] -}[] = [ - { - get label() { - return translate('auto.components.settings.TerminalWindowSection.cf37ff69f6', 'Base') - }, - keys: [ - { - key: 'foreground', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.79f6bfb76e', - 'Foreground' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.026a0b8013', - 'Main text color' - ) - } - }, - { - key: 'background', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.cc1b2ffeb2', - 'Background' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.da64e8f4c1', - 'Terminal background color' - ) - } - }, - { - key: 'cursor', - get label() { - return translate('auto.components.settings.TerminalWindowSection.c9e1fdf42f', 'Cursor') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.cd0700762b', - 'Cursor color' - ) - } - }, - { - key: 'cursorAccent', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.a2d9f095a7', - 'Cursor Text' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.7f4063076c', - 'Color of text under the cursor (block cursor)' - ) - } - }, - { - key: 'selectionBackground', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.40c3cfd30a', - 'Selection Background' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.74d8555f85', - 'Background color of selected text' - ) - } - }, - { - key: 'selectionForeground', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.8b450b5305', - 'Selection Foreground' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.b2c0857c49', - 'Text color of selected text' - ) - } - }, - { - key: 'bold', - get label() { - return translate('auto.components.settings.TerminalWindowSection.862e463f7f', 'Bold Text') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.fb8c6f1967', - 'Color for bold text. Falls back to the normal color if not set.' - ) - } - } - ] - }, - { - get label() { - return translate('auto.components.settings.TerminalWindowSection.68e9f07de0', 'ANSI Normal') - }, - keys: [ - { - key: 'black', - get label() { - return translate('auto.components.settings.TerminalWindowSection.adfdee23cb', 'Black') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.cf4437a2f7', - 'ANSI black color' - ) - } - }, - { - key: 'red', - get label() { - return translate('auto.components.settings.TerminalWindowSection.3a78f30b50', 'Red') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.b41270f5ca', - 'ANSI red color' - ) - } - }, - { - key: 'green', - get label() { - return translate('auto.components.settings.TerminalWindowSection.8f2092b315', 'Green') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.8a673d4206', - 'ANSI green color' - ) - } - }, - { - key: 'yellow', - get label() { - return translate('auto.components.settings.TerminalWindowSection.bb516de873', 'Yellow') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.09c1c6b096', - 'ANSI yellow color' - ) - } - }, - { - key: 'blue', - get label() { - return translate('auto.components.settings.TerminalWindowSection.292a4c7316', 'Blue') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.9635a71c51', - 'ANSI blue color' - ) - } - }, - { - key: 'magenta', - get label() { - return translate('auto.components.settings.TerminalWindowSection.d5e92fcd94', 'Magenta') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.1705318506', - 'ANSI magenta color' - ) - } - }, - { - key: 'cyan', - get label() { - return translate('auto.components.settings.TerminalWindowSection.fb8bb4eb1f', 'Cyan') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.bd4c759327', - 'ANSI cyan color' - ) - } - }, - { - key: 'white', - get label() { - return translate('auto.components.settings.TerminalWindowSection.0cb4459fb8', 'White') - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.28846b1ca6', - 'ANSI white color' - ) - } - } - ] - }, - { - get label() { - return translate('auto.components.settings.TerminalWindowSection.1be593d3e8', 'ANSI Bright') - }, - keys: [ - { - key: 'brightBlack', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.260d69ce9a', - 'Bright Black' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.f30c492769', - 'ANSI bright black color' - ) - } - }, - { - key: 'brightRed', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.32b1b6acd7', - 'Bright Red' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.667de68863', - 'ANSI bright red color' - ) - } - }, - { - key: 'brightGreen', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.7dafd57730', - 'Bright Green' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.0ffb02f921', - 'ANSI bright green color' - ) - } - }, - { - key: 'brightYellow', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.936a326be3', - 'Bright Yellow' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.e2ef5f4ab7', - 'ANSI bright yellow color' - ) - } - }, - { - key: 'brightBlue', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.66820332fa', - 'Bright Blue' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.bef6c0f6bf', - 'ANSI bright blue color' - ) - } - }, - { - key: 'brightMagenta', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.e56e7d6ea0', - 'Bright Magenta' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.fe4d89ef85', - 'ANSI bright magenta color' - ) - } - }, - { - key: 'brightCyan', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.f94adc4113', - 'Bright Cyan' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.1601140f03', - 'ANSI bright cyan color' - ) - } - }, - { - key: 'brightWhite', - get label() { - return translate( - 'auto.components.settings.TerminalWindowSection.16948119cb', - 'Bright White' - ) - }, - get description() { - return translate( - 'auto.components.settings.TerminalWindowSection.42e01a6055', - 'ANSI bright white color' - ) - } - } - ] - } -] - export function TerminalWindowSection({ settings, updateSettings diff --git a/src/renderer/src/components/settings/terminal-base-color-override-groups.ts b/src/renderer/src/components/settings/terminal-base-color-override-groups.ts new file mode 100644 index 00000000000..e5fde180a91 --- /dev/null +++ b/src/renderer/src/components/settings/terminal-base-color-override-groups.ts @@ -0,0 +1,214 @@ +import { translate } from '@/i18n/i18n' +import type { TerminalColorOverrideGroup } from './terminal-color-override-group-types' + +export const TERMINAL_BASE_COLOR_OVERRIDE_GROUPS: TerminalColorOverrideGroup[] = [ + { + get label() { + return translate('auto.components.settings.TerminalWindowSection.cf37ff69f6', 'Base') + }, + keys: [ + { + key: 'foreground', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.79f6bfb76e', + 'Foreground' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.026a0b8013', + 'Main text color' + ) + } + }, + { + key: 'background', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.cc1b2ffeb2', + 'Background' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.da64e8f4c1', + 'Terminal background color' + ) + } + }, + { + key: 'cursor', + get label() { + return translate('auto.components.settings.TerminalWindowSection.c9e1fdf42f', 'Cursor') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.cd0700762b', + 'Cursor color' + ) + } + }, + { + key: 'cursorAccent', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.a2d9f095a7', + 'Cursor Text' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.7f4063076c', + 'Color of text under the cursor (block cursor)' + ) + } + }, + { + key: 'selectionBackground', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.40c3cfd30a', + 'Selection Background' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.74d8555f85', + 'Background color of selected text' + ) + } + }, + { + key: 'selectionForeground', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.8b450b5305', + 'Selection Foreground' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.b2c0857c49', + 'Text color of selected text' + ) + } + }, + { + key: 'bold', + get label() { + return translate('auto.components.settings.TerminalWindowSection.862e463f7f', 'Bold Text') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.fb8c6f1967', + 'Color for bold text. Falls back to the normal color if not set.' + ) + } + } + ] + }, + { + get label() { + return translate('auto.components.settings.TerminalWindowSection.68e9f07de0', 'ANSI Normal') + }, + keys: [ + { + key: 'black', + get label() { + return translate('auto.components.settings.TerminalWindowSection.adfdee23cb', 'Black') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.cf4437a2f7', + 'ANSI black color' + ) + } + }, + { + key: 'red', + get label() { + return translate('auto.components.settings.TerminalWindowSection.3a78f30b50', 'Red') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.b41270f5ca', + 'ANSI red color' + ) + } + }, + { + key: 'green', + get label() { + return translate('auto.components.settings.TerminalWindowSection.8f2092b315', 'Green') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.8a673d4206', + 'ANSI green color' + ) + } + }, + { + key: 'yellow', + get label() { + return translate('auto.components.settings.TerminalWindowSection.bb516de873', 'Yellow') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.09c1c6b096', + 'ANSI yellow color' + ) + } + }, + { + key: 'blue', + get label() { + return translate('auto.components.settings.TerminalWindowSection.292a4c7316', 'Blue') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.9635a71c51', + 'ANSI blue color' + ) + } + }, + { + key: 'magenta', + get label() { + return translate('auto.components.settings.TerminalWindowSection.d5e92fcd94', 'Magenta') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.1705318506', + 'ANSI magenta color' + ) + } + }, + { + key: 'cyan', + get label() { + return translate('auto.components.settings.TerminalWindowSection.fb8bb4eb1f', 'Cyan') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.bd4c759327', + 'ANSI cyan color' + ) + } + }, + { + key: 'white', + get label() { + return translate('auto.components.settings.TerminalWindowSection.0cb4459fb8', 'White') + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.28846b1ca6', + 'ANSI white color' + ) + } + } + ] + } +] diff --git a/src/renderer/src/components/settings/terminal-bright-color-override-groups.ts b/src/renderer/src/components/settings/terminal-bright-color-override-groups.ts new file mode 100644 index 00000000000..661e8802850 --- /dev/null +++ b/src/renderer/src/components/settings/terminal-bright-color-override-groups.ts @@ -0,0 +1,132 @@ +import { translate } from '@/i18n/i18n' +import type { TerminalColorOverrideGroup } from './terminal-color-override-group-types' + +export const TERMINAL_BRIGHT_COLOR_OVERRIDE_GROUPS: TerminalColorOverrideGroup[] = [ + { + get label() { + return translate('auto.components.settings.TerminalWindowSection.1be593d3e8', 'ANSI Bright') + }, + keys: [ + { + key: 'brightBlack', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.260d69ce9a', + 'Bright Black' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.f30c492769', + 'ANSI bright black color' + ) + } + }, + { + key: 'brightRed', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.32b1b6acd7', + 'Bright Red' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.667de68863', + 'ANSI bright red color' + ) + } + }, + { + key: 'brightGreen', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.7dafd57730', + 'Bright Green' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.0ffb02f921', + 'ANSI bright green color' + ) + } + }, + { + key: 'brightYellow', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.936a326be3', + 'Bright Yellow' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.e2ef5f4ab7', + 'ANSI bright yellow color' + ) + } + }, + { + key: 'brightBlue', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.66820332fa', + 'Bright Blue' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.bef6c0f6bf', + 'ANSI bright blue color' + ) + } + }, + { + key: 'brightMagenta', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.e56e7d6ea0', + 'Bright Magenta' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.fe4d89ef85', + 'ANSI bright magenta color' + ) + } + }, + { + key: 'brightCyan', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.f94adc4113', + 'Bright Cyan' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.1601140f03', + 'ANSI bright cyan color' + ) + } + }, + { + key: 'brightWhite', + get label() { + return translate( + 'auto.components.settings.TerminalWindowSection.16948119cb', + 'Bright White' + ) + }, + get description() { + return translate( + 'auto.components.settings.TerminalWindowSection.42e01a6055', + 'ANSI bright white color' + ) + } + } + ] + } +] diff --git a/src/renderer/src/components/settings/terminal-color-override-group-types.ts b/src/renderer/src/components/settings/terminal-color-override-group-types.ts new file mode 100644 index 00000000000..2d2d47a3ce6 --- /dev/null +++ b/src/renderer/src/components/settings/terminal-color-override-group-types.ts @@ -0,0 +1,6 @@ +import type { TerminalColorOverrides } from '../../../../shared/types' + +export type TerminalColorOverrideGroup = { + label: string + keys: { key: keyof TerminalColorOverrides; label: string; description: string }[] +} diff --git a/src/renderer/src/components/settings/terminal-color-override-groups.ts b/src/renderer/src/components/settings/terminal-color-override-groups.ts new file mode 100644 index 00000000000..907ecc7d93d --- /dev/null +++ b/src/renderer/src/components/settings/terminal-color-override-groups.ts @@ -0,0 +1,8 @@ +import { TERMINAL_BASE_COLOR_OVERRIDE_GROUPS } from './terminal-base-color-override-groups' +import { TERMINAL_BRIGHT_COLOR_OVERRIDE_GROUPS } from './terminal-bright-color-override-groups' +import type { TerminalColorOverrideGroup } from './terminal-color-override-group-types' + +export const COLOR_OVERRIDE_GROUPS: TerminalColorOverrideGroup[] = [ + ...TERMINAL_BASE_COLOR_OVERRIDE_GROUPS, + ...TERMINAL_BRIGHT_COLOR_OVERRIDE_GROUPS +] diff --git a/src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx b/src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx index 92687be2efd..b4475161048 100644 --- a/src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx +++ b/src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx @@ -17,209 +17,25 @@ import { } from '@/components/ui/dropdown-menu' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import type { AgentActivityDisplayMode, WorktreeCardProperty } from '../../../../shared/types' +import type { AgentActivityDisplayMode } from '../../../../shared/types' import { DEFAULT_SHOW_SLEEPING_WORKSPACES } from '../../../../shared/constants' import SidebarRepositoryFilterSection from './SidebarRepositoryFilterSection' import SidebarWorkspaceFilterSection from './SidebarWorkspaceFilterSection' import { translate } from '@/i18n/i18n' +import { + AGENT_ACTIVITY_DISPLAY_OPTIONS, + CARD_LAYOUT_OPTIONS, + GROUP_BY_OPTIONS, + PROJECT_ORDER_OPTIONS, + PROPERTY_OPTIONS, + SORT_OPTIONS +} from './sidebar-workspace-options-menu-options' type SidebarWorkspaceOptionsMenuProps = { preserveWorkspaceBoardOpen?: boolean onMenuOpenChange?: (open: boolean) => void } -const GROUP_BY_OPTIONS = [ - { - id: 'none', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.c2c7a45cda', 'None') - } - }, - { - id: 'workspace-status', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.e029a2d775', 'Status') - } - }, - { - id: 'pr-status', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.0f9b959b31', 'PR') - } - }, - { - id: 'repo', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.2170d553cf', 'Project') - } - } -] as const - -const CARD_LAYOUT_OPTIONS = [ - { - id: 'detailed', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.cc17bd443b', 'Detailed') - } - }, - { - id: 'compact', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.25105b28cb', 'Compact') - } - } -] as const - -const PROPERTY_OPTIONS: { id: WorktreeCardProperty; label: string }[] = [ - { - id: 'issue', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.91dfc653e8', - 'GitHub ticket' - ) - } - }, - { - id: 'linear-issue', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.ca4d3c522e', - 'Linear issue' - ) - } - }, - { - id: 'pr', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.b8dcc6f321', - 'PR/MR link' - ) - } - }, - { - id: 'comment', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.26c71e536c', 'Notes') - } - }, - { - id: 'ports', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b64d8bcca0', 'Ports') - } - }, - // Why: toggles the inline "Agent activity" list rendered below each - // workspace card body (see WorktreeCard -> WorktreeCardAgents). Off hides - // the list; there is no alternate surface. - { - id: 'inline-agents', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.d7084e8bc8', - 'Agent activity' - ) - } - } -] - -const AGENT_ACTIVITY_DISPLAY_OPTIONS: { id: AgentActivityDisplayMode; label: string }[] = [ - { - id: 'compact', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.25105b28cb', 'Compact') - } - }, - { - id: 'full', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.2a81e07366', - 'Full list' - ) - } - } -] - -const SORT_OPTIONS = [ - { - id: 'name', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.3728165cdd', 'Name') - }, - description: null - }, - { - id: 'smart', - get label() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.503462f2b4', - 'Agent Activity' - ) - }, - get description() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.b759bb87ee', - 'Agents that need attention, then most recent activity.' - ) - } - }, - { - id: 'recent', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b451c8b162', 'Recent') - }, - description: null - }, - { - id: 'repo', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.2170d553cf', 'Project') - }, - description: null - }, - { - id: 'manual', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.7b316bdd51', 'Manual') - }, - get description() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.7153d07485', - 'Drag workspaces to arrange them within each group.' - ) - } - } -] as const - -const PROJECT_ORDER_OPTIONS = [ - { - id: 'manual', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.7b316bdd51', 'Manual') - }, - get description() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.6664282a7b', - 'Drag projects to arrange them' - ) - } - }, - { - id: 'recent', - get label() { - return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b451c8b162', 'Recent') - }, - get description() { - return translate( - 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.af9249c505', - 'Most recent workspace activity' - ) - } - } -] as const - const SidebarWorkspaceOptionsMenu = React.memo(function SidebarWorkspaceOptionsMenu({ preserveWorkspaceBoardOpen = false, onMenuOpenChange diff --git a/src/renderer/src/components/sidebar/sidebar-workspace-options-menu-options.ts b/src/renderer/src/components/sidebar/sidebar-workspace-options-menu-options.ts new file mode 100644 index 00000000000..52c985120db --- /dev/null +++ b/src/renderer/src/components/sidebar/sidebar-workspace-options-menu-options.ts @@ -0,0 +1,194 @@ +import type { AgentActivityDisplayMode, WorktreeCardProperty } from '../../../../shared/types' +import { translate } from '@/i18n/i18n' + +export const GROUP_BY_OPTIONS = [ + { + id: 'none', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.c2c7a45cda', 'None') + } + }, + { + id: 'workspace-status', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.e029a2d775', 'Status') + } + }, + { + id: 'pr-status', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.0f9b959b31', 'PR') + } + }, + { + id: 'repo', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.2170d553cf', 'Project') + } + } +] as const + +export const CARD_LAYOUT_OPTIONS = [ + { + id: 'detailed', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.cc17bd443b', 'Detailed') + } + }, + { + id: 'compact', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.25105b28cb', 'Compact') + } + } +] as const + +export const PROPERTY_OPTIONS: { id: WorktreeCardProperty; label: string }[] = [ + { + id: 'issue', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.91dfc653e8', + 'GitHub ticket' + ) + } + }, + { + id: 'linear-issue', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.ca4d3c522e', + 'Linear issue' + ) + } + }, + { + id: 'pr', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.b8dcc6f321', + 'PR/MR link' + ) + } + }, + { + id: 'comment', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.26c71e536c', 'Notes') + } + }, + { + id: 'ports', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b64d8bcca0', 'Ports') + } + }, + // Why: toggles the inline "Agent activity" list rendered below each + // workspace card body (see WorktreeCard -> WorktreeCardAgents). Off hides + // the list; there is no alternate surface. + { + id: 'inline-agents', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.d7084e8bc8', + 'Agent activity' + ) + } + } +] + +export const AGENT_ACTIVITY_DISPLAY_OPTIONS: { id: AgentActivityDisplayMode; label: string }[] = [ + { + id: 'compact', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.25105b28cb', 'Compact') + } + }, + { + id: 'full', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.2a81e07366', + 'Full list' + ) + } + } +] + +export const SORT_OPTIONS = [ + { + id: 'name', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.3728165cdd', 'Name') + }, + description: null + }, + { + id: 'smart', + get label() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.503462f2b4', + 'Agent Activity' + ) + }, + get description() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.b759bb87ee', + 'Agents that need attention, then most recent activity.' + ) + } + }, + { + id: 'recent', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b451c8b162', 'Recent') + }, + description: null + }, + { + id: 'repo', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.2170d553cf', 'Project') + }, + description: null + }, + { + id: 'manual', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.7b316bdd51', 'Manual') + }, + get description() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.7153d07485', + 'Drag workspaces to arrange them within each group.' + ) + } + } +] as const + +export const PROJECT_ORDER_OPTIONS = [ + { + id: 'manual', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.7b316bdd51', 'Manual') + }, + get description() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.6664282a7b', + 'Drag projects to arrange them' + ) + } + }, + { + id: 'recent', + get label() { + return translate('auto.components.sidebar.SidebarWorkspaceOptionsMenu.b451c8b162', 'Recent') + }, + get description() { + return translate( + 'auto.components.sidebar.SidebarWorkspaceOptionsMenu.af9249c505', + 'Most recent workspace activity' + ) + } + } +] as const