From 70ab09ca2fb36a4f6d6827a90c7669174c01f27c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 21 Oct 2026 21:54:24 -0700 Subject: [PATCH] refactor(settings): group repository identity modules (#31830) --- ...AccountSection.inventory-lifetime.test.tsx | 6 +++--- .../RepositoryGitHubAccountSection.test.tsx | 8 ++++---- .../RepositoryGitHubAccountSection.tsx | 4 ++-- .../settings/RepositoryPane.test.ts | 9 +++------ .../components/settings/RepositoryPane.tsx | 9 ++++----- .../RepositoryForkSyncSection.test.tsx | 6 +++--- .../identity}/RepositoryForkSyncSection.tsx | 18 +++++++++--------- .../identity}/RepositoryIconColorSection.tsx | 8 ++++---- .../RepositoryIconEmojiPicker.test.tsx | 4 ++-- .../identity}/RepositoryIconEmojiPicker.tsx | 6 +++--- ...yIconPicker.github-avatar-refresh.test.tsx | 2 +- .../identity}/RepositoryIconPicker.tsx | 19 +++++++++++-------- .../identity}/RepositoryIconTabs.tsx | 14 +++++++------- .../identity}/repository-github-account.ts | 10 +++++----- .../identity}/repository-icon-github.test.ts | 4 ++-- .../identity}/repository-icon-github.ts | 14 +++++++++----- .../identity}/repository-identity-search.ts | 4 ++-- 17 files changed, 74 insertions(+), 71 deletions(-) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryForkSyncSection.test.tsx (91%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryForkSyncSection.tsx (93%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconColorSection.tsx (92%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconEmojiPicker.test.tsx (98%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconEmojiPicker.tsx (93%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconPicker.github-avatar-refresh.test.tsx (98%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconPicker.tsx (92%) rename src/renderer/src/components/settings/{ => repository/identity}/RepositoryIconTabs.tsx (93%) rename src/renderer/src/components/settings/{ => repository/identity}/repository-github-account.ts (87%) rename src/renderer/src/components/settings/{ => repository/identity}/repository-icon-github.test.ts (98%) rename src/renderer/src/components/settings/{ => repository/identity}/repository-icon-github.ts (88%) rename src/renderer/src/components/settings/{ => repository/identity}/repository-identity-search.ts (69%) diff --git a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx index b9d5d2e32ee..84559777aa0 100644 --- a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx +++ b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx @@ -7,7 +7,7 @@ import type { Repo } from '../../../../shared/repo-types' import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { GhAccountBinding } from '../../../../shared/github/account-binding' import type { GhAccountBindingInventory } from '../../../../shared/github/auth-types' -import type * as RepositoryGitHubAccountModule from './repository-github-account' +import type * as RepositoryGitHubAccountModule from './repository/identity/repository-github-account' import { RepositoryGitHubAccountSection } from './RepositoryGitHubAccountSection' const { listAccountsMock, validateBindingMock, storeState } = vi.hoisted(() => { @@ -19,7 +19,7 @@ const { listAccountsMock, validateBindingMock, storeState } = vi.hoisted(() => { return { listAccountsMock: vi.fn(), validateBindingMock: vi.fn(), storeState } }) -vi.mock('../../store', () => { +vi.mock('@/store/index', () => { const useAppStore = (selector: (state: typeof storeState) => unknown) => selector(storeState) useAppStore.getState = () => storeState return { useAppStore } @@ -27,7 +27,7 @@ vi.mock('../../store', () => { vi.mock('@/runtime/runtime-rpc-client', () => ({ callRuntimeRpc: vi.fn() })) -vi.mock('./repository-github-account', async (importOriginal) => ({ +vi.mock('./repository/identity/repository-github-account', async (importOriginal) => ({ ...(await importOriginal()), listRepositoryGhBindableAccounts: listAccountsMock, validateRepositoryGhAccountBinding: validateBindingMock diff --git a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx index aa2aa251f42..678af2ade2b 100644 --- a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx +++ b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.test.tsx @@ -10,8 +10,8 @@ import type { GhMultiAccountCapability } from '../../../../shared/github/auth-types' import type { GhAccountBinding } from '../../../../shared/github/account-binding' -import type * as RepositoryGitHubAccountModule from './repository-github-account' -import { isGhAccountBindingEnforced } from './repository-github-account' +import type * as RepositoryGitHubAccountModule from './repository/identity/repository-github-account' +import { isGhAccountBindingEnforced } from './repository/identity/repository-github-account' import { RepositoryGitHubAccountSection } from './RepositoryGitHubAccountSection' const { listAccountsMock, validateBindingMock, storeState } = vi.hoisted(() => { @@ -27,7 +27,7 @@ const { listAccountsMock, validateBindingMock, storeState } = vi.hoisted(() => { } }) -vi.mock('../../store', () => { +vi.mock('@/store/index', () => { const useAppStore = (selector: (state: typeof storeState) => unknown) => selector(storeState) useAppStore.getState = () => storeState return { useAppStore } @@ -35,7 +35,7 @@ vi.mock('../../store', () => { vi.mock('@/runtime/runtime-rpc-client', () => ({ callRuntimeRpc: vi.fn() })) -vi.mock('./repository-github-account', async (importOriginal) => ({ +vi.mock('./repository/identity/repository-github-account', async (importOriginal) => ({ ...(await importOriginal()), listRepositoryGhBindableAccounts: listAccountsMock, validateRepositoryGhAccountBinding: validateBindingMock diff --git a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.tsx b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.tsx index 5d10750e657..e4c4e1cb528 100644 --- a/src/renderer/src/components/settings/RepositoryGitHubAccountSection.tsx +++ b/src/renderer/src/components/settings/RepositoryGitHubAccountSection.tsx @@ -6,7 +6,7 @@ import type { GhAccountBindingInventory } from '../../../../shared/github/auth-t import { Button } from '../ui/button' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' import { SearchableSetting } from './SearchableSetting' -import { useAppStore } from '../../store' +import { useAppStore } from '@/store/index' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' import { translate } from '@/i18n/i18n' @@ -15,7 +15,7 @@ import { isGhAccountBindingEnforced, listRepositoryGhBindableAccounts, validateRepositoryGhAccountBinding -} from './repository-github-account' +} from './repository/identity/repository-github-account' type RepositoryGitHubAccountSectionProps = { repo: Repo diff --git a/src/renderer/src/components/settings/RepositoryPane.test.ts b/src/renderer/src/components/settings/RepositoryPane.test.ts index 54518e4932b..a1b70da8f4d 100644 --- a/src/renderer/src/components/settings/RepositoryPane.test.ts +++ b/src/renderer/src/components/settings/RepositoryPane.test.ts @@ -9,12 +9,9 @@ import type { Project } from '../../../../shared/project-types' import type { Repo } from '../../../../shared/repo-types' import type { TerminalTab } from '../../../../shared/terminal-tab-types' import type { AgentStatusEntry } from '../../../../shared/agent-status-types' -import { useAppStore } from '../../store' -import { - getRepositoryPaneSearchEntries, - matchesRepositoryIdentitySearch, - RepositoryPane -} from './RepositoryPane' +import { useAppStore } from '@/store/index' +import { getRepositoryPaneSearchEntries, RepositoryPane } from './RepositoryPane' +import { matchesRepositoryIdentitySearch } from './repository/identity/repository-identity-search' import { matchesSettingsSearch } from './settings-search' import { TooltipProvider } from '../ui/tooltip' diff --git a/src/renderer/src/components/settings/RepositoryPane.tsx b/src/renderer/src/components/settings/RepositoryPane.tsx index 04d94b62a01..9927b714354 100644 --- a/src/renderer/src/components/settings/RepositoryPane.tsx +++ b/src/renderer/src/components/settings/RepositoryPane.tsx @@ -17,23 +17,22 @@ import { SearchableSetting } from './SearchableSetting' import { RepositoryRemoveProjectButton } from './RepositoryRemoveProjectButton' import type { SettingsProjectRemovalScope } from './settings-project-list' import { matchesSettingsSearch } from './settings-search' -import { useAppStore } from '../../store' +import { useAppStore } from '@/store/index' import { getRepositoryIconSectionId } from './repository-settings-targets' -import { RepositoryIconPicker } from './RepositoryIconPicker' +import { RepositoryIconPicker } from './repository/identity/RepositoryIconPicker' import { getRepositoryPaneSearchEntries } from './repository-search' import { RepositoryHostSetupsSection } from './RepositoryHostSetupsSection' import { RepoSettingsDraftInput } from './RepositorySettingsDraftInput' -import { RepositoryForkSyncSection } from './RepositoryForkSyncSection' +import { RepositoryForkSyncSection } from './repository/identity/RepositoryForkSyncSection' import { RepositoryGitHubAccountSection } from './RepositoryGitHubAccountSection' import { translate } from '@/i18n/i18n' import { RepositoryWindowsRuntimeSection } from './RepositoryWindowsRuntimeSection' -import { matchesRepositoryIdentitySearch } from './repository-identity-search' +import { matchesRepositoryIdentitySearch } from './repository/identity/repository-identity-search' import { RepositoryWorktreeDefaultsSection } from './RepositoryWorktreeDefaultsSection' import { RepositoryJiraProjectSection } from './RepositoryJiraProjectSection' import { getProjectRuntimeSessionSummary } from './repository-runtime-session-summary' import { getRepoOwnerWorktreeVisibilityDefaults } from '../../store/worktree-visibility-defaults-by-host' export { getRepositoryPaneSearchEntries } -export { matchesRepositoryIdentitySearch } from './repository-identity-search' type RepositoryPaneRepoUpdate = Omit< Partial, diff --git a/src/renderer/src/components/settings/RepositoryForkSyncSection.test.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.test.tsx similarity index 91% rename from src/renderer/src/components/settings/RepositoryForkSyncSection.test.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.test.tsx index 48a89dfefd4..35effa903c4 100644 --- a/src/renderer/src/components/settings/RepositoryForkSyncSection.test.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.test.tsx @@ -1,16 +1,16 @@ // @vitest-environment happy-dom import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../../shared/repo-types' import { RepositoryForkSyncSection } from './RepositoryForkSyncSection' const syncRuntimeGitForkDefaultBranch = vi.fn() -vi.mock('../../runtime/runtime-git-sync-client', () => ({ +vi.mock('../../../../runtime/runtime-git-sync-client', () => ({ syncRuntimeGitForkDefaultBranch: (...args: unknown[]) => syncRuntimeGitForkDefaultBranch(...args) })) -vi.mock('../../store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ settingsSearchQuery: '', settings: { activeRuntimeEnvironmentId: 'env-1' } }) })) diff --git a/src/renderer/src/components/settings/RepositoryForkSyncSection.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx similarity index 93% rename from src/renderer/src/components/settings/RepositoryForkSyncSection.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx index 533b8e545a0..a66c372d897 100644 --- a/src/renderer/src/components/settings/RepositoryForkSyncSection.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx @@ -1,18 +1,18 @@ import { useRef, useState } from 'react' import { RefreshCw } from 'lucide-react' import { toast } from 'sonner' -import type { ForkSyncMode, GitForkSyncResult } from '../../../../shared/git-fork-sync' -import type { Repo } from '../../../../shared/repo-types' -import { getRepoMainWorktreeId } from '../../../../shared/worktree/id' -import { Button } from '../ui/button' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSegmentedControl } from './SettingsFormControls' -import { syncRuntimeGitForkDefaultBranch } from '../../runtime/runtime-git-sync-client' +import type { ForkSyncMode, GitForkSyncResult } from '../../../../../../shared/git-fork-sync' +import type { Repo } from '../../../../../../shared/repo-types' +import { getRepoMainWorktreeId } from '../../../../../../shared/worktree/id' +import { Button } from '../../../ui/button' +import { SearchableSetting } from '../../SearchableSetting' +import { SettingsSegmentedControl } from '../../SettingsFormControls' +import { syncRuntimeGitForkDefaultBranch } from '../../../../runtime/runtime-git-sync-client' import { ipcOrRuntimeTargetForHostId } from '@/runtime/runtime-client-target' import { UNRESOLVED_GIT_HOST_ERROR } from '@/store/slices/editor/actions/git-operation-target' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from '../../settings-search-keywords' type RepositoryForkSyncSectionProps = { repo: Repo diff --git a/src/renderer/src/components/settings/RepositoryIconColorSection.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconColorSection.tsx similarity index 92% rename from src/renderer/src/components/settings/RepositoryIconColorSection.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconColorSection.tsx index 7502c534db5..622d34e6f6c 100644 --- a/src/renderer/src/components/settings/RepositoryIconColorSection.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconColorSection.tsx @@ -1,7 +1,7 @@ -import { DEFAULT_REPO_BADGE_COLOR, REPO_COLORS } from '../../../../shared/constants' -import { normalizeRepoBadgeColor } from '../../../../shared/repo-badge-color' -import { Label } from '../ui/label' -import { ColorPicker } from '../ui/color-picker' +import { DEFAULT_REPO_BADGE_COLOR, REPO_COLORS } from '../../../../../../shared/constants' +import { normalizeRepoBadgeColor } from '../../../../../../shared/repo-badge-color' +import { Label } from '../../../ui/label' +import { ColorPicker } from '../../../ui/color-picker' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/RepositoryIconEmojiPicker.test.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.test.tsx similarity index 98% rename from src/renderer/src/components/settings/RepositoryIconEmojiPicker.test.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.test.tsx index da0292e631b..b69117e3f4a 100644 --- a/src/renderer/src/components/settings/RepositoryIconEmojiPicker.test.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.test.tsx @@ -3,7 +3,7 @@ import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { AppState } from '@/store' +import type { AppState } from '@/store/types' import { RepositoryIconEmojiPicker } from './RepositoryIconEmojiPicker' const toastMocks = vi.hoisted(() => ({ @@ -19,7 +19,7 @@ const storeMocks = vi.hoisted(() => ({ state: { settings: { theme: 'light' } } as Partial })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Partial) => unknown) => selector(storeMocks.state) })) diff --git a/src/renderer/src/components/settings/RepositoryIconEmojiPicker.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.tsx similarity index 93% rename from src/renderer/src/components/settings/RepositoryIconEmojiPicker.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.tsx index 9a97d07fbf6..af39895c78b 100644 --- a/src/renderer/src/components/settings/RepositoryIconEmojiPicker.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconEmojiPicker.tsx @@ -1,8 +1,8 @@ import { toast } from 'sonner' import EmojiPicker, { EmojiStyle, Theme, type EmojiClickData } from 'emoji-picker-react' -import type { RepoIcon } from '../../../../shared/repo-icon' -import { sanitizeRepoIcon } from '../../../../shared/repo-icon' -import { useAppStore } from '../../store' +import type { RepoIcon } from '../../../../../../shared/repo-icon' +import { sanitizeRepoIcon } from '../../../../../../shared/repo-icon' +import { useAppStore } from '@/store/index' import { useSystemPrefersDark } from '@/components/terminal-pane/use-system-prefers-dark' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/RepositoryIconPicker.github-avatar-refresh.test.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.github-avatar-refresh.test.tsx similarity index 98% rename from src/renderer/src/components/settings/RepositoryIconPicker.github-avatar-refresh.test.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.github-avatar-refresh.test.tsx index 0f37c4c1271..6990d53da5b 100644 --- a/src/renderer/src/components/settings/RepositoryIconPicker.github-avatar-refresh.test.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.github-avatar-refresh.test.tsx @@ -3,7 +3,7 @@ import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../../shared/repo-types' import { RepositoryIconPicker } from './RepositoryIconPicker' vi.mock('@/runtime/runtime-rpc-client', () => ({ callRuntimeRpc: vi.fn() })) diff --git a/src/renderer/src/components/settings/RepositoryIconPicker.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx similarity index 92% rename from src/renderer/src/components/settings/RepositoryIconPicker.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx index f37929e73c0..b8514156a23 100644 --- a/src/renderer/src/components/settings/RepositoryIconPicker.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconPicker.tsx @@ -1,15 +1,18 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'sonner' import { RotateCcw } from 'lucide-react' -import type { Repo } from '../../../../shared/repo-types' -import type { RepoIcon } from '../../../../shared/repo-icon' -import { DEFAULT_REPO_BADGE_COLOR } from '../../../../shared/constants' -import { normalizeRepoBadgeColor } from '../../../../shared/repo-badge-color' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { RepoIconGlyph, getRepoLucideIconOptions } from '../repo/repo-icon' +import type { Repo } from '../../../../../../shared/repo-types' +import type { RepoIcon } from '../../../../../../shared/repo-icon' +import { DEFAULT_REPO_BADGE_COLOR } from '../../../../../../shared/constants' +import { normalizeRepoBadgeColor } from '../../../../../../shared/repo-badge-color' +import { Button } from '../../../ui/button' +import { Label } from '../../../ui/label' +import { RepoIconGlyph, getRepoLucideIconOptions } from '../../../repo/repo-icon' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' -import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../shared/execution-host' +import { + getRepoExecutionHostId, + parseExecutionHostId +} from '../../../../../../shared/execution-host' import { useMountedRef } from '@/hooks/useMountedRef' import { RepositoryIconColorSection } from './RepositoryIconColorSection' import { RepositoryIconTabs } from './RepositoryIconTabs' diff --git a/src/renderer/src/components/settings/RepositoryIconTabs.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryIconTabs.tsx similarity index 93% rename from src/renderer/src/components/settings/RepositoryIconTabs.tsx rename to src/renderer/src/components/settings/repository/identity/RepositoryIconTabs.tsx index 1d695da6085..ac4ce93367f 100644 --- a/src/renderer/src/components/settings/RepositoryIconTabs.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryIconTabs.tsx @@ -1,13 +1,13 @@ import { Suspense, useState } from 'react' import { toast } from 'sonner' import { Github, Image, Link2 } from 'lucide-react' -import type { RepoIcon } from '../../../../shared/repo-icon' -import { faviconUrlFromWebsite } from '../../../../shared/repo-icon' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { getRepoLucideIconOptions } from '../repo/repo-icon' +import type { RepoIcon } from '../../../../../../shared/repo-icon' +import { faviconUrlFromWebsite } from '../../../../../../shared/repo-icon' +import { Button } from '../../../ui/button' +import { Input } from '../../../ui/input' +import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../ui/tabs' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' +import { getRepoLucideIconOptions } from '../../../repo/repo-icon' import { useMountedRef } from '@/hooks/useMountedRef' import { translate } from '@/i18n/i18n' import { lazyWithRetry } from '@/lib/lazy-with-retry' diff --git a/src/renderer/src/components/settings/repository-github-account.ts b/src/renderer/src/components/settings/repository/identity/repository-github-account.ts similarity index 87% rename from src/renderer/src/components/settings/repository-github-account.ts rename to src/renderer/src/components/settings/repository/identity/repository-github-account.ts index 47bf7d31a33..3376948e3df 100644 --- a/src/renderer/src/components/settings/repository-github-account.ts +++ b/src/renderer/src/components/settings/repository/identity/repository-github-account.ts @@ -1,12 +1,12 @@ -import type { GhAccountBinding } from '../../../../shared/github/account-binding' -import type { Repo } from '../../../../shared/repo-types' +import type { GhAccountBinding } from '../../../../../../shared/github/account-binding' +import type { Repo } from '../../../../../../shared/repo-types' import type { GhAccountBindingInventory, GhAccountBindingValidationResult -} from '../../../../shared/github/auth-types' -import { ghAccountBindingsEqual } from '../../../../shared/github/account-binding' +} from '../../../../../../shared/github/auth-types' +import { ghAccountBindingsEqual } from '../../../../../../shared/github/account-binding' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' -import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target' +import type { RuntimeClientTarget } from '../../../../../../shared/runtime-client-target' const LOCAL_GH_ACCOUNT_IPC_TIMEOUT_MS = 30_000 diff --git a/src/renderer/src/components/settings/repository-icon-github.test.ts b/src/renderer/src/components/settings/repository/identity/repository-icon-github.test.ts similarity index 98% rename from src/renderer/src/components/settings/repository-icon-github.test.ts rename to src/renderer/src/components/settings/repository/identity/repository-icon-github.test.ts index bf75c418f8f..ddc79b6c81d 100644 --- a/src/renderer/src/components/settings/repository-icon-github.test.ts +++ b/src/renderer/src/components/settings/repository/identity/repository-icon-github.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' -import { githubAvatarIcon } from '../../../../shared/repo-icon' +import type { Repo } from '../../../../../../shared/repo-types' +import { githubAvatarIcon } from '../../../../../../shared/repo-icon' import { buildRepositoryGitHubAvatarUpdate, resolveRepositoryGitHubAvatar diff --git a/src/renderer/src/components/settings/repository-icon-github.ts b/src/renderer/src/components/settings/repository/identity/repository-icon-github.ts similarity index 88% rename from src/renderer/src/components/settings/repository-icon-github.ts rename to src/renderer/src/components/settings/repository/identity/repository-icon-github.ts index 8e60b4f6fdb..cd405382452 100644 --- a/src/renderer/src/components/settings/repository-icon-github.ts +++ b/src/renderer/src/components/settings/repository/identity/repository-icon-github.ts @@ -1,9 +1,13 @@ -import type { GitHubRepositoryIdentity } from '../../../../shared/github/pull-request-types' -import type { Repo } from '../../../../shared/repo-types' -import { githubAvatarIcon, githubAvatarSlug, type RepoIcon } from '../../../../shared/repo-icon' -import { githubRepoIdentityKey } from '../../../../shared/github/repository-identity-key' +import type { GitHubRepositoryIdentity } from '../../../../../../shared/github/pull-request-types' +import type { Repo } from '../../../../../../shared/repo-types' +import { + githubAvatarIcon, + githubAvatarSlug, + type RepoIcon +} from '../../../../../../shared/repo-icon' +import { githubRepoIdentityKey } from '../../../../../../shared/github/repository-identity-key' import { callRuntimeRpc } from '@/runtime/runtime-rpc-client' -import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target' +import type { RuntimeClientTarget } from '../../../../../../shared/runtime-client-target' type ResolveRepositoryGitHubAvatarOptions = { forceLive?: boolean diff --git a/src/renderer/src/components/settings/repository-identity-search.ts b/src/renderer/src/components/settings/repository/identity/repository-identity-search.ts similarity index 69% rename from src/renderer/src/components/settings/repository-identity-search.ts rename to src/renderer/src/components/settings/repository/identity/repository-identity-search.ts index 0be209f66d1..887f008358a 100644 --- a/src/renderer/src/components/settings/repository-identity-search.ts +++ b/src/renderer/src/components/settings/repository/identity/repository-identity-search.ts @@ -1,5 +1,5 @@ -import type { Repo } from '../../../../shared/repo-types' -import { normalizeSettingsSearchQuery } from './settings-search' +import type { Repo } from '../../../../../../shared/repo-types' +import { normalizeSettingsSearchQuery } from '../../settings-search' export function matchesRepositoryIdentitySearch(query: string, repo: Repo): boolean { const normalizedQuery = normalizeSettingsSearchQuery(query)