refactor: group repository execution settings (#33261)

This commit is contained in:
Neil
2026-10-24 15:46:51 -07:00
committed by GitHub
parent c344f3f0ab
commit 9c8ce8d818
28 changed files with 111 additions and 105 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
1 src/renderer/src/components/settings/BrowserSessionCookiesSection.tsx
1 src/renderer/src/components/settings/BrowserSshWorkspaceRoutingSetting.tsx
1 src/renderer/src/components/settings/QuickCommandsToolbar.tsx
1 src/renderer/src/components/settings/RepositoryHostSetupsSection.tsx
1 src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.tsx
1 src/renderer/src/components/sidebar/AddRemoteHostSshConfigPicker.tsx
4 src/renderer/src/components/status-bar/SshStatusSegment.tsx
1 src/renderer/src/components/status-bar/resource-usage-popover-body.tsx
+7 -7
View File
@@ -8005,10 +8005,10 @@
"src/renderer/src/components/settings/RepositoryForkSyncSection.test.tsx": 750,
"src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx": 578,
"src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx": 506,
"src/renderer/src/components/settings/RepositoryHooksSection.test.ts": 776,
"src/renderer/src/components/settings/RepositoryHostSetupsSection.settings-entry.test.tsx": 1648,
"src/renderer/src/components/settings/RepositoryHostSetupsSection.test.tsx": 1935,
"src/renderer/src/components/settings/RepositoryHostSetupsSection.workspace-window.test.tsx": 1452,
"src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.test.ts": 776,
"src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.settings-entry.test.tsx": 1648,
"src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.test.tsx": 1935,
"src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.workspace-window.test.tsx": 1452,
"src/renderer/src/components/settings/RepositoryIconEmojiPicker.test.tsx": 252,
"src/renderer/src/components/settings/RepositoryIconPicker.github-avatar-refresh.test.tsx": 494,
"src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.test.tsx": 309,
@@ -8097,9 +8097,9 @@
"src/renderer/src/components/settings/provider-account-scope.test.ts": 75,
"src/renderer/src/components/settings/provider-account-visibility.test.ts": 44,
"src/renderer/src/components/settings/provider-rate-limit-scope-panels.test.tsx": 320,
"src/renderer/src/components/settings/repository-description-templates.test.tsx": 783,
"src/renderer/src/components/settings/repository-hook-settings-draft.test.ts": 409,
"src/renderer/src/components/settings/repository-host-setup-options.test.ts": 268,
"src/renderer/src/components/settings/repository/execution/repository-description-templates.test.tsx": 783,
"src/renderer/src/components/settings/repository/execution/repository-hook-settings-draft.test.ts": 409,
"src/renderer/src/components/settings/repository/execution/repository-host-setup-options.test.ts": 268,
"src/renderer/src/components/settings/repository-icon-github.test.ts": 49,
"src/renderer/src/components/settings/repository-source-control-ai-global-ux.test.ts": 389,
"src/renderer/src/components/settings/repository/source-control/repository-source-control-ai-persist-queue.test.ts": 86,
@@ -9,7 +9,7 @@ import { useState } from 'react'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { Button } from '../ui/button'
import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls'
import type { ProjectRuntimeSessionSummary } from './repository-runtime-session-summary'
import type { ProjectRuntimeSessionSummary } from './repository/execution/repository-runtime-session-summary'
import { translate } from '@/i18n/i18n'
import { projectRuntimeRepairSentence } from '../../../../shared/project-runtime-repair-message'
@@ -8,7 +8,7 @@ import { getRepoExecutionHostId, type ExecutionHostId } from '../../../../shared
import { Label } from '../ui/label'
import { Separator } from '../ui/separator'
import { useShallow } from 'zustand/react/shallow'
import { RepositoryHooksSection } from './RepositoryHooksSection'
import { RepositoryHooksSection } from './repository/execution/RepositoryHooksSection'
import { McpConfigSection } from './McpConfigSection'
import { WorktreeSymlinksSection } from './WorktreeSymlinksSection'
import { SparsePresetSettingsSection } from './SparsePresetSettingsSection'
@@ -21,16 +21,16 @@ import { useAppStore } from '@/store/index'
import { getRepositoryIconSectionId } from './repository-settings-targets'
import { RepositoryIconPicker } from './repository/identity/RepositoryIconPicker'
import { getRepositoryPaneSearchEntries } from './repository-search'
import { RepositoryHostSetupsSection } from './RepositoryHostSetupsSection'
import { RepositoryHostSetupsSection } from './repository/execution/RepositoryHostSetupsSection'
import { RepoSettingsDraftInput } from './repository/RepositorySettingsDraftInput'
import { RepositoryForkSyncSection } from './repository/identity/RepositoryForkSyncSection'
import { RepositoryGitHubAccountSection } from './RepositoryGitHubAccountSection'
import { translate } from '@/i18n/i18n'
import { RepositoryWindowsRuntimeSection } from './RepositoryWindowsRuntimeSection'
import { RepositoryWindowsRuntimeSection } from './repository/execution/RepositoryWindowsRuntimeSection'
import { matchesRepositoryIdentitySearch } from './repository/identity/repository-identity-search'
import { RepositoryWorktreeDefaultsSection } from './repository/execution/RepositoryWorktreeDefaultsSection'
import { RepositoryJiraProjectSection } from './repository/RepositoryJiraProjectSection'
import { getProjectRuntimeSessionSummary } from './repository-runtime-session-summary'
import { getProjectRuntimeSessionSummary } from './repository/execution/repository-runtime-session-summary'
import { getRepoOwnerWorktreeVisibilityDefaults } from '../../store/worktree-visibility-defaults-by-host'
export { getRepositoryPaneSearchEntries }
@@ -5,8 +5,8 @@ import type { SettingsSearchEntry } from './settings-search'
import { translate } from '@/i18n/i18n'
import { translateSearchKeyword } from './settings-search-keywords'
import { getRepositoryGitAuthorSearchEntries } from './repository-git-author-search-entries'
import { getRepositoryGitHooksSearchEntries } from './repository-git-hooks-search-entries'
import { getRepositoryGitWorktreeSearchEntries } from './repository-git-worktree-search-entries'
import { getRepositoryGitHooksSearchEntries } from './repository/execution/repository-git-hooks-search-entries'
import { getRepositoryGitWorktreeSearchEntries } from './repository/execution/repository-git-worktree-search-entries'
type RepositoryPaneSearchOptions = {
isLocalWindowsProject?: boolean
@@ -4,11 +4,11 @@ import type {
OrcaHooks,
SetupAgentStartupPolicy,
SetupRunPolicy
} from '../../../../shared/orca-yaml-hook-types'
} from '../../../../../../shared/orca-yaml-hook-types'
import { Trans } from 'react-i18next'
import { i18n, translate } from '@/i18n/i18n'
import { matchesSettingsSearch } from './settings-search'
import { SettingsSwitch } from './SettingsFormControls'
import { matchesSettingsSearch } from '../../settings-search'
import { SettingsSwitch } from '../../SettingsFormControls'
import { RepositoryHooksYamlStatus } from './RepositoryHooksYamlStatus'
type PolicyOption<Policy> = { policy: Policy; label: string; description: string }
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react'
import { AlertTriangle, Plus } from 'lucide-react'
import { Button } from '../ui/button'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip'
import { Button } from '../../../ui/button'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../../ui/tooltip'
import { translate } from '@/i18n/i18n'
import { getRepositoryHookScriptTextareaRows } from '@/lib/script-textarea-rows'
import type {
@@ -3,11 +3,12 @@
import React, { act } from 'react'
import { createRoot, type Root } from 'react-dom/client'
import { afterEach, describe, expect, it, vi } from 'vitest'
import type { Repo } from '../../../../shared/repo-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { readRuntimeIssueCommand } from '@/runtime/runtime-hooks-client'
import { getLocalCommandSourcePolicyNotice, RepositoryHooksSection } from './RepositoryHooksSection'
import { getLocalCommandSourcePolicyNotice } from './repository-hook-settings-draft'
import { RepositoryHooksSection } from './RepositoryHooksSection'
vi.mock('@/store', () => ({
vi.mock('@/store/index', () => ({
useAppStore: (selector: (state: unknown) => unknown) =>
selector({
settings: {},
@@ -6,18 +6,17 @@ import type {
RepoHookSettings,
SetupAgentStartupPolicy,
SetupRunPolicy
} from '../../../../shared/orca-yaml-hook-types'
import type { Repo } from '../../../../shared/repo-types'
import { getRepoExecutionHostId } from '../../../../shared/execution-host'
import { resolveHookCommandSourcePolicy } from '../../../../shared/hook-command-source-policy'
import { useAppStore } from '@/store'
} from '../../../../../../shared/orca-yaml-hook-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { getRepoExecutionHostId } from '../../../../../../shared/execution-host'
import { resolveHookCommandSourcePolicy } from '../../../../../../shared/hook-command-source-policy'
import { useAppStore } from '@/store/index'
import { translate } from '@/i18n/i18n'
import { SearchableSetting } from './SearchableSetting'
import { getRepositoryLocalCommandsSectionId } from './repository-settings-targets'
import { SearchableSetting } from '../../SearchableSetting'
import { getRepositoryLocalCommandsSectionId } from '../../repository-settings-targets'
import {
getLocalHookFields,
getLocalCommandSourcePolicyNotice,
type LocalCommandSourcePolicyNotice
getLocalCommandSourcePolicyNotice
} from './repository-hook-settings-draft'
import {
LocalCommandSourceNotice,
@@ -28,11 +27,8 @@ import {
RepositorySetupPolicySetting
} from './RepositoryHookPolicySettings'
import { RepositoryIssueCommandSetting } from './RepositoryIssueCommandSetting'
import { useRepositoryHookSettingsDraft } from './use-repository-hook-settings-draft'
import { useRepositoryIssueCommand } from './use-repository-issue-command'
export { getLocalCommandSourcePolicyNotice }
export type { LocalCommandSourcePolicyNotice }
import { useRepositoryHookSettingsDraft } from '../../use-repository-hook-settings-draft'
import { useRepositoryIssueCommand } from '../../use-repository-issue-command'
type RepositoryHooksSectionProps = {
repo: Repo
@@ -1,6 +1,6 @@
import { AlertTriangle } from 'lucide-react'
import type { OrcaHooks } from '../../../../shared/orca-yaml-hook-types'
import { Button } from '../ui/button'
import type { OrcaHooks } from '../../../../../../shared/orca-yaml-hook-types'
import { Button } from '../../../ui/button'
import { translate } from '@/i18n/i18n'
import { renderYamlScriptPreview } from './repository-hook-settings-draft'
@@ -1,15 +1,15 @@
import { useState } from 'react'
import { Plus, X } from 'lucide-react'
import type { ExecutionHostId } from '../../../../shared/execution-host'
import type { ExecutionHostId } from '../../../../../../shared/execution-host'
import type {
ProjectHostSetup,
ProjectHostSetupCreateResult,
ProjectHostSetupResult
} from '../../../../shared/project-types'
} from '../../../../../../shared/project-types'
import { translate } from '@/i18n/i18n'
import { Button } from '../ui/button'
import { Label } from '../ui/label'
import { HostCombobox } from '../host-picker/HostCombobox'
import { Button } from '../../../ui/button'
import { Label } from '../../../ui/label'
import { HostCombobox } from '../../../host-picker/HostCombobox'
import type { SetupHostOption } from './repository-host-setup-options'
import {
HostSetupCloneStep,
@@ -3,10 +3,10 @@
import React, { act } from 'react'
import { createRoot, type Root } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { toSshExecutionHostId } from '../../../../shared/execution-host'
import type { ProjectHostSetup } from '../../../../shared/project-types'
import type { Repo } from '../../../../shared/repo-types'
import { useAppStore } from '../../store'
import { toSshExecutionHostId } from '../../../../../../shared/execution-host'
import type { ProjectHostSetup } from '../../../../../../shared/project-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { useAppStore } from '../../../../store/index'
import { RepositoryHostSetupsSection } from './RepositoryHostSetupsSection'
let container: HTMLDivElement
@@ -3,15 +3,18 @@
import React, { act } from 'react'
import { createRoot, type Root } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { getExecutionHostLabel, toSshExecutionHostId } from '../../../../shared/execution-host'
import {
getExecutionHostLabel,
toSshExecutionHostId
} from '../../../../../../shared/execution-host'
import {
PROJECT_HOST_SETUP_RUNTIME_CAPABILITY,
RUNTIME_PROTOCOL_VERSION,
WORKSPACE_RUN_CONTEXT_RUNTIME_CAPABILITY
} from '../../../../shared/protocol-version'
import type { Project, ProjectHostSetup } from '../../../../shared/project-types'
import type { Repo } from '../../../../shared/repo-types'
import { useAppStore } from '../../store'
} from '../../../../../../shared/worktree-runtime-capabilities'
import { RUNTIME_PROTOCOL_VERSION } from '../../../../../../shared/protocol-version'
import type { Project, ProjectHostSetup } from '../../../../../../shared/project-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { useAppStore } from '../../../../store/index'
import { RepositoryHostSetupsSection } from './RepositoryHostSetupsSection'
let container: HTMLDivElement
@@ -4,28 +4,28 @@ import {
parseExecutionHostId,
toRuntimeExecutionHostId,
type ExecutionHostId
} from '../../../../shared/execution-host'
import { buildExecutionHostRegistry } from '../../../../shared/execution-host-registry'
import { getHostDisplayLabelOverrides } from '../../../../shared/host-setting-overrides'
import type { ProjectHostSetup } from '../../../../shared/project-types'
import type { Repo } from '../../../../shared/repo-types'
import { useAppStore } from '../../store'
import { getProjectHostSetupProjectionFromState } from '../../store/selectors'
import { cn } from '../../lib/utils'
import { Button } from '../ui/button'
import { Label } from '../ui/label'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { SearchableSetting } from './SearchableSetting'
import { SettingsBadge } from './SettingsFormControls'
import { matchesSettingsSearch } from './settings-search'
import type { SettingsSearchEntry } from './settings-search'
} from '../../../../../../shared/execution-host'
import { buildExecutionHostRegistry } from '../../../../../../shared/execution-host-registry'
import { getHostDisplayLabelOverrides } from '../../../../../../shared/host-setting-overrides'
import type { ProjectHostSetup } from '../../../../../../shared/project-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { useAppStore } from '../../../../store/index'
import { getProjectHostSetupProjectionFromState } from '../../../../store/project-host-setup-selector'
import { cn } from '../../../../lib/utils'
import { Button } from '../../../ui/button'
import { Label } from '../../../ui/label'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select'
import { SearchableSetting } from '../../SearchableSetting'
import { SettingsBadge } from '../../SettingsFormControls'
import { matchesSettingsSearch } from '../../settings-search'
import type { SettingsSearchEntry } from '../../settings-search'
import { translate } from '@/i18n/i18n'
import { buildSetupHostOptions, getSetupStateLabel } from './repository-host-setup-options'
import { RepositoryHostSetupActions } from './RepositoryHostSetupActions'
import {
selectRuntimeAwareSshStatus,
selectRuntimeAwareSshTargetLabel
} from '@/store/slices/runtime-environment-ssh'
} from '@/store/slices/runtime-environment-ssh-selectors'
import {
isConnectedRuntimeHostState,
runtimeHostConnectionStateForEntry
@@ -5,13 +5,13 @@ import { createRoot, type Root } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import {
PROJECT_HOST_SETUP_RUNTIME_CAPABILITY,
RUNTIME_PROTOCOL_VERSION,
WORKSPACE_RUN_CONTEXT_RUNTIME_CAPABILITY
} from '../../../../shared/protocol-version'
import type { RuntimeStatus } from '../../../../shared/runtime-types'
import type { Project, ProjectHostSetup } from '../../../../shared/project-types'
import type { Repo } from '../../../../shared/repo-types'
import { useAppStore } from '../../store'
} from '../../../../../../shared/worktree-runtime-capabilities'
import { RUNTIME_PROTOCOL_VERSION } from '../../../../../../shared/protocol-version'
import type { RuntimeStatus } from '../../../../../../shared/runtime-session-contracts'
import type { Project, ProjectHostSetup } from '../../../../../../shared/project-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { useAppStore } from '../../../../store/index'
import { RepositoryHostSetupsSection } from './RepositoryHostSetupsSection'
let container: HTMLDivElement
@@ -1,9 +1,9 @@
import type { GlobalSettings } from '../../../../shared/global-settings-types'
import type { Project, ProjectUpdateArgs } from '../../../../shared/project-types'
import { SearchableSetting } from './SearchableSetting'
import type { SettingsSearchEntry } from './settings-search'
import { matchesSettingsSearch } from './settings-search'
import { ProjectWindowsRuntimeSetting } from './ProjectWindowsRuntimeSetting'
import type { GlobalSettings } from '../../../../../../shared/global-settings-types'
import type { Project, ProjectUpdateArgs } from '../../../../../../shared/project-types'
import { SearchableSetting } from '../../SearchableSetting'
import type { SettingsSearchEntry } from '../../settings-search'
import { matchesSettingsSearch } from '../../settings-search'
import { ProjectWindowsRuntimeSetting } from '../../ProjectWindowsRuntimeSetting'
import type { ProjectRuntimeSessionSummary } from './repository-runtime-session-summary'
import { translate } from '@/i18n/i18n'
@@ -1,7 +1,7 @@
import type { Repo } from '../../../../shared/repo-types'
import type { SettingsSearchEntry } from './settings-search'
import type { Repo } from '../../../../../../shared/repo-types'
import type { SettingsSearchEntry } from '../../settings-search'
import { translate } from '@/i18n/i18n'
import { translateSearchKeyword } from './settings-search-keywords'
import { translateSearchKeyword } from '../../settings-search-keywords'
export function getRepositoryGitHooksSearchEntries(repo: Repo): SettingsSearchEntry[] {
return [
@@ -1,7 +1,7 @@
import type { Repo } from '../../../../shared/repo-types'
import type { SettingsSearchEntry } from './settings-search'
import type { Repo } from '../../../../../../shared/repo-types'
import type { SettingsSearchEntry } from '../../settings-search'
import { translate } from '@/i18n/i18n'
import { translateSearchKeyword } from './settings-search-keywords'
import { translateSearchKeyword } from '../../settings-search-keywords'
export function getRepositoryGitWorktreeSearchEntries(repo: Repo): SettingsSearchEntry[] {
return [
@@ -2,9 +2,9 @@ import type {
HookCommandSourcePolicy,
OrcaHooks,
RepoHookSettings
} from '../../../../shared/orca-yaml-hook-types'
import type { Repo } from '../../../../shared/repo-types'
import { DEFAULT_REPO_HOOK_SETTINGS } from './SettingsConstants'
} from '../../../../../../shared/orca-yaml-hook-types'
import type { Repo } from '../../../../../../shared/repo-types'
import { DEFAULT_REPO_HOOK_SETTINGS } from '../../SettingsConstants'
import { translate } from '@/i18n/i18n'
export type LocalHookName = 'setup' | 'archive'
@@ -2,9 +2,9 @@ import type { ComponentType } from 'react'
import { ArrowLeft, Download, FolderOpen, Plus } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { cn } from '@/lib/utils'
import { Button } from '../ui/button'
import { Input } from '../ui/input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
import { Button } from '../../../ui/button'
import { Input } from '../../../ui/input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select'
export function HostSetupStartActions({
pathActionsDisabled,
@@ -1,9 +1,9 @@
import { describe, expect, it, vi } from 'vitest'
import type { ExecutionHostRegistryEntry } from '../../../../shared/execution-host-registry'
import type { ExecutionHostRegistryEntry } from '../../../../../../shared/execution-host-registry'
import {
PROJECT_HOST_SETUP_RUNTIME_CAPABILITY,
WORKSPACE_RUN_CONTEXT_RUNTIME_CAPABILITY
} from '../../../../shared/protocol-version'
} from '../../../../../../shared/worktree-runtime-capabilities'
import { buildSetupHostOptions } from './repository-host-setup-options'
vi.mock('@/i18n/i18n', () => ({
@@ -1,9 +1,15 @@
import { getExecutionHostLabel, type ExecutionHostId } from '../../../../shared/execution-host'
import type { ExecutionHostRegistryEntry } from '../../../../shared/execution-host-registry'
import type { ProjectHostSetup, ProjectHostSetupState } from '../../../../shared/project-types'
import {
getExecutionHostLabel,
type ExecutionHostId
} from '../../../../../../shared/execution-host'
import type { ExecutionHostRegistryEntry } from '../../../../../../shared/execution-host-registry'
import type {
ProjectHostSetup,
ProjectHostSetupState
} from '../../../../../../shared/project-types'
import { translate } from '@/i18n/i18n'
import { getHostSetupUnavailableDetail } from '@/lib/project-host-setup-options'
import { pickerExecutionHosts } from '../../../../shared/managed-orcad-execution-host'
import { pickerExecutionHosts } from '../../../../../../shared/managed-orcad-execution-host'
export type SetupHostOption = {
id: ExecutionHostId
@@ -1,6 +1,6 @@
import type { AppState } from '../../store/types'
import { getRepoIdFromWorktreeId } from '../../../../shared/worktree/id'
import { getTabIdToWorktreeId } from '../sidebar/worktree-agent-row-selectors'
import type { AppState } from '../../../../store/types'
import { getRepoIdFromWorktreeId } from '../../../../../../shared/worktree/id'
import { getTabIdToWorktreeId } from '../../../sidebar/worktree-agent-row-selectors'
export type ProjectRuntimeSessionSummary = {
liveTerminalCount: number
@@ -6,7 +6,7 @@ import {
getHookSettingsDraft,
type HookSettingsPolicyDraft,
type LocalHookName
} from './repository-hook-settings-draft'
} from './repository/execution/repository-hook-settings-draft'
export function useRepositoryHookSettingsDraft({
repo,
@@ -10,7 +10,7 @@ import type { TerminalTab } from '../../../shared/terminal-tab-types'
import type { Worktree } from '../../../shared/worktree/types'
import { WORKTREE_ID_SEPARATOR } from '../../../shared/worktree/id'
import { getLocalPreflightContext } from '../lib/local-preflight-context'
import { getProjectRuntimeSessionSummary } from '../components/settings/repository-runtime-session-summary'
import { getProjectRuntimeSessionSummary } from '../components/settings/repository/execution/repository-runtime-session-summary'
import type { AppState } from './types'
import { selectRepoByIdForActiveWorkspace } from './selectors'