diff --git a/config/direct-link-open-baseline.txt b/config/direct-link-open-baseline.txt index 8113b5af389..4ec948a7670 100644 --- a/config/direct-link-open-baseline.txt +++ b/config/direct-link-open-baseline.txt @@ -22,9 +22,9 @@ 1 src/renderer/src/components/right-sidebar/ssh-forwarded-ports-section.tsx 1 src/renderer/src/components/right-sidebar/ssh-ports-panel.tsx 1 src/renderer/src/components/settings/CodexLoginLinkNotice.tsx -1 src/renderer/src/components/settings/GeneralSupportSection.tsx +1 src/renderer/src/components/settings/general/GeneralSupportSection.tsx 1 src/renderer/src/components/settings/HostAccountSignInPrompt.tsx -1 src/renderer/src/components/settings/ReleaseChannelSection.tsx +1 src/renderer/src/components/settings/updates/ReleaseChannelSection.tsx 1 src/renderer/src/components/settings/bitbucket-credentials-dialog.tsx 1 src/renderer/src/components/settings/bitbucket-integration-card.tsx 1 src/renderer/src/components/stats/ShareUsageButton.tsx diff --git a/config/focus-setting-read-baseline.txt b/config/focus-setting-read-baseline.txt index f9e403dc5d9..f6d347e7f32 100644 --- a/config/focus-setting-read-baseline.txt +++ b/config/focus-setting-read-baseline.txt @@ -72,32 +72,32 @@ 1 src/renderer/src/components/settings/BaseRefPicker.tsx 1 src/renderer/src/components/settings/bitbucket-credentials-dialog.tsx 1 src/renderer/src/components/settings/bitbucket-integration-card.tsx -2 src/renderer/src/components/settings/BrowserPane.tsx +2 src/renderer/src/components/settings/browser/BrowserPane.tsx 3 src/renderer/src/components/settings/cli-source-control-integration-cards.tsx 1 src/renderer/src/components/settings/CliSkillRuntimeSetup.tsx -1 src/renderer/src/components/settings/GeneralPane.tsx +1 src/renderer/src/components/settings/general/GeneralPane.tsx 1 src/renderer/src/components/settings/IntegrationsPane.tsx 3 src/renderer/src/components/settings/jira-integration-card.tsx 1 src/renderer/src/components/settings/linear-agent-skill-install-cta.tsx 3 src/renderer/src/components/settings/LinearAgentSkillPane.tsx 1 src/renderer/src/components/settings/provider-account-scope.ts 4 src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx -2 src/renderer/src/components/settings/settings-setup-guide-progress.ts +2 src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts 2 src/renderer/src/components/settings/Settings.tsx -1 src/renderer/src/components/settings/SettingsSetupGuidePane.tsx -1 src/renderer/src/components/settings/SettingsSidebar.tsx -1 src/renderer/src/components/settings/ShortcutsPane.tsx +1 src/renderer/src/components/settings/setup-guide/SettingsSetupGuidePane.tsx +1 src/renderer/src/components/settings/navigation/SettingsSidebar.tsx +1 src/renderer/src/components/settings/shortcuts/ShortcutsPane.tsx 1 src/renderer/src/components/settings/source-control-preflight-card-status.ts 2 src/renderer/src/components/settings/task-tracker-integration-cards.tsx 2 src/renderer/src/components/settings/TasksPane.tsx 2 src/renderer/src/components/settings/token-source-control-integration-cards.tsx 2 src/renderer/src/components/settings/use-integration-provider-status-refresh.ts 1 src/renderer/src/components/settings/use-runtime-environment-mutation-actions.ts -2 src/renderer/src/components/settings/use-settings-navigation-model.ts -3 src/renderer/src/components/settings/use-settings-store-model.ts -2 src/renderer/src/components/settings/use-settings-terminal-model.ts +2 src/renderer/src/components/settings/navigation/use-settings-navigation-model.ts +3 src/renderer/src/components/settings/page/use-settings-store-model.ts +2 src/renderer/src/components/settings/page/use-settings-terminal-model.ts 4 src/renderer/src/components/settings/use-task-source-provider-readiness.ts -1 src/renderer/src/components/settings/WorkspaceDirectorySetting.tsx +1 src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx 1 src/renderer/src/components/setup-guide/SetupGuideModal.tsx 1 src/renderer/src/components/setup-guide/SetupGuideTelemetryObserver.tsx 2 src/renderer/src/components/setup-guide/use-setup-guide-progress.ts diff --git a/config/host-list-render-baseline.txt b/config/host-list-render-baseline.txt index 18a57844519..9590a474856 100644 --- a/config/host-list-render-baseline.txt +++ b/config/host-list-render-baseline.txt @@ -4,9 +4,9 @@ 1 src/renderer/src/components/automations/AutomationRunsDashboard.tsx 1 src/renderer/src/components/right-sidebar/AiVaultPanelControls.tsx 1 src/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsx -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/browser/profiles/BrowserSessionCookiesSection.tsx +1 src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx +1 src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.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 diff --git a/config/localization-coverage-allowlist.json b/config/localization-coverage-allowlist.json index 77b745b7301..5b9fb0b285e 100644 --- a/config/localization-coverage-allowlist.json +++ b/config/localization-coverage-allowlist.json @@ -1,104 +1,104 @@ [ { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "Idioma", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "Langue", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "Dil", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "Sprache", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "언어", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "言語", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "語言", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/appearance-search.ts", + "filePath": "src/renderer/src/components/settings/appearance/appearance-search.ts", "kind": "object-property:keywords", "text": "语言", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/terminal-advanced-platform-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts", "kind": "object-property:keywords", "text": "ghostty", "dynamic": false, "count": 2 }, { - "filePath": "src/renderer/src/components/settings/terminal-advanced-platform-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts", "kind": "object-property:keywords", "text": "Ghostty", "dynamic": false, "count": 2 }, { - "filePath": "src/renderer/src/components/settings/terminal-advanced-platform-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts", "kind": "object-property:keywords", "text": "Kitty", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/terminal-advanced-platform-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts", "kind": "object-property:keywords", "text": "kitty", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/terminal-advanced-platform-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts", "kind": "object-property:keywords", "text": "kitty.conf", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/terminal-pane-appearance-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/appearance/terminal-pane-appearance-search.ts", "kind": "object-property:keywords", "text": "ghostty", "dynamic": false, "count": 1 }, { - "filePath": "src/renderer/src/components/settings/terminal-pane-appearance-search.ts", + "filePath": "src/renderer/src/components/settings/terminal/appearance/terminal-pane-appearance-search.ts", "kind": "object-property:keywords", "text": "Ghostty", "dynamic": false, @@ -133,7 +133,7 @@ "count": 1 }, { - "filePath": "src/renderer/src/components/settings/ChatFontFamilySetting.tsx", + "filePath": "src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx", "kind": "jsx-text", "text": "fontFamily", "dynamic": false, diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index c5abfe39ec5..7649c43e199 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -1541,17 +1541,19 @@ "coveredProviders": [], "coverageNotes": "Actual GeneralPane, update/version and remote-status components with mocked store/API; actual autosave form. Windows runtime on/off simulated. No physical updater, paired host, settings write or native input.", "motivatingLinks": [ - "https://github.com/stablyai/orca/blob/main/src/renderer/src/components/settings/GeneralPane.tsx" + "https://github.com/stablyai/orca/blob/main/src/renderer/src/components/settings/general/GeneralPane.tsx" ], "invariant": "A matching General settings section retains its owner and state as preceding search results disappear; an actually removed section releases its owner and reloads when shown again.", "oracle": "Across 14 matching searches the Updates section keeps the same DOM node and the version-read and remote-refresh counts do not grow, instead of six each. Store-published remote update state still reaches the retained section. Explicit refresh and genuine hide/reopen still read; drafts yield to externally changed saved settings; a removed owner cannot publish its late version.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx" + "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx" + ], + "testFiles": [ + "src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx" ], - "testFiles": ["src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx"], "assertionRefs": [ { - "file": "src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx", + "file": "src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx", "assertions": [ "keeps showing store-published remote update state without a remount", "keeps explicit remote refresh and true hide/reopen reads", @@ -1566,6 +1568,7 @@ "runner": "local", "platform": "macos", "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx", + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx", "result": "passed", "durationSeconds": 1.89, "summary": "7 tests/1 suite pass after the shared SettingsSectionStack adoption. Read-count oracles restated as node identity plus non-growing counts; original main fails both retained-section cases, the draft, the release-picker reveal and the late-version publish." @@ -1693,20 +1696,20 @@ "coveredProviders": [], "coverageNotes": "Actual TerminalPane, ManageSessionsSection, health listener and scrollback form with mocked store/provider and display/action boundaries. Unix/Windows and Mac-client/Windows-host flags simulated; no physical provider, process-stop or native input coverage.", "motivatingLinks": [ - "https://github.com/stablyai/orca/blob/main/src/renderer/src/components/settings/TerminalPane.tsx" + "https://github.com/stablyai/orca/blob/main/src/renderer/src/components/settings/terminal/TerminalPane.tsx" ], "invariant": "A matching settings section retains its state when preceding sections are filtered away; a section removed from search releases its owner and refreshes when shown again. A retained section still refreshes when another surface invalidates the session inventory. Diagnostic inventory never becomes authority for process death.", "oracle": "Across 15 matched search edits the matched section keeps the same DOM node and the inventory/health read counts do not grow, instead of six reads each. A foreign inventory invalidation still reads once on the retained section and not after unmount. A draft and pending target survive matched search; actual hide/reopen reloads, explicit Refresh still reads, and hidden/unmounted health listeners do not fire.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx" + "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx" ], "testFiles": [ - "src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx", - "src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx" + "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx", + "src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx" ], "assertionRefs": [ { - "file": "src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx", + "file": "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx", "assertions": [ "refreshes a retained section when another surface invalidates the inventory", "refreshes explicitly, reloads genuinely hidden sections, and removes focus listeners", @@ -1721,6 +1724,7 @@ "runner": "local", "platform": "macos", "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx", + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx", "result": "passed", "durationSeconds": 1.48, "summary": "12 tests/2 suites pass after the shared SettingsSectionStack adoption and the inventory-invalidation subscription. Read-count oracles restated as node identity plus non-growing read counts; original main fails all three simulated platform cases, the draft, the pending target and the foreign-invalidation refresh." @@ -10641,7 +10645,7 @@ "invariant": "Only an explicit user change in Settings > Remote Orca Servers > Advanced > Active Server may mutate activeRuntimeEnvironmentId. Connecting, pairing, disconnecting, selecting or revealing a workspace or terminal, browser/mobile handoff, remote navigation, and reconnect must use transient or target-owner routing and must never rewrite the durable preference. Every Add Project selected host must satisfy canSelectAddRepoHost; paired web has no local filesystem fallback, so no valid host means Browse, Clone, and Create remain disabled. Every operation stays on the host selected when it began, even if preference or catalog state changes. Generic settings mutation cannot bypass the dedicated preference IPC.", "oracle": "Start with Active Server=Local desktop, connect and navigate Windows 2, then reveal a local terminal and assert it succeeds while the persisted preference remains local before and after restart. Repeat transient routing and selected-runtime Add Project operations with exact-ID host decoys and completion reordering. Separately pair the real web client to an isolated headed host, then make its sole still-listed runtime compatibility-blocked and unavailable. Require a null authoritative selection, a disabled host option, and disabled Browse, Clone, and Create actions with no local fallback. Repeat against headless serve. Run the byte-identical selector/action contract on latest main, candidate, and candidate with the eligibility seam disabled.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser-session-host-selection.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1", + "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser-session-host-selection.test.ts src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx src/renderer/src/components/sidebar/NonGitFolderDialog.test.tsx src/renderer/src/components/sidebar/AddRepoDialog.default-checkout.test.ts src/renderer/src/components/sidebar/project-added-default-checkout.test.ts src/renderer/src/components/sidebar/worktree-list/listing/host-filtering.test.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/lib/worktree-runtime-owner.test.ts src/renderer/src/store/slices/repos-catalog-reconciliation.test.ts src/renderer/src/store/slices/repos-project-groups.test.ts src/renderer/src/store/slices/repos-selected-owner-routing.test.ts src/renderer/src/store/slices/selected-host-active-workspace-identity.test.ts src/renderer/src/store/slices/worktrees-fetch-owner-routing.test.ts --maxWorkers=1", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts src/renderer/src/components/sidebar/AddRepoStartSteps.test.tsx --maxWorkers=1", "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx src/renderer/src/components/sidebar/NonGitFolderDialog.test.tsx src/renderer/src/components/sidebar/AddRepoDialog.default-checkout.test.ts src/renderer/src/components/sidebar/project-added-default-checkout.test.ts src/renderer/src/components/sidebar/worktree-list/listing/host-filtering.test.ts src/renderer/src/lib/resolved-worktree-execution-host.test.ts src/renderer/src/lib/worktree-runtime-owner.test.ts src/renderer/src/store/slices/repos-catalog-reconciliation.test.ts src/renderer/src/store/slices/repos-project-groups.test.ts src/renderer/src/store/slices/repos-selected-owner-routing.test.ts src/renderer/src/store/slices/selected-host-active-workspace-identity.test.ts src/renderer/src/store/slices/worktrees-fetch-owner-routing.test.ts --maxWorkers=1", @@ -10655,7 +10659,7 @@ "src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts", "src/renderer/src/store/slices/settings.test.ts", "src/renderer/src/store/slices/browser-session-host-selection.test.ts", - "src/renderer/src/components/settings/browser-session-host-selection.test.ts", + "src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts", "src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts", "src/renderer/src/components/sidebar/add-repo-browse-authority.test.ts", "src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts", @@ -10711,7 +10715,7 @@ ] }, { - "file": "src/renderer/src/components/settings/browser-session-host-selection.test.ts", + "file": "src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts", "assertions": [ "a removed transient server override falls back to an available host instead of leaving browser settings on an invalid option" ] @@ -10796,7 +10800,7 @@ "runner": "local", "platform": "macos", "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/components/status-bar/SshStatusSegment.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser-session-host-selection.test.ts src/renderer/src/components/settings/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1", + "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/settings.test.ts src/main/ipc/runtime-environments/runtime-environments-pairing.test.ts src/renderer/src/store/slices/settings.test.ts src/renderer/src/store/slices/browser-session-host-selection.test.ts src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts src/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.ts src/renderer/src/web/web-preload-api-runtime-environment.test.ts --maxWorkers=1", "result": "passed", "durationSeconds": 6.55, "summary": "Ten files and 282 tests passed, including the composed Local -> Windows 2 navigation -> local reveal -> restart regression, dedicated-only preference persistence, removed transient-host fallback, multi-client browser routing, late host-operation suppression, and web pairing/preference separation." @@ -20879,7 +20883,7 @@ "invariant": "A packaged macOS daemon runs from the verified signed helper copy for its build, which the updater never touches, and never beside a job that may own the endpoint; the fork fallback still fits the startup gate. A copy is deleted only when lsof proves it unused.", "oracle": "Deterministic launch, fallback-deadline, per-build copy, retirement and status tests, plus the signed launcher validation recorded in #25848.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/macos-daemon-bundle.test.ts src/main/daemon/macos-daemon-launchd.test.ts src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts src/main/daemon/macos-daemon-job-state.test.ts src/main/daemon/macos-daemon-bundle-retirement.test.ts src/main/daemon/daemon-full-disk-access-status.test.ts config/scripts/macos-folder-usage-descriptions.test.mjs src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx" + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/macos-daemon-bundle.test.ts src/main/daemon/macos-daemon-launchd.test.ts src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts src/main/daemon/macos-daemon-job-state.test.ts src/main/daemon/macos-daemon-bundle-retirement.test.ts src/main/daemon/daemon-full-disk-access-status.test.ts config/scripts/macos-folder-usage-descriptions.test.mjs src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx" ], "testFiles": [ "src/main/daemon/macos-daemon-bundle.test.ts", @@ -20889,7 +20893,7 @@ "src/main/daemon/macos-daemon-bundle-retirement.test.ts", "src/main/daemon/daemon-full-disk-access-status.test.ts", "config/scripts/macos-folder-usage-descriptions.test.mjs", - "src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx" + "src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx" ], "assertionRefs": [ { @@ -20921,7 +20925,7 @@ "runner": "local", "platform": "macos", "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/macos-daemon-bundle.test.ts src/main/daemon/macos-daemon-launchd.test.ts src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts src/main/daemon/macos-daemon-job-state.test.ts src/main/daemon/macos-daemon-bundle-retirement.test.ts src/main/daemon/daemon-full-disk-access-status.test.ts src/main/daemon/daemon-pty-adapter-full-disk-access.test.ts config/scripts/macos-folder-usage-descriptions.test.mjs src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx", - "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/macos-daemon-bundle.test.ts src/main/daemon/macos-daemon-launchd.test.ts src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts src/main/daemon/macos-daemon-job-state.test.ts src/main/daemon/macos-daemon-bundle-retirement.test.ts src/main/daemon/daemon-full-disk-access-status.test.ts config/scripts/macos-folder-usage-descriptions.test.mjs src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx", + "currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/macos-daemon-bundle.test.ts src/main/daemon/macos-daemon-launchd.test.ts src/main/daemon/daemon-init-macos-stable-launch-fallback.test.ts src/main/daemon/macos-daemon-job-state.test.ts src/main/daemon/macos-daemon-bundle-retirement.test.ts src/main/daemon/daemon-full-disk-access-status.test.ts config/scripts/macos-folder-usage-descriptions.test.mjs src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx", "result": "passed", "durationSeconds": 2.38, "summary": "All 82 focused launch, fallback-deadline, per-build copy, retirement, status and packaging tests passed." diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 8bcf672468e..3129f3859a2 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -8930,7 +8930,7 @@ "src/renderer/src/components/settings/AccountsPane.test.tsx": 2701, "src/renderer/src/components/settings/AdvancedNetworkSettingsSection.interaction.test.tsx": 2206, "src/renderer/src/components/settings/AdvancedNetworkSettingsSection.test.ts": 1969, - "src/renderer/src/components/settings/AdvancedPane.test.tsx": 599, + "src/renderer/src/components/settings/advanced/AdvancedPane.test.tsx": 599, "src/renderer/src/components/settings/AgentDefaultSurfaceSection.test.tsx": 3070, "src/renderer/src/components/settings/AgentLaunchChoiceEditor.test.tsx": 1565, "src/renderer/src/components/settings/AgentLaunchDefaultsEditor.test.tsx": 1320, @@ -8942,23 +8942,23 @@ "src/renderer/src/components/settings/AgentsPane.test.tsx": 3230, "src/renderer/src/components/settings/AntigravityAccountsSection.test.tsx": 2722, "src/renderer/src/components/settings/AntigravityChatSignInRow.test.tsx": 3258, - "src/renderer/src/components/settings/AppearanceChatContrastControls.draft.test.tsx": 795, - "src/renderer/src/components/settings/AppearanceChatContrastControls.test.tsx": 1122, - "src/renderer/src/components/settings/AppearanceChatSection.test.tsx": 1633, - "src/renderer/src/components/settings/AppearancePane.test.tsx": 2066, - "src/renderer/src/components/settings/ArtifactsSettingsPane.test.tsx": 862, - "src/renderer/src/components/settings/AutomationsSettingsPane.test.tsx": 602, - "src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.test.tsx": 841, - "src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx": 774, - "src/renderer/src/components/settings/BrowserPane.test.ts": 44, - "src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx": 27636, - "src/renderer/src/components/settings/BrowserSitePermissionsSetting.test.tsx": 739, - "src/renderer/src/components/settings/BrowserUserAgentSetting.test.tsx": 2325, - "src/renderer/src/components/settings/ChatBehaviorSetting.test.tsx": 2783, - "src/renderer/src/components/settings/ChatNamingSetting.test.tsx": 2454, - "src/renderer/src/components/settings/ChatPermissionSetting.test.tsx": 834, - "src/renderer/src/components/settings/ChatSettingsSection.navigation.test.tsx": 2540, - "src/renderer/src/components/settings/ChatSettingsSection.test.tsx": 2718, + "src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.draft.test.tsx": 795, + "src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.test.tsx": 1122, + "src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.test.tsx": 1633, + "src/renderer/src/components/settings/appearance/AppearancePane.test.tsx": 2066, + "src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.test.tsx": 862, + "src/renderer/src/components/settings/automations/AutomationsSettingsPane.test.tsx": 602, + "src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.test.tsx": 841, + "src/renderer/src/components/settings/browser/BrowserPane.search-catalog.test.tsx": 774, + "src/renderer/src/components/settings/browser/BrowserPane.test.ts": 44, + "src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.google-cookie-clear.test.tsx": 27636, + "src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.test.tsx": 739, + "src/renderer/src/components/settings/browser/BrowserUserAgentSetting.test.tsx": 2325, + "src/renderer/src/components/settings/chat/ChatBehaviorSetting.test.tsx": 2783, + "src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx": 2454, + "src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx": 834, + "src/renderer/src/components/settings/chat/ChatSettingsSection.navigation.test.tsx": 2540, + "src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx": 2718, "src/renderer/src/components/settings/CliSection.install-failure.test.tsx": 2250, "src/renderer/src/components/settings/CliSection.test.tsx": 2135, "src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx": 1670, @@ -8966,17 +8966,17 @@ "src/renderer/src/components/settings/CodexHistorySharingSetting.test.tsx": 539, "src/renderer/src/components/settings/CodexLoginLinkNotice.test.tsx": 494, "src/renderer/src/components/settings/CommitMessageAiPane.test.tsx": 3099, - "src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx": 2135, + "src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx": 2135, "src/renderer/src/components/settings/EphemeralVmRuntimesSection.test.tsx": 2270, "src/renderer/src/components/settings/EphemeralVmsPane.test.tsx": 1025, - "src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx": 1546, - "src/renderer/src/components/settings/GeneralPane.test.ts": 1266, - "src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.test.tsx": 1989, + "src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx": 1546, + "src/renderer/src/components/settings/general/GeneralPane.test.ts": 1266, + "src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.test.tsx": 1989, "src/renderer/src/components/settings/GrokAccountsSection.test.tsx": 623, "src/renderer/src/components/settings/HostAccountSignInPrompt.test.tsx": 309, "src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx": 7498, - "src/renderer/src/components/settings/KagiSessionLinkForm.test.ts": 403, - "src/renderer/src/components/settings/LocalNetworkConnectionTest.test.tsx": 592, + "src/renderer/src/components/settings/browser/KagiSessionLinkForm.test.ts": 403, + "src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.test.tsx": 592, "src/renderer/src/components/settings/MachineNameField.test.tsx": 557, "src/renderer/src/components/settings/McpConfigSection.host-owner.test.tsx": 1736, "src/renderer/src/components/settings/MobilePairingConnectionOptions.test.tsx": 924, @@ -8984,24 +8984,24 @@ "src/renderer/src/components/settings/MobilePairingSetupSection.test.tsx": 1414, "src/renderer/src/components/settings/MobilePane.test.tsx": 1581, "src/renderer/src/components/settings/NodeDistMirrorDialog.test.tsx": 2412, - "src/renderer/src/components/settings/NotificationHostToggles.test.tsx": 646, - "src/renderer/src/components/settings/NotificationsPane.test.tsx": 1898, + "src/renderer/src/components/settings/notifications/NotificationHostToggles.test.tsx": 646, + "src/renderer/src/components/settings/notifications/NotificationsPane.test.tsx": 1898, "src/renderer/src/components/settings/OrchestrationPane.test.tsx": 2437, "src/renderer/src/components/settings/OrchestrationSkillAgentCoverage.test.tsx": 320, "src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx": 5402, "src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.test.tsx": 712, - "src/renderer/src/components/settings/QuickCommandsList.test.tsx": 622, - "src/renderer/src/components/settings/ReleaseBuildPicker.test.tsx": 1084, - "src/renderer/src/components/settings/ReleaseChannelSection.test.tsx": 2701, + "src/renderer/src/components/settings/quick-commands/QuickCommandsList.test.tsx": 622, + "src/renderer/src/components/settings/updates/ReleaseBuildPicker.test.tsx": 1084, + "src/renderer/src/components/settings/updates/ReleaseChannelSection.test.tsx": 2701, "src/renderer/src/components/settings/RuntimeEnvironmentsPane.test.ts": 297, "src/renderer/src/components/settings/RuntimeHostAccessForm.test.tsx": 379, "src/renderer/src/components/settings/RuntimePairingGeneratorForm.test.tsx": 461, - "src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx": 1474, - "src/renderer/src/components/settings/SettingsConstants.test.ts": 240, - "src/renderer/src/components/settings/SettingsFormControls.font-autocomplete.test.tsx": 1202, - "src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx": 730, - "src/renderer/src/components/settings/ShortcutFilterRail.test.ts": 273, - "src/renderer/src/components/settings/ShortcutsPane.provenance.test.tsx": 2302, + "src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.test.tsx": 1474, + "src/renderer/src/components/settings/appearance/fonts/font-suggestions.test.ts": 240, + "src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx": 1202, + "src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx": 730, + "src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.test.ts": 273, + "src/renderer/src/components/settings/shortcuts/ShortcutsPane.provenance.test.tsx": 2302, "src/renderer/src/components/settings/SparsePresetSettingsSection.test.tsx": 744, "src/renderer/src/components/settings/SshHostDeltaMoveDialog.test.tsx": 438, "src/renderer/src/components/settings/SshHostRecoverServerAction.test.tsx": 669, @@ -9013,19 +9013,19 @@ "src/renderer/src/components/settings/TaskSourceProviderCard.test.tsx": 467, "src/renderer/src/components/settings/TaskSourceSimpleSetup.test.tsx": 527, "src/renderer/src/components/settings/TasksPane.test.tsx": 905, - "src/renderer/src/components/settings/TerminalAdvancedSection.test.tsx": 2148, + "src/renderer/src/components/settings/terminal/TerminalAdvancedSection.test.tsx": 2148, "src/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.ts": 549, - "src/renderer/src/components/settings/TerminalContrastSetting.test.tsx": 798, - "src/renderer/src/components/settings/TerminalLimitSetting.test.tsx": 1015, - "src/renderer/src/components/settings/TerminalPane.pwsh.test.ts": 765, - "src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx": 1237, - "src/renderer/src/components/settings/TerminalSettingsPreview.lifecycle.test.tsx": 595, - "src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx": 401, - "src/renderer/src/components/settings/TerminalThemeSections.lifecycle.test.ts": 1807, - "src/renderer/src/components/settings/VoiceMicrophoneSetting.test.tsx": 957, - "src/renderer/src/components/settings/VoicePane.test.tsx": 1042, - "src/renderer/src/components/settings/VoiceSpeechModelSection.test.tsx": 503, - "src/renderer/src/components/settings/WorkspaceDirectorySetting.test.tsx": 1982, + "src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.test.tsx": 798, + "src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.test.tsx": 1015, + "src/renderer/src/components/settings/terminal/TerminalPane.pwsh.test.ts": 765, + "src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx": 1237, + "src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.lifecycle.test.tsx": 595, + "src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx": 401, + "src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.lifecycle.test.ts": 1807, + "src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.test.tsx": 957, + "src/renderer/src/components/settings/voice/VoicePane.test.tsx": 1042, + "src/renderer/src/components/settings/voice/VoiceSpeechModelSection.test.tsx": 503, + "src/renderer/src/components/settings/general/WorkspaceDirectorySetting.test.tsx": 1982, "src/renderer/src/components/settings/ZcodeCliSetupSection.test.tsx": 818, "src/renderer/src/components/settings/ZcodePlanAccountsSection.test.tsx": 1002, "src/renderer/src/components/settings/account-add-cancel-target.test.ts": 217, @@ -9035,21 +9035,21 @@ "src/renderer/src/components/settings/agent-model-choice-chips.test.ts": 208, "src/renderer/src/components/settings/agent-permission-conversion-persistence.test.tsx": 16868, "src/renderer/src/components/settings/bitbucket-integration-card.test.tsx": 619, - "src/renderer/src/components/settings/browser-session-host-selection.test.ts": 50, + "src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts": 50, "src/renderer/src/components/settings/bundled-skill-setup-result-copy.test.ts": 271, - "src/renderer/src/components/settings/chat-naming-persistence.test.tsx": 5499, + "src/renderer/src/components/settings/chat/chat-naming-persistence.test.tsx": 5499, "src/renderer/src/components/settings/claude-account-switch-copy.test.tsx": 2470, - "src/renderer/src/components/settings/developer-permissions-search.test.ts": 308, + "src/renderer/src/components/settings/developer-permissions/developer-permissions-search.test.ts": 308, "src/renderer/src/components/settings/jira-integration-card.test.tsx": 753, - "src/renderer/src/components/settings/keybinding-diagnostic-text.test.ts": 522, - "src/renderer/src/components/settings/keybinding-title-copy.test.ts": 227, + "src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.test.ts": 522, + "src/renderer/src/components/settings/shortcuts/keybinding-title-copy.test.ts": 227, "src/renderer/src/components/settings/linear-agent-skill-install-cta.test.tsx": 2205, "src/renderer/src/components/settings/managed-server-row-parts.test.tsx": 664, "src/renderer/src/components/settings/mobile-network-interface-selection.test.ts": 57, "src/renderer/src/components/settings/mobile-pairing-device-polling.test.ts": 51, "src/renderer/src/components/settings/mobile-pane-search.test.ts": 220, "src/renderer/src/components/settings/native-chat-provider-choice.test.tsx": 3738, - "src/renderer/src/components/settings/notification-host-pending-save.test.tsx": 2029, + "src/renderer/src/components/settings/notifications/notification-host-pending-save.test.tsx": 2029, "src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.inventory-lifetime.test.tsx": 656, "src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.test.tsx": 569, "src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.test.tsx": 463, @@ -9070,14 +9070,14 @@ "src/renderer/src/components/settings/runtime-server-default-name.test.ts": 122, "src/renderer/src/components/settings/runtime-server-row-unverifiable-host.test.tsx": 2283, "src/renderer/src/components/settings/runtime-share-computer-button.test.tsx": 2092, - "src/renderer/src/components/settings/settings-deep-link-target-watcher.test.ts": 204, - "src/renderer/src/components/settings/settings-form-option-filter.test.ts": 57, + "src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.test.ts": 204, + "src/renderer/src/components/settings/form-controls/settings-form-option-filter.test.ts": 57, "src/renderer/src/components/settings/settings-host-scope.test.ts": 43, - "src/renderer/src/components/settings/settings-project-list.test.ts": 99, - "src/renderer/src/components/settings/settings-project-regrouping.test.ts": 623, - "src/renderer/src/components/settings/settings-search.test.ts": 53, - "src/renderer/src/components/settings/shortcut-groups.test.ts": 1931, - "src/renderer/src/components/settings/shortcut-row-visibility.test.ts": 288, + "src/renderer/src/components/settings/navigation/settings-project-list.test.ts": 99, + "src/renderer/src/components/settings/navigation/settings-project-regrouping.test.ts": 623, + "src/renderer/src/components/settings/search/settings-search.test.ts": 53, + "src/renderer/src/components/settings/shortcuts/shortcut-groups.test.ts": 1931, + "src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.test.ts": 288, "src/renderer/src/components/settings/skill-setup-blocked-plan.test.tsx": 28488, "src/renderer/src/components/settings/source-control-action-card-layout.test.tsx": 4551, "src/renderer/src/components/settings/source-control-action-permission-draft.test.tsx": 6938, @@ -9087,17 +9087,17 @@ "src/renderer/src/components/settings/task-source-setup-state.test.ts": 59, "src/renderer/src/components/settings/task-tracker-integration-cards.test.tsx": 1414, "src/renderer/src/components/settings/usage-credential-host-sections.test.tsx": 942, - "src/renderer/src/components/settings/use-catalog-app-themes.test.ts": 2159, - "src/renderer/src/components/settings/use-debounced-settings-text-draft.test.ts": 308, - "src/renderer/src/components/settings/use-mac-captured-digit-chords.test.ts": 442, + "src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.test.ts": 2159, + "src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.test.ts": 308, + "src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.test.ts": 442, "src/renderer/src/components/settings/use-repository-hook-settings-draft.test.tsx": 586, "src/renderer/src/components/settings/use-repository-issue-command-wsl-stopped.test.ts": 523, "src/renderer/src/components/settings/use-runtime-environment-catalog.test.tsx": 2252, "src/renderer/src/components/settings/use-runtime-environment-mutation-actions.test.tsx": 2069, - "src/renderer/src/components/settings/use-session-search-status.test.tsx": 477, - "src/renderer/src/components/settings/use-settings-repo-scroll-effects.test.tsx": 418, + "src/renderer/src/components/settings/session-history/use-session-search-status.test.tsx": 477, + "src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.test.tsx": 418, "src/renderer/src/components/settings/use-zcode-plan-credentials.test.tsx": 880, - "src/renderer/src/components/settings/useWarpThemeImport.test.ts": 246, + "src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.test.ts": 246, "src/renderer/src/components/settings/worktree-symlink-path-filter.scan-budget.test.ts": 68, "src/renderer/src/components/settings/worktree-symlink-path-filter.test.ts": 51, "src/renderer/src/components/setup-guide/SetupGuideModal.mount-gating.test.tsx": 2348, diff --git a/config/scripts/pr-plugin-e2e-routing.test.mjs b/config/scripts/pr-plugin-e2e-routing.test.mjs index c8e7d45863d..464e7f5a968 100644 --- a/config/scripts/pr-plugin-e2e-routing.test.mjs +++ b/config/scripts/pr-plugin-e2e-routing.test.mjs @@ -157,7 +157,7 @@ describe('plugin PR E2E routing', () => { 'src/renderer/src/components/plugins/review/PluginUpdateReview.test.tsx', 'src/main/plugins/plugin-service.test.ts', 'src/main/plugins/__mocks__/plugin-git-ssh-remote-fixture.ts', - 'src/renderer/src/components/settings/GeneralPane.tsx', + 'src/renderer/src/components/settings/general/GeneralPane.tsx', 'src/main/ipc/filesystem.ts' ]) { expect(routedPluginSpecs(file), file).toEqual([]) diff --git a/src/renderer/src/components/NativeChatResumeAutoNote.tsx b/src/renderer/src/components/NativeChatResumeAutoNote.tsx index 21fd786f06e..f16bf12c0d1 100644 --- a/src/renderer/src/components/NativeChatResumeAutoNote.tsx +++ b/src/renderer/src/components/NativeChatResumeAutoNote.tsx @@ -1,7 +1,7 @@ import { translate } from '@/i18n/i18n' import { useAppStore } from '../store' import { Button } from './ui/button' -import { NATIVE_CHAT_RESUME_SETTING_SECTION_ID } from './settings/native-chat-resume-setting-target' +import { NATIVE_CHAT_RESUME_SETTING_SECTION_ID } from './settings/chat/native-chat-resume-setting-target' /** Explain automatic resume only for runs started by this launch’s saved preference, with its settings link. */ export function NativeChatResumeAutoNote({ diff --git a/src/renderer/src/components/automations/ExternalAutomationManagers.tsx b/src/renderer/src/components/automations/ExternalAutomationManagers.tsx index e32da53ccf0..bc4ae577c08 100644 --- a/src/renderer/src/components/automations/ExternalAutomationManagers.tsx +++ b/src/renderer/src/components/automations/ExternalAutomationManagers.tsx @@ -2,7 +2,7 @@ import React from 'react' import { Play, RefreshCw, Trash2 } from 'lucide-react' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' -import { SettingsSwitch } from '@/components/settings/SettingsFormControls' +import { SettingsSwitch } from '@/components/settings/form-controls/SettingsFormControls' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import type { ExternalAutomationAction, diff --git a/src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx b/src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx index 428a3fd0564..92f813bb0b1 100644 --- a/src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx +++ b/src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx @@ -21,8 +21,8 @@ vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn() } })) import { BrowserCookieImportDisclosure } from './BrowserCookieImportDisclosure' import { BrowserImportHintButton } from './browser-pane/assemble-chrome/BrowserImportHintButton' import { BrowserToolbarMenuDropdown } from './browser-pane/assemble-chrome/browser-toolbar-menu-dropdown' -import { BrowserProfileRow } from './settings/BrowserProfileRow' -import { BrowserUseCookieImportStep } from './settings/BrowserUseCookieImportStep' +import { BrowserProfileRow } from './settings/browser/profiles/BrowserProfileRow' +import { BrowserUseCookieImportStep } from './settings/browser/use/BrowserUseCookieImportStep' const DETECTED_BROWSERS = [ { diff --git a/src/renderer/src/components/dashboard/AgentDashboardSettingsMenu.tsx b/src/renderer/src/components/dashboard/AgentDashboardSettingsMenu.tsx index c6e3e96e81f..b57ae75824d 100644 --- a/src/renderer/src/components/dashboard/AgentDashboardSettingsMenu.tsx +++ b/src/renderer/src/components/dashboard/AgentDashboardSettingsMenu.tsx @@ -8,7 +8,10 @@ import { DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import { SettingsSegmentedControl, SettingsSwitch } from '../settings/SettingsFormControls' +import { + SettingsSegmentedControl, + SettingsSwitch +} from '../settings/form-controls/SettingsFormControls' import type { AgentDashboardMode } from '../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' import { canOpenAgentDashboardPopout } from './agent-dashboard-open-mode' diff --git a/src/renderer/src/components/feature-tips/ChatUiHereTip.test.tsx b/src/renderer/src/components/feature-tips/ChatUiHereTip.test.tsx index 7a45ac0d385..e621373b005 100644 --- a/src/renderer/src/components/feature-tips/ChatUiHereTip.test.tsx +++ b/src/renderer/src/components/feature-tips/ChatUiHereTip.test.tsx @@ -11,11 +11,11 @@ import { useAppStore } from '@/store' import { toast } from 'sonner' import { createGlobalSettingsFixture } from '../../../../shared/global-settings-test-fixture' import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target' -import { useSettingsPageEffects } from '../settings/use-settings-page-effects' +import { useSettingsPageEffects } from '../settings/page/use-settings-page-effects' import { resolveSettingsHostScope } from '../settings/settings-host-scope' -import { renderAgentsSettingsSection } from '../settings/settings-capability-section-renderers' -import { ActiveSettingsSectionProvider } from '../settings/SettingsSection' -import type { SettingsRenderContext } from '../settings/settings-render-context' +import { renderAgentsSettingsSection } from '../settings/page/settings-capability-section-renderers' +import { ActiveSettingsSectionProvider } from '../settings/section-layout/SettingsSection' +import type { SettingsRenderContext } from '../settings/page/settings-render-context' import { AGENT_DEFAULT_SURFACE_SECTION_ID } from '../settings/agents-search' import { chatDemoRevealTokens, getChatDemoCopy } from './chat-ui-here-feature-tip-demo' import { FeatureTipActions } from './FeatureTipActions' diff --git a/src/renderer/src/components/feature-tips/SessionSearchTipDialog.tsx b/src/renderer/src/components/feature-tips/SessionSearchTipDialog.tsx index fbeedc8e729..da5a2b3dab9 100644 --- a/src/renderer/src/components/feature-tips/SessionSearchTipDialog.tsx +++ b/src/renderer/src/components/feature-tips/SessionSearchTipDialog.tsx @@ -4,7 +4,7 @@ import type { FeatureTip } from '../../../../shared/feature-tips' import { sessionSearchStatusDetails, sessionSearchStatusMessage -} from '@/components/settings/session-history-status-copy' +} from '@/components/settings/session-history/session-history-status-copy' import { DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { translate } from '@/i18n/i18n' import { FeatureTipActions } from './FeatureTipActions' diff --git a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.test.tsx b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.test.tsx index 9582eed3a70..d2fbd880994 100644 --- a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.test.tsx +++ b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.test.tsx @@ -38,7 +38,7 @@ vi.mock('@/store', () => { return { useAppStore } }) -vi.mock('@/components/settings/use-session-search-status', () => ({ +vi.mock('@/components/settings/session-history/use-session-search-status', () => ({ useSessionSearchStatus: () => ({ status: mocks.status, failed: false, diff --git a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts index 9a4c6761c0a..0818142f921 100644 --- a/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts +++ b/src/renderer/src/components/feature-tips/use-session-search-tip-setup.ts @@ -6,8 +6,8 @@ import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' import { isSessionSearchIndexReady, sessionSearchStatusMessage -} from '@/components/settings/session-history-status-copy' -import { useSessionSearchStatus } from '@/components/settings/use-session-search-status' +} from '@/components/settings/session-history/session-history-status-copy' +import { useSessionSearchStatus } from '@/components/settings/session-history/use-session-search-status' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' diff --git a/src/renderer/src/components/host-picker/host-list-menus.large-config.test.tsx b/src/renderer/src/components/host-picker/host-list-menus.large-config.test.tsx index 3ddd87236a2..de01c776448 100644 --- a/src/renderer/src/components/host-picker/host-list-menus.large-config.test.tsx +++ b/src/renderer/src/components/host-picker/host-list-menus.large-config.test.tsx @@ -38,13 +38,14 @@ vi.mock('@/components/ui/dropdown-menu', () => { vi.mock('../sidebar/use-sidebar-host-scope-options', () => ({ useSidebarHostScopeOptions: () => ({ hostOptions, hostScopeOptions: [] }) })) -vi.mock('../settings/use-notification-source-options', () => ({ +vi.mock('../settings/notifications/use-notification-source-options', () => ({ useNotificationSourceOptions: () => hostOptions })) const { SidebarHostScopeMenuSection } = await import('../sidebar/SidebarHostScopeMenuSection') -const { NotificationHostToggles } = await import('../settings/NotificationHostToggles') -const { WorkspaceDirectorySetting } = await import('../settings/WorkspaceDirectorySetting') +const { NotificationHostToggles } = + await import('../settings/notifications/NotificationHostToggles') +const { WorkspaceDirectorySetting } = await import('../settings/general/WorkspaceDirectorySetting') function nodeCount(): number { return document.body.getElementsByTagName('*').length diff --git a/src/renderer/src/components/native-chat/NativeChatUsageLimitAutoContinue.tsx b/src/renderer/src/components/native-chat/NativeChatUsageLimitAutoContinue.tsx index 28d5d59970c..1cb0e84e7e6 100644 --- a/src/renderer/src/components/native-chat/NativeChatUsageLimitAutoContinue.tsx +++ b/src/renderer/src/components/native-chat/NativeChatUsageLimitAutoContinue.tsx @@ -2,7 +2,7 @@ import { Settings } from 'lucide-react' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' import { formatUsageLimitResetClock } from '../../../../shared/agent-session/failures/agent-session-usage-limit' -import { NATIVE_CHAT_USAGE_LIMIT_CONTINUE_SETTING_SECTION_ID } from '../settings/native-chat-usage-limit-continue-setting-target' +import { NATIVE_CHAT_USAGE_LIMIT_CONTINUE_SETTING_SECTION_ID } from '../settings/chat/native-chat-usage-limit-continue-setting-target' export type NativeChatUsageLimitAutoContinueState = | { kind: 'off' } diff --git a/src/renderer/src/components/new-workspace/WorkspaceSetupSection.tsx b/src/renderer/src/components/new-workspace/WorkspaceSetupSection.tsx index 95eeae768a8..251eda0d590 100644 --- a/src/renderer/src/components/new-workspace/WorkspaceSetupSection.tsx +++ b/src/renderer/src/components/new-workspace/WorkspaceSetupSection.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from 'react' import type { SetupConfig } from '../../../../shared/orca-hook-setup-config' import type { SetupDecision } from '../../../../shared/worktree/create-types' import type { SetupAgentStartupPolicy } from '../../../../shared/orca-yaml-hook-types' -import { SettingsSwitch } from '@/components/settings/SettingsFormControls' +import { SettingsSwitch } from '@/components/settings/form-controls/SettingsFormControls' import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' import { SetupCommandPreview } from './SetupCommandPreview' diff --git a/src/renderer/src/components/onboarding/NotificationStep.tsx b/src/renderer/src/components/onboarding/NotificationStep.tsx index 5cc04445e7e..5d722bb9401 100644 --- a/src/renderer/src/components/onboarding/NotificationStep.tsx +++ b/src/renderer/src/components/onboarding/NotificationStep.tsx @@ -11,7 +11,7 @@ import { SelectTrigger, SelectValue } from '@/components/ui/select' -import { sendNotificationSettingsTestNotification } from '@/components/settings/notification-settings-copy' +import { sendNotificationSettingsTestNotification } from '@/components/settings/notifications/notification-settings-copy' import { getNotificationSoundOptions } from '@/components/notification-sound-options' import { MacNotificationPermissionCard, diff --git a/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx b/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx index 3374172324b..70c6141381b 100644 --- a/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx +++ b/src/renderer/src/components/onboarding/WindowsTerminalStep.tsx @@ -5,7 +5,7 @@ import { WINDOWS_GIT_BASH_SHELL } from '../../../../shared/windows-terminal-shel import type { GlobalSettings } from '../../../../shared/global-settings-types' import { cn } from '@/lib/utils' import { useWindowsTerminalCapabilities } from '@/lib/windows-terminal-capabilities' -import { SettingsSegmentedControl } from '../settings/SettingsFormControls' +import { SettingsSegmentedControl } from '../settings/form-controls/SettingsFormControls' import { ShellIcon } from '../tab-bar/shell-icons' import { Select, diff --git a/src/renderer/src/components/orchestration-crew/orchestration-panel-enabled.test.tsx b/src/renderer/src/components/orchestration-crew/orchestration-panel-enabled.test.tsx index ecbc8eb4b01..f625fa31a94 100644 --- a/src/renderer/src/components/orchestration-crew/orchestration-panel-enabled.test.tsx +++ b/src/renderer/src/components/orchestration-crew/orchestration-panel-enabled.test.tsx @@ -8,8 +8,12 @@ import { useAppStore } from '@/store' import { NativeChatCrewFrame } from './NativeChatCrewPanel' import { TerminalCrewPortals } from './TerminalCrewPortals' import { useOrchestrationPanelEnabled } from './use-orchestration-panel-enabled' -import { ExperimentalPane, getExperimentalPaneSearchEntries } from '../settings/ExperimentalPane' -import { getExperimentalSearchEntry } from '../settings/experimental-search' +import { ExperimentalPane } from '../settings/advanced/ExperimentalPane' +import { + getExperimentalPaneSearchEntries, + getExperimentalSearchEntry +} from '../settings/advanced/experimental-search' + import { getOrchestrationPanelExperimentalSearchEntry } from '../settings/orchestration-panel-experimental-search' import { TooltipProvider } from '../ui/tooltip' import { i18n, loadRendererUiLanguage, translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/plugins/list/PluginManagerRows.tsx b/src/renderer/src/components/plugins/list/PluginManagerRows.tsx index 96d3e2c0de1..5bd535e2374 100644 --- a/src/renderer/src/components/plugins/list/PluginManagerRows.tsx +++ b/src/renderer/src/components/plugins/list/PluginManagerRows.tsx @@ -4,7 +4,7 @@ import { translate } from '@/i18n/i18n' import { Button } from '../../ui/button' import { DropdownMenuItem, DropdownMenuSeparator } from '../../ui/dropdown-menu' import type { PluginListEntry } from './plugin-list-entries' -import { SettingsSwitch } from '../../settings/SettingsFormControls' +import { SettingsSwitch } from '../../settings/form-controls/SettingsFormControls' import { pluginNeedsReview, installedPluginPresentation, diff --git a/src/renderer/src/components/render-phase-adjustment-discarded-render.test.tsx b/src/renderer/src/components/render-phase-adjustment-discarded-render.test.tsx index e65c30f3db5..45f1479d727 100644 --- a/src/renderer/src/components/render-phase-adjustment-discarded-render.test.tsx +++ b/src/renderer/src/components/render-phase-adjustment-discarded-render.test.tsx @@ -5,7 +5,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { getDefaultSettings } from '../../../shared/constants' import { ConfirmationDialogContext } from './confirmation-dialog-context' import { UntitledFileRenameDialog } from './editor/UntitledFileRenameDialog' -import { QuickCommandsPane } from './settings/QuickCommandsPane' +import { QuickCommandsPane } from './settings/quick-commands/QuickCommandsPane' import { useWorkspaceKanbanColumnResize } from './sidebar/use-workspace-kanban-column-resize' import { useAddRepoCloneFlow } from './sidebar/useAddRepoCloneFlow' diff --git a/src/renderer/src/components/settings/AccountsPane.tsx b/src/renderer/src/components/settings/AccountsPane.tsx index 031534f5886..8e945035d5c 100644 --- a/src/renderer/src/components/settings/AccountsPane.tsx +++ b/src/renderer/src/components/settings/AccountsPane.tsx @@ -29,8 +29,8 @@ import { } from './accounts-search' import { getRemoteAccountsPaneScope } from './provider-account-scope' import { ProviderHostScopeControl } from './ProviderHostScopeControl' -import { SettingsSectionStack } from './SettingsSectionStack' -import { matchesSettingsSearch } from './settings-search' +import { SettingsSectionStack } from './section-layout/SettingsSectionStack' +import { matchesSettingsSearch } from './search/settings-search' import { getCodexAccountAuthWarning } from './codex-account-auth-warning' import { getCodexConfigSyncWarning } from './codex-config-sync-warning' import { diff --git a/src/renderer/src/components/settings/AdvancedNetworkSettingsSection.tsx b/src/renderer/src/components/settings/AdvancedNetworkSettingsSection.tsx index 9a07322eb70..260b678fd92 100644 --- a/src/renderer/src/components/settings/AdvancedNetworkSettingsSection.tsx +++ b/src/renderer/src/components/settings/AdvancedNetworkSettingsSection.tsx @@ -17,8 +17,8 @@ import { Label } from '../ui/label' import { Textarea } from '../ui/textarea' import { getAdvancedNetworkSearchEntries } from './advanced-network-search' import { NodeDistMirrorSettingField } from './NodeDistMirrorSettingField' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './search/settings-search' import { translate } from '@/i18n/i18n' export function shouldOpenNetworkProxyConfig(searchQuery: string): boolean { diff --git a/src/renderer/src/components/settings/AgentAwakeSetting.tsx b/src/renderer/src/components/settings/AgentAwakeSetting.tsx index 8d68a6370b8..ec593a82f16 100644 --- a/src/renderer/src/components/settings/AgentAwakeSetting.tsx +++ b/src/renderer/src/components/settings/AgentAwakeSetting.tsx @@ -6,8 +6,8 @@ import { getAgentAwakeSearchKeywords, getAgentAwakeTitle } from './agent-awake-copy' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSegmentedControl } from './form-controls/SettingsFormControls' import { computerAwakeSettingsForMode, normalizeComputerAwakeMode, diff --git a/src/renderer/src/components/settings/AgentCacheTimerSection.tsx b/src/renderer/src/components/settings/AgentCacheTimerSection.tsx index 2e99b4f7e6a..d954b2f675d 100644 --- a/src/renderer/src/components/settings/AgentCacheTimerSection.tsx +++ b/src/renderer/src/components/settings/AgentCacheTimerSection.tsx @@ -5,8 +5,8 @@ import { useAppStore } from '../../store' import { Label } from '../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' import { getAgentCacheTimerSearchEntries } from './agent-cache-timer-search' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader, SettingsSwitch } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSubsectionHeader, SettingsSwitch } from './form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' type AgentCacheTimerSectionProps = { diff --git a/src/renderer/src/components/settings/AgentCatalogRow.tsx b/src/renderer/src/components/settings/AgentCatalogRow.tsx index 901c1a9b887..d6509316ad5 100644 --- a/src/renderer/src/components/settings/AgentCatalogRow.tsx +++ b/src/renderer/src/components/settings/AgentCatalogRow.tsx @@ -5,7 +5,7 @@ import { AgentIcon } from '@/lib/agent-catalog' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import { Button } from '../ui/button' -import { SettingsBadge, SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsBadge, SettingsSegmentedControl } from './form-controls/SettingsFormControls' import type { AgentSessionSourceHomeControl } from './codex-session-source-home-control' import { AgentSessionSourceHomeInput } from './codex-session-source-home-control' import { resolveTuiAgentPermissionMode } from '../../../../shared/tui-agent-permissions' diff --git a/src/renderer/src/components/settings/AgentChatChoiceControls.tsx b/src/renderer/src/components/settings/AgentChatChoiceControls.tsx index 889c5a2cefa..3c87fae1581 100644 --- a/src/renderer/src/components/settings/AgentChatChoiceControls.tsx +++ b/src/renderer/src/components/settings/AgentChatChoiceControls.tsx @@ -11,7 +11,7 @@ import { } from './AntigravityProviderSignInArea' import { getHostRuntimeLabel, getRuntimeSentenceLabel } from './accounts-pane-runtime' import type { AgentOpensAs } from './native-chat-provider-choice' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsSegmentedControl } from './form-controls/SettingsFormControls' // The chat choice is this computer's, so the downloaded chat programs are too. const CHAT_HOST: RuntimeClientTarget = { kind: 'local' } diff --git a/src/renderer/src/components/settings/AgentDashboardExperimentalSetting.tsx b/src/renderer/src/components/settings/AgentDashboardExperimentalSetting.tsx index cfafcdaab6d..4e1b3b63aed 100644 --- a/src/renderer/src/components/settings/AgentDashboardExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/AgentDashboardExperimentalSetting.tsx @@ -1,9 +1,9 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSegmentedControl, SettingsSwitch } from './SettingsFormControls' -import { getExperimentalSearchEntry } from './experimental-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSegmentedControl, SettingsSwitch } from './form-controls/SettingsFormControls' +import { getExperimentalSearchEntry } from './advanced/experimental-search' import { canOpenAgentDashboardPopout } from '../dashboard/agent-dashboard-open-mode' type AgentDashboardExperimentalSettingProps = { diff --git a/src/renderer/src/components/settings/AgentDefaultSetting.tsx b/src/renderer/src/components/settings/AgentDefaultSetting.tsx index 1b0dbf5473a..0d7d993e8d6 100644 --- a/src/renderer/src/components/settings/AgentDefaultSetting.tsx +++ b/src/renderer/src/components/settings/AgentDefaultSetting.tsx @@ -4,7 +4,7 @@ import type { AgentCatalogEntry } from '@/lib/agent-catalog' import { AgentIcon } from '@/lib/agent-catalog' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { SettingsSubsectionHeader } from './form-controls/SettingsFormControls' function DefaultAgentPill({ active, diff --git a/src/renderer/src/components/settings/AgentDefaultSurfaceSection.tsx b/src/renderer/src/components/settings/AgentDefaultSurfaceSection.tsx index ccd222cf088..3d89a45b289 100644 --- a/src/renderer/src/components/settings/AgentDefaultSurfaceSection.tsx +++ b/src/renderer/src/components/settings/AgentDefaultSurfaceSection.tsx @@ -19,7 +19,7 @@ import { import { ChatSurfacePreview, TerminalSurfacePreview } from './AgentDefaultSurfacePreviews' import { AGENT_DEFAULT_SURFACE_SECTION_ID, AGENTS_INSTALLED_SECTION_ID } from './agents-search' import { Card, CardContent } from '../ui/card' -import { SettingsRow } from './SettingsFormControls' +import { SettingsRow } from './form-controls/SettingsFormControls' import { Button } from '../ui/button' import { agentsKeepingOwnSurface, diff --git a/src/renderer/src/components/settings/AgentDetectionCatalog.tsx b/src/renderer/src/components/settings/AgentDetectionCatalog.tsx index d5d64c17b74..030ce85ba86 100644 --- a/src/renderer/src/components/settings/AgentDetectionCatalog.tsx +++ b/src/renderer/src/components/settings/AgentDetectionCatalog.tsx @@ -5,7 +5,7 @@ import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import { Button } from '../ui/button' import { AgentCatalogRow, type AgentCatalogRowProps } from './AgentCatalogRow' -import { SettingsBadge, SettingsSubsectionHeader } from './SettingsFormControls' +import { SettingsBadge, SettingsSubsectionHeader } from './form-controls/SettingsFormControls' import { AGENTS_INSTALLED_SECTION_ID } from './agents-search' export function AgentDetectionCatalog({ diff --git a/src/renderer/src/components/settings/AgentRowPermissions.tsx b/src/renderer/src/components/settings/AgentRowPermissions.tsx index 3bfd5ef0a2d..8640ea74bcb 100644 --- a/src/renderer/src/components/settings/AgentRowPermissions.tsx +++ b/src/renderer/src/components/settings/AgentRowPermissions.tsx @@ -2,7 +2,7 @@ import type { AgentPermissionMode } from '../../../../shared/tui-agent-permissio import { translate } from '@/i18n/i18n' import { Button } from '../ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { SettingsBadge } from './SettingsFormControls' +import { SettingsBadge } from './form-controls/SettingsFormControls' import { AgentPermissionModeMenu } from './AgentPermissionModeMenu' import { agentPermissionModeLabel } from './agent-permission-mode-label' diff --git a/src/renderer/src/components/settings/AgentRuntimeSetting.tsx b/src/renderer/src/components/settings/AgentRuntimeSetting.tsx index 877ce8d0065..d22fcfccab7 100644 --- a/src/renderer/src/components/settings/AgentRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/AgentRuntimeSetting.tsx @@ -2,7 +2,7 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { GlobalWindowsRuntimeDefault } from '../../../../shared/project-execution-runtime' import { normalizeGlobalWindowsRuntimeDefault } from '../../../../shared/project-execution-runtime' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' type AgentRuntimeSegment = GlobalWindowsRuntimeDefault['kind'] diff --git a/src/renderer/src/components/settings/AgentsPane.test.tsx b/src/renderer/src/components/settings/AgentsPane.test.tsx index 0bc3dfeaeae..27c193a59dc 100644 --- a/src/renderer/src/components/settings/AgentsPane.test.tsx +++ b/src/renderer/src/components/settings/AgentsPane.test.tsx @@ -32,7 +32,7 @@ import { buildAgentAvailabilitySettingsUpdate, createAgentAvailabilityUpdateQueue } from './AgentsPane' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' import { TooltipProvider } from '../ui/tooltip' import { resolveSettingsHostScope } from './settings-host-scope' diff --git a/src/renderer/src/components/settings/AgentsPane.tsx b/src/renderer/src/components/settings/AgentsPane.tsx index 575719bbb6f..c5791f4a314 100644 --- a/src/renderer/src/components/settings/AgentsPane.tsx +++ b/src/renderer/src/components/settings/AgentsPane.tsx @@ -19,7 +19,7 @@ import { getAgentWorkspaceTrustDescription, getAgentWorkspaceTrustTitle } from './agent-workspace-trust-copy' -import { SettingsSubsectionHeader, SettingsSwitchRow } from './SettingsFormControls' +import { SettingsSubsectionHeader, SettingsSwitchRow } from './form-controls/SettingsFormControls' import { isPairedWebClientWindow } from '@/lib/desktop-window-chrome' import { getAgentsPaneSearchEntries } from './agents-search' import { diff --git a/src/renderer/src/components/settings/AutoRenameBranchFromWorkSetting.tsx b/src/renderer/src/components/settings/AutoRenameBranchFromWorkSetting.tsx index 8542354baeb..ed8ed4734a9 100644 --- a/src/renderer/src/components/settings/AutoRenameBranchFromWorkSetting.tsx +++ b/src/renderer/src/components/settings/AutoRenameBranchFromWorkSetting.tsx @@ -20,8 +20,8 @@ import { Label } from '../ui/label' import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' import { Switch } from '../ui/switch' import { getAutoRenameBranchAdvancedSearchEntries } from './auto-rename-branch-search' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './search/settings-search' import { Trans } from 'react-i18next' import { i18n, translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/CodexHistorySharingSetting.tsx b/src/renderer/src/components/settings/CodexHistorySharingSetting.tsx index 461bc115294..cb98f90b6d1 100644 --- a/src/renderer/src/components/settings/CodexHistorySharingSetting.tsx +++ b/src/renderer/src/components/settings/CodexHistorySharingSetting.tsx @@ -3,7 +3,7 @@ import { runtimeTargetEnvironmentId } from '@/runtime/runtime-client-target' import type { GlobalSettings } from '../../../../shared/global-settings-types' import { getLocalExecutionHostLabel } from '../../../../shared/execution-host' import type { SettingsHostScope } from './settings-host-scope' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SettingsSwitchRow } from './form-controls/SettingsFormControls' import { getCodexHistorySharingDescription, getCodexHistorySharingTitle, diff --git a/src/renderer/src/components/settings/CodexTerminalServerIsolationSetting.tsx b/src/renderer/src/components/settings/CodexTerminalServerIsolationSetting.tsx index fa8f8862d29..77260a5a475 100644 --- a/src/renderer/src/components/settings/CodexTerminalServerIsolationSetting.tsx +++ b/src/renderer/src/components/settings/CodexTerminalServerIsolationSetting.tsx @@ -11,8 +11,8 @@ import { getCodexTerminalServerIsolationSearchKeywords, getCodexTerminalServerIsolationTitle } from './codex-terminal-server-isolation-copy' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSwitchRow } from './form-controls/SettingsFormControls' type CodexTerminalServerIsolationSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/CommitMessageAiPane.tsx b/src/renderer/src/components/settings/CommitMessageAiPane.tsx index b8867a764eb..841e3155d94 100644 --- a/src/renderer/src/components/settings/CommitMessageAiPane.tsx +++ b/src/renderer/src/components/settings/CommitMessageAiPane.tsx @@ -24,10 +24,10 @@ import { useAppStore } from '../../store' import { CustomAgentCommandField } from './CustomAgentCommandField' import { Label } from '../ui/label' import { Switch } from '../ui/switch' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { SourceControlAiActionRecipeDefaults } from './SourceControlAiActionRecipeDefaults' -import { matchesSettingsSearch } from './settings-search' -import { getSettingOwnershipSummary } from './setting-ownership' +import { matchesSettingsSearch } from './search/settings-search' +import { getSettingOwnershipSummary } from './page/setting-ownership' import { translate } from '@/i18n/i18n' import { HostedReviewCreationDefaults } from './HostedReviewCreationDefaults' diff --git a/src/renderer/src/components/settings/CompareAgainstUpstreamSetting.tsx b/src/renderer/src/components/settings/CompareAgainstUpstreamSetting.tsx index 532e25be0d2..46ef8a3204c 100644 --- a/src/renderer/src/components/settings/CompareAgainstUpstreamSetting.tsx +++ b/src/renderer/src/components/settings/CompareAgainstUpstreamSetting.tsx @@ -1,8 +1,8 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' -import { matchesSettingsSearch } from './settings-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' +import { matchesSettingsSearch } from './search/settings-search' type SourceControlCompareBasePolicy = 'repository-default' | 'branch-upstream' diff --git a/src/renderer/src/components/settings/CursorAccountsSection.tsx b/src/renderer/src/components/settings/CursorAccountsSection.tsx index 430a18e9185..2f15879b894 100644 --- a/src/renderer/src/components/settings/CursorAccountsSection.tsx +++ b/src/renderer/src/components/settings/CursorAccountsSection.tsx @@ -7,7 +7,7 @@ import { useAppStore } from '../../store' import { Badge } from '../ui/badge' import { Button } from '../ui/button' import type { CursorAccountStatus } from '../../../../shared/rate-limit-types' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { openAppHttpLinkFromAnchor } from '@/lib/app-http-link-open' const CURSOR_USAGE_DASHBOARD_URL = 'https://cursor.com/dashboard/spending' diff --git a/src/renderer/src/components/settings/EphemeralVmsExperimentalSetting.tsx b/src/renderer/src/components/settings/EphemeralVmsExperimentalSetting.tsx index dd4db727bc4..e0c254d1c12 100644 --- a/src/renderer/src/components/settings/EphemeralVmsExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/EphemeralVmsExperimentalSetting.tsx @@ -2,9 +2,9 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' import { Label } from '../ui/label' import { EphemeralVmsPane } from './EphemeralVmsPane' -import { getExperimentalSearchEntry } from './experimental-search' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' +import { getExperimentalSearchEntry } from './advanced/experimental-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSwitch } from './form-controls/SettingsFormControls' type EphemeralVmsExperimentalSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/GeneralRemoteServerUpdates.tsx b/src/renderer/src/components/settings/GeneralRemoteServerUpdates.tsx index e5c6bacefc0..867ba8af99d 100644 --- a/src/renderer/src/components/settings/GeneralRemoteServerUpdates.tsx +++ b/src/renderer/src/components/settings/GeneralRemoteServerUpdates.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' import { getUpdateCheckClickOptions, getUpdateCheckHint } from '@/lib/update-check-click-options' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' export function GeneralRemoteServerUpdates(): React.JSX.Element | null { const entryMap = useAppStore((state) => state.remoteServerUpdates) diff --git a/src/renderer/src/components/settings/GitPane.tsx b/src/renderer/src/components/settings/GitPane.tsx index 430f0cbfb49..cc9a7afa27f 100644 --- a/src/renderer/src/components/settings/GitPane.tsx +++ b/src/renderer/src/components/settings/GitPane.tsx @@ -8,9 +8,9 @@ import { Label } from '../ui/label' import { Switch } from '../ui/switch' import { useAppStore } from '../../store' import { getGitPaneSearchEntries } from './git-search' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { BranchPrefixFeedback } from './BranchPrefixFeedback' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' import { AutoRenameBranchFromWorkSetting } from './AutoRenameBranchFromWorkSetting' import { JIRA_ISSUE_KEY_CASING_KEYWORDS, @@ -29,7 +29,7 @@ import { } from './keep-local-main-up-to-date-setting' import { Trans } from 'react-i18next' import { i18n, translate } from '@/i18n/i18n' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' export { getGitPaneSearchEntries } diff --git a/src/renderer/src/components/settings/GitProviderApiBudgetPane.tsx b/src/renderer/src/components/settings/GitProviderApiBudgetPane.tsx index ea9c740a64e..2801be7a880 100644 --- a/src/renderer/src/components/settings/GitProviderApiBudgetPane.tsx +++ b/src/renderer/src/components/settings/GitProviderApiBudgetPane.tsx @@ -1,6 +1,6 @@ import { useAppStore } from '../../store' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { matchesSettingsSearch } from './search/settings-search' import { GitHubRateLimitPanel } from '../github/github-rate-limit-display' import { GitLabRateLimitPanel } from '../gitlab/gitlab-rate-limit-display' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/GrokAccountsSection.tsx b/src/renderer/src/components/settings/GrokAccountsSection.tsx index 88c0c535b3c..7602c3a48d4 100644 --- a/src/renderer/src/components/settings/GrokAccountsSection.tsx +++ b/src/renderer/src/components/settings/GrokAccountsSection.tsx @@ -7,7 +7,7 @@ import { useAppStore } from '../../store' import { Badge } from '../ui/badge' import { Button } from '../ui/button' import type { GrokAccountStatus } from '../../../../shared/rate-limit-types' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { openAppHttpLinkFromAnchor } from '@/lib/app-http-link-open' const GROK_CLI_DOCS_URL = 'https://docs.x.ai/build/overview' diff --git a/src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx b/src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx index cc8d412e0a3..0ffc28af4c7 100644 --- a/src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx +++ b/src/renderer/src/components/settings/HostAgentLaunchSettings.test.tsx @@ -13,7 +13,7 @@ import { } from '../../../../shared/agent-launch-settings' import { HostAgentLaunchSettings } from './HostAgentLaunchSettings' import * as permissionControls from './AgentPermissionChoiceControls' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsSegmentedControl } from './form-controls/SettingsFormControls' import type { AgentPermissionChoice } from '../../../../shared/tui-agent-permission-choice' import { TooltipProvider } from '../ui/tooltip' import type { AgentPermissionsRenderer } from './AgentLaunchSettingsCatalog' diff --git a/src/renderer/src/components/settings/HostedReviewCreationDefaults.tsx b/src/renderer/src/components/settings/HostedReviewCreationDefaults.tsx index 3f4b1ac7298..9f9003c925a 100644 --- a/src/renderer/src/components/settings/HostedReviewCreationDefaults.tsx +++ b/src/renderer/src/components/settings/HostedReviewCreationDefaults.tsx @@ -1,6 +1,6 @@ import type { SourceControlAiSettings } from '../../../../shared/source-control-ai-types' import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' type HostedReviewDefaultKey = keyof NonNullable diff --git a/src/renderer/src/components/settings/JiraIssueKeyCasingSetting.tsx b/src/renderer/src/components/settings/JiraIssueKeyCasingSetting.tsx index 110d17e64bb..c53175c39a8 100644 --- a/src/renderer/src/components/settings/JiraIssueKeyCasingSetting.tsx +++ b/src/renderer/src/components/settings/JiraIssueKeyCasingSetting.tsx @@ -1,8 +1,8 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { JiraIssueKeyCasing } from '../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' export const JIRA_ISSUE_KEY_CASING_KEYWORDS = [ 'jira', diff --git a/src/renderer/src/components/settings/LinearAgentSkillPane.tsx b/src/renderer/src/components/settings/LinearAgentSkillPane.tsx index f13908c4d6a..7cfc990df12 100644 --- a/src/renderer/src/components/settings/LinearAgentSkillPane.tsx +++ b/src/renderer/src/components/settings/LinearAgentSkillPane.tsx @@ -15,7 +15,7 @@ import { AgentSkillSetupPanel } from './AgentSkillSetupPanel' import { LinearAgentSkillGuide } from './LinearAgentSkillGuide' import { LinearAgentSkillNotes } from './LinearAgentSkillNotes' import { getLinearAgentSkillPaneSearchEntries } from './linear-agent-skill-search' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { SkillUsageExamplesSection } from './SkillUsageExamplesSection' import { LINEAR_INTEGRATION_SECTION_ID } from './task-provider-integration-section-ids' import { useLinearAgentSkillSetup } from './use-linear-agent-skill-setup' diff --git a/src/renderer/src/components/settings/MachineNameField.tsx b/src/renderer/src/components/settings/MachineNameField.tsx index 4c81a7dd4c8..21c7ab29527 100644 --- a/src/renderer/src/components/settings/MachineNameField.tsx +++ b/src/renderer/src/components/settings/MachineNameField.tsx @@ -3,7 +3,7 @@ import { translate } from '@/i18n/i18n' import { isWebClientLocation } from '@/lib/web-client-location' import { cn } from '@/lib/utils' import { MACHINE_NAME_MAX_LENGTH } from '../../../../shared/machine-name' -import { DebouncedSettingsTextInput } from './DebouncedSettingsTextInput' +import { DebouncedSettingsTextInput } from './form-controls/DebouncedSettingsTextInput' import { usePublishedMachineName } from './use-published-machine-name' type MachineNameFieldProps = { diff --git a/src/renderer/src/components/settings/MiniMaxAccountsSection.tsx b/src/renderer/src/components/settings/MiniMaxAccountsSection.tsx index 209c7a8c706..d14abb1fae4 100644 --- a/src/renderer/src/components/settings/MiniMaxAccountsSection.tsx +++ b/src/renderer/src/components/settings/MiniMaxAccountsSection.tsx @@ -5,8 +5,8 @@ import type { FeatureInteractionId } from '../../../../shared/feature-interactio import type { ProviderRateLimits } from '../../../../shared/rate-limit-types' import { Label } from '../ui/label' import { MiniMaxIcon } from '../status-bar/icons' -import { SearchableSetting } from './SearchableSetting' -import { DebouncedSettingsTextInput } from './DebouncedSettingsTextInput' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { DebouncedSettingsTextInput } from './form-controls/DebouncedSettingsTextInput' import { MiniMaxCredentials, miniMaxStorageHelp } from './accounts-pane-minimax-credentials' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' import { useMiniMaxCredentials } from './use-minimax-credentials' diff --git a/src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx b/src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx index e31a424910f..52778d13ce3 100644 --- a/src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx +++ b/src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx @@ -10,8 +10,8 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '. import { AndroidLogo, IosBrandIcon } from '../mobile/MobileBrandIcons' import { MobileEmulatorAgentControlRow } from './MobileEmulatorAgentControlRow' import { MobileEmulatorAvailabilityDetails } from './MobileEmulatorAvailabilityDetails' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsRow, SettingsSwitchRow } from './form-controls/SettingsFormControls' import { getMobileEmulatorSearchEntries } from './mobile-emulator-search' import { translate } from '@/i18n/i18n' import { emulatorErrorText, emulatorMessageText } from '@/lib/emulator-error-copy' diff --git a/src/renderer/src/components/settings/MobileSettingsPane.tsx b/src/renderer/src/components/settings/MobileSettingsPane.tsx index 070bb8a9c88..8df1b29a1f2 100644 --- a/src/renderer/src/components/settings/MobileSettingsPane.tsx +++ b/src/renderer/src/components/settings/MobileSettingsPane.tsx @@ -1,5 +1,5 @@ -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSwitchRow } from './form-controls/SettingsFormControls' import { MobilePane } from './MobilePane' import { getMobileOverviewSearchEntry, diff --git a/src/renderer/src/components/settings/OrchestrationPane.test.tsx b/src/renderer/src/components/settings/OrchestrationPane.test.tsx index 0a76c8790b2..b007f725e88 100644 --- a/src/renderer/src/components/settings/OrchestrationPane.test.tsx +++ b/src/renderer/src/components/settings/OrchestrationPane.test.tsx @@ -12,7 +12,7 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { useAppStore } from '../../store' import { OrchestrationPane } from './OrchestrationPane' import { getOrchestrationPaneSearchEntries } from './orchestration-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' const mocks = vi.hoisted(() => ({ panelProps: [] as Record[], diff --git a/src/renderer/src/components/settings/OrchestrationPane.tsx b/src/renderer/src/components/settings/OrchestrationPane.tsx index a44e901d58d..49ded46789a 100644 --- a/src/renderer/src/components/settings/OrchestrationPane.tsx +++ b/src/renderer/src/components/settings/OrchestrationPane.tsx @@ -12,8 +12,8 @@ import { useInstalledAgentSkill } from '@/hooks/useInstalledAgentSkills' import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { matchesSettingsSearch } from './search/settings-search' import { useAppStore } from '../../store' import { getOrchestrationPaneSearchEntries } from './orchestration-search' import { AgentSkillSetupPanel } from './AgentSkillSetupPanel' @@ -23,7 +23,7 @@ import { translate } from '@/i18n/i18n' import type { GlobalSettings } from '../../../../shared/global-settings-types' import { resolveNestedWorkerMaxDepth } from '../../../../shared/nested-worker-depth' import { isPairedWebClientWindow } from '@/lib/desktop-window-chrome' -import { NumberField } from './SettingsFormControls' +import { NumberField } from './form-controls/SettingsFormControls' import { getNestedWorkerDepthDescription, getNestedWorkerDepthTitle diff --git a/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx b/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx index 63211202f9c..b265880e9b5 100644 --- a/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/OrchestrationPanelExperimentalSetting.tsx @@ -1,9 +1,9 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' -import { getExperimentalSearchEntry } from './experimental-search' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSwitch } from './form-controls/SettingsFormControls' +import { getExperimentalSearchEntry } from './advanced/experimental-search' type OrchestrationPanelExperimentalSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/OrchestrationWorkerAutoReleaseSetting.tsx b/src/renderer/src/components/settings/OrchestrationWorkerAutoReleaseSetting.tsx index 9d8242f10fe..4f92b773d10 100644 --- a/src/renderer/src/components/settings/OrchestrationWorkerAutoReleaseSetting.tsx +++ b/src/renderer/src/components/settings/OrchestrationWorkerAutoReleaseSetting.tsx @@ -1,5 +1,5 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SettingsSwitchRow } from './form-controls/SettingsFormControls' import { getWorkerAutoReleaseDescription, getWorkerAutoReleaseTitle diff --git a/src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx b/src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx index a054091c825..e111e3c5b25 100644 --- a/src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx +++ b/src/renderer/src/components/settings/PluginsSettingsSection.lifecycle.test.tsx @@ -18,7 +18,7 @@ vi.mock('../plugins/state/plugin-theme-apply', () => ({ vi.mock('../plugins/state/use-plugin-in-use', () => ({ usePluginInUse: () => null })) vi.mock('../plugins/state/use-plugin-art-palettes', () => ({ usePluginArtPalettes: () => [] })) -vi.mock('./SettingsSection', () => ({ +vi.mock('./section-layout/SettingsSection', () => ({ SettingsSection: ({ children, headerAction diff --git a/src/renderer/src/components/settings/PluginsSettingsSection.tsx b/src/renderer/src/components/settings/PluginsSettingsSection.tsx index fce94c6610d..4d1da025556 100644 --- a/src/renderer/src/components/settings/PluginsSettingsSection.tsx +++ b/src/renderer/src/components/settings/PluginsSettingsSection.tsx @@ -15,8 +15,8 @@ import { PluginsHeaderActions } from '../plugins/list/PluginSettingsMenu' import { PluginSettingsOverview } from '../plugins/list/PluginSettingsOverview' import { PluginsAlphaNotice } from '../plugins/list/PluginsAlphaNotice' import { PluginsSectionDescription } from '../plugins/list/PluginsSectionDescription' -import { getPluginsSectionPresentation } from './plugins-search' -import { SettingsSection } from './SettingsSection' +import { getPluginsSectionPresentation } from './plugins/plugins-search' +import { SettingsSection } from './section-layout/SettingsSection' import { usePluginLogs } from '../plugins/state/use-plugin-logs' import { usePluginMarketplaceLifecycle } from '../plugins/state/use-plugin-marketplace-lifecycle' import { usePluginPageNavigation } from '../plugins/state/use-plugin-page-navigation' diff --git a/src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx b/src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx index 494d69553a4..f037d601f5c 100644 --- a/src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx @@ -8,7 +8,7 @@ import { import { useState } from 'react' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' import { Button } from '../ui/button' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' import type { ProjectRuntimeSessionSummary } from './repository/execution/repository-runtime-session-summary' import { translate } from '@/i18n/i18n' import { projectRuntimeRepairSentence } from '../../../../shared/project-runtime-repair-message' diff --git a/src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx b/src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx index c1a5dbb5286..621e247e1b7 100644 --- a/src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx +++ b/src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx @@ -3,7 +3,7 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import type { PublicKnownRuntimeEnvironment } from '../../../../shared/runtime-environments' import { useAppStore } from '@/store' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { EphemeralVmRuntimesSection } from './EphemeralVmRuntimesSection' import { getRuntimeEnvironmentsSearchEntry, diff --git a/src/renderer/src/components/settings/Settings.tsx b/src/renderer/src/components/settings/Settings.tsx index 766b827cb96..61f74a93a82 100644 --- a/src/renderer/src/components/settings/Settings.tsx +++ b/src/renderer/src/components/settings/Settings.tsx @@ -1,12 +1,15 @@ -import { useSettingsStoreModel } from './use-settings-store-model' -import { useSettingsInteractionController } from './use-settings-interaction-controller' -import { useSettingsPageEffects } from './use-settings-page-effects' -import { useSettingsNavigationModel } from './use-settings-navigation-model' -import { useSettingsTerminalModel } from './use-settings-terminal-model' -import { useSettingsRepoScrollEffects } from './use-settings-repo-scroll-effects' -import { buildSettingsViewModel, useSettingsNavigationActions } from './settings-view-model' -import { renderSettingsLoading, renderSettingsPage } from './settings-page-renderer' -import type { LoadedSettingsStoreModel, SettingsRenderContext } from './settings-render-context' +import { useSettingsStoreModel } from './page/use-settings-store-model' +import { useSettingsInteractionController } from './page/use-settings-interaction-controller' +import { useSettingsPageEffects } from './page/use-settings-page-effects' +import { useSettingsNavigationModel } from './navigation/use-settings-navigation-model' +import { useSettingsTerminalModel } from './page/use-settings-terminal-model' +import { useSettingsRepoScrollEffects } from './navigation/use-settings-repo-scroll-effects' +import { buildSettingsViewModel, useSettingsNavigationActions } from './page/settings-view-model' +import { renderSettingsLoading, renderSettingsPage } from './page/settings-page-renderer' +import type { + LoadedSettingsStoreModel, + SettingsRenderContext +} from './page/settings-render-context' function Settings(): React.JSX.Element { const model = useSettingsStoreModel() diff --git a/src/renderer/src/components/settings/ShareSkillsSettingsPane.tsx b/src/renderer/src/components/settings/ShareSkillsSettingsPane.tsx index ac84b166b2d..d9ae87adbc8 100644 --- a/src/renderer/src/components/settings/ShareSkillsSettingsPane.tsx +++ b/src/renderer/src/components/settings/ShareSkillsSettingsPane.tsx @@ -4,7 +4,7 @@ import { useOrcaProfileAuthStatusRefresh } from '@/hooks/use-orca-profile-auth-s import { translate } from '@/i18n/i18n' import { isWebClientLocation } from '@/lib/web-client-location' import { useAppStore } from '@/store' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SettingsSwitchRow } from './form-controls/SettingsFormControls' import { OrcaSignInButton, OrcaSignInWaitNotice } from '../OrcaSignInProgress' type HowToStep = { key: string; title: string; description: string } diff --git a/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx b/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx index 1440ab38759..b97a7cb676a 100644 --- a/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx +++ b/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx @@ -24,9 +24,9 @@ import { summarizeReposOverridingActionRecipe, type SourceControlActionRecipeOverrideSummary } from '../../../../shared/source-control-launch-agent-selection' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { getRepositorySourceControlAiActionRecipeSectionId } from './repository/repository-settings-targets' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' import { SourceControlActionRecipeRow } from './SourceControlActionRecipeRow' import { SourceControlActionRepoOverrideNote } from './SourceControlActionRepoOverrideNote' import { retireActionLaunchPreferences } from './source-control-ai-action-recipe-draft' diff --git a/src/renderer/src/components/settings/SshHostAdvancedFields.tsx b/src/renderer/src/components/settings/SshHostAdvancedFields.tsx index 27152c5a863..57e23e3d47e 100644 --- a/src/renderer/src/components/settings/SshHostAdvancedFields.tsx +++ b/src/renderer/src/components/settings/SshHostAdvancedFields.tsx @@ -4,7 +4,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/component import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { cn } from '@/lib/utils' -import { SettingsSwitch } from './SettingsFormControls' +import { SettingsSwitch } from './form-controls/SettingsFormControls' import type { EditingTarget } from './ssh-target-draft' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/SshTargetList.large-config.test.tsx b/src/renderer/src/components/settings/SshTargetList.large-config.test.tsx index 356aefb94e7..a4c33461658 100644 --- a/src/renderer/src/components/settings/SshTargetList.large-config.test.tsx +++ b/src/renderer/src/components/settings/SshTargetList.large-config.test.tsx @@ -3,7 +3,7 @@ import { act, useState, type ReactElement } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import type { SshTarget } from '../../../../shared/ssh-types' -import { SettingsContentScrollElementProvider } from './settings-content-scroll-element' +import { SettingsContentScrollElementProvider } from './page/settings-content-scroll-element' import { SshTargetList } from './SshTargetList' vi.mock('./SshTargetCard', () => ({ diff --git a/src/renderer/src/components/settings/SshTargetList.tsx b/src/renderer/src/components/settings/SshTargetList.tsx index 0792aee1d90..3f104cee829 100644 --- a/src/renderer/src/components/settings/SshTargetList.tsx +++ b/src/renderer/src/components/settings/SshTargetList.tsx @@ -2,7 +2,7 @@ import type { SshConnectionState, SshTarget } from '../../../../shared/ssh-types import { translate } from '@/i18n/i18n' import { Checkbox } from '../ui/checkbox' import { VirtualizedList } from '../virtualized-list' -import { useSettingsContentScrollElement } from './settings-content-scroll-element' +import { useSettingsContentScrollElement } from './page/settings-content-scroll-element' import type { SshTargetBusyAction } from './ssh-target-action-state' import { groupSshTargetsBySource, diff --git a/src/renderer/src/components/settings/TaskSourceStepRow.tsx b/src/renderer/src/components/settings/TaskSourceStepRow.tsx index 3c9f9f6c799..31d6fbf644a 100644 --- a/src/renderer/src/components/settings/TaskSourceStepRow.tsx +++ b/src/renderer/src/components/settings/TaskSourceStepRow.tsx @@ -1,5 +1,5 @@ import type { ReactNode } from 'react' -import { StepBadge, type StepState } from './SetupStepBadge' +import { StepBadge, type StepState } from './setup-guide/SetupStepBadge' import { cn } from '@/lib/utils' type TaskSourceStepRowProps = { diff --git a/src/renderer/src/components/settings/TasksPane.tsx b/src/renderer/src/components/settings/TasksPane.tsx index eff4680efa7..6f9d8e95cae 100644 --- a/src/renderer/src/components/settings/TasksPane.tsx +++ b/src/renderer/src/components/settings/TasksPane.tsx @@ -11,8 +11,8 @@ import { JiraIcon } from '@/components/icons/JiraIcon' import { LinearIcon } from '@/components/icons/LinearIcon' import { Button } from '@/components/ui/button' import { useAppStore } from '@/store' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSubsectionHeader } from './form-controls/SettingsFormControls' import { CodeHostSetupSteps, JiraSetupSteps } from './TaskSourceSimpleSetup' import { TaskSourceLinearSetup } from './TaskSourceLinearSetup' import { TaskSourceProviderCard } from './TaskSourceProviderCard' diff --git a/src/renderer/src/components/settings/WorktreeSymlinksSection.tsx b/src/renderer/src/components/settings/WorktreeSymlinksSection.tsx index 56f0229535c..1e0cdbcb0d4 100644 --- a/src/renderer/src/components/settings/WorktreeSymlinksSection.tsx +++ b/src/renderer/src/components/settings/WorktreeSymlinksSection.tsx @@ -6,7 +6,7 @@ import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from '. import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' import { cn } from '@/lib/utils' import { FileTypeIcon, FolderIcon } from '@/components/FileTypeIcon' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { getWorktreeSymlinkPathFilterState, type WorktreeSymlinkPathSuggestion diff --git a/src/renderer/src/components/settings/WslHostsExperimentalSetting.tsx b/src/renderer/src/components/settings/WslHostsExperimentalSetting.tsx index 3b5d3655c0b..b27bda1d261 100644 --- a/src/renderer/src/components/settings/WslHostsExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/WslHostsExperimentalSetting.tsx @@ -1,8 +1,8 @@ import type { GlobalSettings } from '../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsSwitch } from './form-controls/SettingsFormControls' import { getWslHostsExperimentalSearchEntry } from './wsl-hosts-experimental-search' import { useWslHostServerFilesMissing } from '../sidebar/use-wsl-hosts-enabled' import { getWslHostServerFilesMissingLabel } from '../sidebar/wsl-host-row-status' diff --git a/src/renderer/src/components/settings/ZcodeCliSetupSection.test.tsx b/src/renderer/src/components/settings/ZcodeCliSetupSection.test.tsx index 562e20a2b39..e16fbda789c 100644 --- a/src/renderer/src/components/settings/ZcodeCliSetupSection.test.tsx +++ b/src/renderer/src/components/settings/ZcodeCliSetupSection.test.tsx @@ -24,7 +24,7 @@ vi.mock('../onboarding/OnboardingInlineCommandTerminal', () => ({ ) })) -vi.mock('./SearchableSetting', () => ({ +vi.mock('./section-layout/SearchableSetting', () => ({ SearchableSetting: ({ children }: { children: React.ReactNode }) =>
{children}
})) diff --git a/src/renderer/src/components/settings/ZcodeCliSetupSection.tsx b/src/renderer/src/components/settings/ZcodeCliSetupSection.tsx index 922c926380d..4a1d4329d6a 100644 --- a/src/renderer/src/components/settings/ZcodeCliSetupSection.tsx +++ b/src/renderer/src/components/settings/ZcodeCliSetupSection.tsx @@ -2,7 +2,7 @@ import { lazy, Suspense, useState } from 'react' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' import { Button } from '../ui/button' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' const OnboardingInlineCommandTerminal = lazy(() => import('../onboarding/OnboardingInlineCommandTerminal').then((module) => ({ diff --git a/src/renderer/src/components/settings/ZcodePlanAccountsSection.tsx b/src/renderer/src/components/settings/ZcodePlanAccountsSection.tsx index 51113f6da85..58bd6b05230 100644 --- a/src/renderer/src/components/settings/ZcodePlanAccountsSection.tsx +++ b/src/renderer/src/components/settings/ZcodePlanAccountsSection.tsx @@ -15,7 +15,7 @@ import { Button } from '../ui/button' import { Input } from '../ui/input' import { Label } from '../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { collectZcodeUsageWindows, ZcodeUsageWindowView } from './zcode-plan-usage-windows' import { useZcodePlanCredentials } from './use-zcode-plan-credentials' import { ZcodeCliSetupSection } from './ZcodeCliSetupSection' diff --git a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts index ca91df77f76..5e5836a475b 100644 --- a/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts +++ b/src/renderer/src/components/settings/__fixtures__/settings-persistence-test-fixture.ts @@ -4,8 +4,8 @@ import { afterEach, beforeEach, expect, vi, type Mock } from 'vitest' import { getDefaultSettings } from '../../../../../shared/constants' import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { useAppStore } from '../../../store' -import type { SettingsStoreModel } from '../use-settings-store-model' -import type { SettingsInteractionModel } from '../use-settings-interaction-controller' +import type { SettingsStoreModel } from '../page/use-settings-store-model' +import type { SettingsInteractionModel } from '../page/use-settings-interaction-controller' import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control-ai' import { agentLaunchSettingsMutationUpdates, diff --git a/src/renderer/src/components/settings/accounts-claude-search.ts b/src/renderer/src/components/settings/accounts-claude-search.ts index 7645a0c6076..f2a4252973b 100644 --- a/src/renderer/src/components/settings/accounts-claude-search.ts +++ b/src/renderer/src/components/settings/accounts-claude-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' export const getAccountsClaudeSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/accounts-pane-claude-section.tsx b/src/renderer/src/components/settings/accounts-pane-claude-section.tsx index 6420df5af27..7146585fcd1 100644 --- a/src/renderer/src/components/settings/accounts-pane-claude-section.tsx +++ b/src/renderer/src/components/settings/accounts-pane-claude-section.tsx @@ -6,7 +6,7 @@ import { Button } from '../ui/button' import { ButtonGroup } from '../ui/button-group' import { Label } from '../ui/label' import { ClaudeIcon } from '../status-bar/icons' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { ClaudeRunningSessionSwitchSetting } from './claude-running-session-switch-setting' import { getProviderAccountRuntime, diff --git a/src/renderer/src/components/settings/accounts-pane-codex-section.tsx b/src/renderer/src/components/settings/accounts-pane-codex-section.tsx index ba7fcdace9e..88b7dd49a58 100644 --- a/src/renderer/src/components/settings/accounts-pane-codex-section.tsx +++ b/src/renderer/src/components/settings/accounts-pane-codex-section.tsx @@ -6,7 +6,7 @@ import { Button } from '../ui/button' import { Label } from '../ui/label' import { OpenAIIcon } from '../status-bar/icons' import { CodexLoginLinkNotice } from './CodexLoginLinkNotice' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { getAccountsCodexSearchEntries } from './accounts-search' import { getCodexSystemDefaultSubtitle } from './accounts-pane-runtime' import type { AccountsPaneSectionModel } from './accounts-pane-types' diff --git a/src/renderer/src/components/settings/accounts-pane-location-section.tsx b/src/renderer/src/components/settings/accounts-pane-location-section.tsx index 30472f31cce..ac9627cd235 100644 --- a/src/renderer/src/components/settings/accounts-pane-location-section.tsx +++ b/src/renderer/src/components/settings/accounts-pane-location-section.tsx @@ -1,7 +1,7 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from './section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from './form-controls/SettingsFormControls' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' import { getHostRuntimeLabel } from './accounts-pane-runtime' import { WSL_DEFAULT_DISTRO_KEY } from './provider-account-visibility' diff --git a/src/renderer/src/components/settings/accounts-pane-minimax-credentials.tsx b/src/renderer/src/components/settings/accounts-pane-minimax-credentials.tsx index 6deb399d9a5..d53e55857b0 100644 --- a/src/renderer/src/components/settings/accounts-pane-minimax-credentials.tsx +++ b/src/renderer/src/components/settings/accounts-pane-minimax-credentials.tsx @@ -7,7 +7,7 @@ import { Button } from '../ui/button' import { Input } from '../ui/input' import { Label } from '../ui/label' import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import { UnsealedCredentialNotice } from './UnsealedCredentialNotice' import type { ProviderRateLimits } from '../../../../shared/rate-limit-types' import type { MiniMaxCredentialsModel } from './use-minimax-credentials' diff --git a/src/renderer/src/components/settings/accounts-pane-opencode-credentials.tsx b/src/renderer/src/components/settings/accounts-pane-opencode-credentials.tsx index abd37f6fb2e..1475ad32f7e 100644 --- a/src/renderer/src/components/settings/accounts-pane-opencode-credentials.tsx +++ b/src/renderer/src/components/settings/accounts-pane-opencode-credentials.tsx @@ -5,7 +5,7 @@ import { Badge } from '../ui/badge' import { Button } from '../ui/button' import { Input } from '../ui/input' import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' type CredentialStatus = boolean | 'loading' | 'unavailable' diff --git a/src/renderer/src/components/settings/accounts-pane-provider-setting-sections.tsx b/src/renderer/src/components/settings/accounts-pane-provider-setting-sections.tsx index 388a9945e84..88e9aab1475 100644 --- a/src/renderer/src/components/settings/accounts-pane-provider-setting-sections.tsx +++ b/src/renderer/src/components/settings/accounts-pane-provider-setting-sections.tsx @@ -3,10 +3,10 @@ import { Button } from '../ui/button' import { Label } from '../ui/label' import { Switch } from '../ui/switch' import { GeminiIcon, OpenCodeGoIcon } from '../status-bar/icons' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' import type { AccountsPaneSectionModel } from './accounts-pane-types' import { OpenCodeGoCredentials } from './accounts-pane-opencode-credentials' -import { DebouncedSettingsTextInput } from './DebouncedSettingsTextInput' +import { DebouncedSettingsTextInput } from './form-controls/DebouncedSettingsTextInput' export function renderGeminiAccountsSection(model: AccountsPaneSectionModel): React.JSX.Element { const { localAccountRuntimeSentenceLabel, recordFeatureInteraction, settings, updateSettings } = diff --git a/src/renderer/src/components/settings/accounts-search.ts b/src/renderer/src/components/settings/accounts-search.ts index a223fee37dd..e198e307f76 100644 --- a/src/renderer/src/components/settings/accounts-search.ts +++ b/src/renderer/src/components/settings/accounts-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { getAccountsClaudeSearchEntries } from './accounts-claude-search' diff --git a/src/renderer/src/components/settings/advanced-network-search.ts b/src/renderer/src/components/settings/advanced-network-search.ts index cd3a00358d7..fc886051989 100644 --- a/src/renderer/src/components/settings/advanced-network-search.ts +++ b/src/renderer/src/components/settings/advanced-network-search.ts @@ -1,7 +1,7 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' export const getAdvancedNetworkSearchEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ { diff --git a/src/renderer/src/components/settings/AdvancedPane.test.tsx b/src/renderer/src/components/settings/advanced/AdvancedPane.test.tsx similarity index 90% rename from src/renderer/src/components/settings/AdvancedPane.test.tsx rename to src/renderer/src/components/settings/advanced/AdvancedPane.test.tsx index 58cd266c7e3..7a69c102a7d 100644 --- a/src/renderer/src/components/settings/AdvancedPane.test.tsx +++ b/src/renderer/src/components/settings/advanced/AdvancedPane.test.tsx @@ -1,10 +1,10 @@ import { renderToStaticMarkup } from 'react-dom/server' import { describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { AdvancedPane } from './AdvancedPane' import { getAdvancedSearchEntry } from './advanced-search' -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: (selector: (state: { settingsSearchQuery: string }) => unknown) => selector({ settingsSearchQuery: '' }) })) diff --git a/src/renderer/src/components/settings/AdvancedPane.tsx b/src/renderer/src/components/settings/advanced/AdvancedPane.tsx similarity index 92% rename from src/renderer/src/components/settings/AdvancedPane.tsx rename to src/renderer/src/components/settings/advanced/AdvancedPane.tsx index df05dc71507..249169c9123 100644 --- a/src/renderer/src/components/settings/AdvancedPane.tsx +++ b/src/renderer/src/components/settings/advanced/AdvancedPane.tsx @@ -1,18 +1,16 @@ import { useRef, useState } from 'react' import { Info, Loader2, RotateCw } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { useMountedRef } from '@/hooks/useMountedRef' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip' -import { AdvancedNetworkSettingsSection } from './AdvancedNetworkSettingsSection' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader, SettingsSwitch } from './SettingsFormControls' -import { getAdvancedPaneSearchEntries, getAdvancedSearchEntry } from './advanced-search' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip' +import { AdvancedNetworkSettingsSection } from '../AdvancedNetworkSettingsSection' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader, SettingsSwitch } from '../form-controls/SettingsFormControls' +import { getAdvancedSearchEntry } from './advanced-search' import { translate } from '@/i18n/i18n' -export { getAdvancedPaneSearchEntries } - type AdvancedPaneProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void diff --git a/src/renderer/src/components/settings/DevToolsPane.tsx b/src/renderer/src/components/settings/advanced/DevToolsPane.tsx similarity index 95% rename from src/renderer/src/components/settings/DevToolsPane.tsx rename to src/renderer/src/components/settings/advanced/DevToolsPane.tsx index 52d584164ec..72d701cd5df 100644 --- a/src/renderer/src/components/settings/DevToolsPane.tsx +++ b/src/renderer/src/components/settings/advanced/DevToolsPane.tsx @@ -1,15 +1,15 @@ import { toast } from 'sonner' import { Bell, Info, OctagonX, Sparkles, Trash2 } from 'lucide-react' -import { Button } from '../ui/button' -import { Badge } from '../ui/badge' -import { SettingsSubsectionHeader } from './SettingsFormControls' -import { showDeleteWorktreeFailureToast } from '../sidebar/delete-worktree-failure-toast' -import { showLocalBaseRefUpdateSuggestionToast } from '../sidebar/local-base-ref-suggestion-toast' +import { Button } from '../../ui/button' +import { Badge } from '../../ui/badge' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' +import { showDeleteWorktreeFailureToast } from '../../sidebar/delete-worktree-failure-toast' +import { showLocalBaseRefUpdateSuggestionToast } from '../../sidebar/local-base-ref-suggestion-toast' import { useOrcaProfileAuthStatusRefresh } from '@/hooks/use-orca-profile-auth-status-refresh' import { translate } from '@/i18n/i18n' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import type { AppState } from '@/store/types' -import { OrcaSignInButton, OrcaSignInWaitNotice } from '../OrcaSignInProgress' +import { OrcaSignInButton, OrcaSignInWaitNotice } from '../../OrcaSignInProgress' const LONG_WORKSPACE_NAME = 'feature/dev-toast-layout-with-a-long-workspace-name' const DEV_TOAST_DESCRIPTION = diff --git a/src/renderer/src/components/settings/ExperimentalPane.fixture.tsx b/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx similarity index 69% rename from src/renderer/src/components/settings/ExperimentalPane.fixture.tsx rename to src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx index 3b0c59fb056..a4f13a1449b 100644 --- a/src/renderer/src/components/settings/ExperimentalPane.fixture.tsx +++ b/src/renderer/src/components/settings/advanced/ExperimentalPane.fixture.tsx @@ -1,5 +1,5 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../shared/constants' +import { defineFixture } from '../../../component-fixtures/component-fixture' +import { getDefaultSettings } from '../../../../../shared/constants' import { ExperimentalPane } from './ExperimentalPane' const settings = { diff --git a/src/renderer/src/components/settings/ExperimentalPane.tsx b/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx similarity index 91% rename from src/renderer/src/components/settings/ExperimentalPane.tsx rename to src/renderer/src/components/settings/advanced/ExperimentalPane.tsx index 55907a40562..bea558e140c 100644 --- a/src/renderer/src/components/settings/ExperimentalPane.tsx +++ b/src/renderer/src/components/settings/advanced/ExperimentalPane.tsx @@ -1,27 +1,25 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' -import { useAppStore } from '../../store' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' -import { getExperimentalPaneSearchEntries, getExperimentalSearchEntry } from './experimental-search' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' +import { useAppStore } from '../../../store/index' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { matchesSettingsSearch } from '../search/settings-search' +import { getExperimentalSearchEntry } from './experimental-search' import { HiddenExperimentalGroup } from './HiddenExperimentalGroup' -import { NumberField, SettingsSwitch } from './SettingsFormControls' +import { NumberField, SettingsSwitch } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' -import { AgentDashboardExperimentalSetting } from './AgentDashboardExperimentalSetting' -import { EphemeralVmsExperimentalSetting } from './EphemeralVmsExperimentalSetting' -import { BrowserExtensionsExperimentalSetting } from './BrowserExtensionsExperimentalSetting' -import { OrchestrationPanelExperimentalSetting } from './OrchestrationPanelExperimentalSetting' -import { WslHostsExperimentalSetting } from './WslHostsExperimentalSetting' -import { wslHostsAvailable } from '../sidebar/use-wsl-hosts-enabled' +import { AgentDashboardExperimentalSetting } from '../AgentDashboardExperimentalSetting' +import { EphemeralVmsExperimentalSetting } from '../EphemeralVmsExperimentalSetting' +import { BrowserExtensionsExperimentalSetting } from '../browser/extensions/BrowserExtensionsExperimentalSetting' +import { OrchestrationPanelExperimentalSetting } from '../OrchestrationPanelExperimentalSetting' +import { WslHostsExperimentalSetting } from '../WslHostsExperimentalSetting' +import { wslHostsAvailable } from '../../sidebar/use-wsl-hosts-enabled' import { MAX_AGENT_HIBERNATION_IDLE_MS, MIN_AGENT_HIBERNATION_IDLE_MS, getEffectiveAgentHibernationIdleMs } from '@/lib/agent-hibernation-planner' -export { getExperimentalPaneSearchEntries } - const MS_PER_MINUTE = 60 * 1000 type ExperimentalPaneProps = { diff --git a/src/renderer/src/components/settings/HiddenExperimentalGroup.tsx b/src/renderer/src/components/settings/advanced/HiddenExperimentalGroup.tsx similarity index 94% rename from src/renderer/src/components/settings/HiddenExperimentalGroup.tsx rename to src/renderer/src/components/settings/advanced/HiddenExperimentalGroup.tsx index 5fe5be68ef1..c94cc4a7e34 100644 --- a/src/renderer/src/components/settings/HiddenExperimentalGroup.tsx +++ b/src/renderer/src/components/settings/advanced/HiddenExperimentalGroup.tsx @@ -1,10 +1,10 @@ import { useState } from 'react' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' import { isTerminalRenderDesyncSentinelArmed, setTerminalRenderDesyncSentinelArmed -} from '../terminal-pane/terminal-render-desync-trigger' +} from '../../terminal-pane/terminal-render-desync-trigger' import { translate } from '@/i18n/i18n' import { getShortcutPlatform } from '@/lib/shortcut-platform' diff --git a/src/renderer/src/components/settings/advanced-search.ts b/src/renderer/src/components/settings/advanced/advanced-search.ts similarity index 92% rename from src/renderer/src/components/settings/advanced-search.ts rename to src/renderer/src/components/settings/advanced/advanced-search.ts index 59cee35c077..9fdfae0b6c7 100644 --- a/src/renderer/src/components/settings/advanced-search.ts +++ b/src/renderer/src/components/settings/advanced/advanced-search.ts @@ -1,8 +1,8 @@ -import type { SettingsSearchEntry } from './settings-search' -import { getAdvancedNetworkSearchEntries } from './advanced-network-search' +import type { SettingsSearchEntry } from '../search/settings-search' +import { getAdvancedNetworkSearchEntries } from '../advanced-network-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getAdvancedPaneSearchEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ ...getAdvancedNetworkSearchEntries(), diff --git a/src/renderer/src/components/settings/experimental-search.ts b/src/renderer/src/components/settings/advanced/experimental-search.ts similarity index 94% rename from src/renderer/src/components/settings/experimental-search.ts rename to src/renderer/src/components/settings/advanced/experimental-search.ts index e3a2d94246d..f12608d4b53 100644 --- a/src/renderer/src/components/settings/experimental-search.ts +++ b/src/renderer/src/components/settings/advanced/experimental-search.ts @@ -1,12 +1,12 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { getNewWorktreeCardStyleSearchEntry } from './new-worktree-card-style-search-entry' -import { getEphemeralVmsSearchEntry } from './ephemeral-vms-search' -import { getBrowserExtensionsExperimentalSearchEntry } from './browser-extensions-experimental-search' -import { getWslHostsExperimentalSearchEntry } from './wsl-hosts-experimental-search' -import { getOrchestrationPanelExperimentalSearchEntry } from './orchestration-panel-experimental-search' +import { getEphemeralVmsSearchEntry } from '../ephemeral-vms-search' +import { getBrowserExtensionsExperimentalSearchEntry } from '../browser/extensions/browser-extensions-experimental-search' +import { getWslHostsExperimentalSearchEntry } from '../wsl-hosts-experimental-search' +import { getOrchestrationPanelExperimentalSearchEntry } from '../orchestration-panel-experimental-search' export const getExperimentalPaneSearchEntries = createLocalizedCatalog( (): SettingsSearchEntry[] => [ diff --git a/src/renderer/src/components/settings/new-worktree-card-style-search-entry.ts b/src/renderer/src/components/settings/advanced/new-worktree-card-style-search-entry.ts similarity index 91% rename from src/renderer/src/components/settings/new-worktree-card-style-search-entry.ts rename to src/renderer/src/components/settings/advanced/new-worktree-card-style-search-entry.ts index a784f376dad..f604891d3c3 100644 --- a/src/renderer/src/components/settings/new-worktree-card-style-search-entry.ts +++ b/src/renderer/src/components/settings/advanced/new-worktree-card-style-search-entry.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getNewWorktreeCardStyleSearchEntry(): SettingsSearchEntry { return { diff --git a/src/renderer/src/components/settings/agent-awake-copy.ts b/src/renderer/src/components/settings/agent-awake-copy.ts index 81229813b91..ced89429789 100644 --- a/src/renderer/src/components/settings/agent-awake-copy.ts +++ b/src/renderer/src/components/settings/agent-awake-copy.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import type { ComputerAwakeMode } from '../../../../shared/computer-awake-mode' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' const AGENT_AWAKE_TITLE_KEY = 'auto.components.settings.agent-awake-copy.modeTitle' const AGENT_AWAKE_DESCRIPTION_WINDOWS_KEY = diff --git a/src/renderer/src/components/settings/agent-cache-timer-search.ts b/src/renderer/src/components/settings/agent-cache-timer-search.ts index 820439e921e..10c144bf4aa 100644 --- a/src/renderer/src/components/settings/agent-cache-timer-search.ts +++ b/src/renderer/src/components/settings/agent-cache-timer-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getAgentCacheTimerSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/agent-generated-tab-title-copy.ts b/src/renderer/src/components/settings/agent-generated-tab-title-copy.ts index 89bf57b43dd..e885f4fbacf 100644 --- a/src/renderer/src/components/settings/agent-generated-tab-title-copy.ts +++ b/src/renderer/src/components/settings/agent-generated-tab-title-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' const AGENT_GENERATED_TAB_TITLES_TITLE_KEY = 'auto.components.settings.agent-generated-tab-title-copy.19ad21615a' diff --git a/src/renderer/src/components/settings/agent-status-hooks-copy.ts b/src/renderer/src/components/settings/agent-status-hooks-copy.ts index 5cc48822f53..6fcef33f9b9 100644 --- a/src/renderer/src/components/settings/agent-status-hooks-copy.ts +++ b/src/renderer/src/components/settings/agent-status-hooks-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' const AGENT_STATUS_HOOKS_TITLE_KEY = 'auto.components.settings.agent-status-hooks-copy.7707c15abb' const AGENT_STATUS_HOOKS_DESCRIPTION_KEY = diff --git a/src/renderer/src/components/settings/agent-workspace-trust-copy.ts b/src/renderer/src/components/settings/agent-workspace-trust-copy.ts index ef541dc0ca7..4762cd51f0d 100644 --- a/src/renderer/src/components/settings/agent-workspace-trust-copy.ts +++ b/src/renderer/src/components/settings/agent-workspace-trust-copy.ts @@ -1,6 +1,6 @@ // @protected-copy: folder trust setting copy. import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getAgentWorkspaceTrustTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/agents-search.ts b/src/renderer/src/components/settings/agents-search.ts index 36a08dc24a5..f2dbed9b8a0 100644 --- a/src/renderer/src/components/settings/agents-search.ts +++ b/src/renderer/src/components/settings/agents-search.ts @@ -36,7 +36,11 @@ import { getCodexHistorySharingTitle } from './codex-history-sharing-copy' import { translate } from '@/i18n/i18n' -import { searchKeywords, translateSearchKeyword, uniqueKeywords } from './settings-search-keywords' +import { + searchKeywords, + translateSearchKeyword, + uniqueKeywords +} from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' function buildAgentSettingsKeywords(): string[] { diff --git a/src/renderer/src/components/settings/AppIconSelector.tsx b/src/renderer/src/components/settings/appearance/AppIconSelector.tsx similarity index 82% rename from src/renderer/src/components/settings/AppIconSelector.tsx rename to src/renderer/src/components/settings/appearance/AppIconSelector.tsx index 8eb653ae799..a7dff400087 100644 --- a/src/renderer/src/components/settings/AppIconSelector.tsx +++ b/src/renderer/src/components/settings/appearance/AppIconSelector.tsx @@ -1,11 +1,15 @@ import type React from 'react' import { ChevronLeft, ChevronRight } from 'lucide-react' -import classicIconUrl from '../../../../../resources/icon.png?url' -import watercolorIconUrl from '../../../../../resources/app-icons/orca-watercolor.png?url' -import blueIconUrl from '../../../../../resources/app-icons/orca-blue.png?url' -import { APP_ICON_OPTIONS, normalizeAppIconId, type AppIconId } from '../../../../shared/app-icon' -import { Button } from '../ui/button' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' +import classicIconUrl from '../../../../../../resources/icon.png?url' +import watercolorIconUrl from '../../../../../../resources/app-icons/orca-watercolor.png?url' +import blueIconUrl from '../../../../../../resources/app-icons/orca-blue.png?url' +import { + APP_ICON_OPTIONS, + normalizeAppIconId, + type AppIconId +} from '../../../../../shared/app-icon' +import { Button } from '../../ui/button' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' import { translate } from '@/i18n/i18n' const APP_ICON_URLS = { diff --git a/src/renderer/src/components/settings/AppearanceAdvancedDisclosure.fixture.tsx b/src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.fixture.tsx similarity index 89% rename from src/renderer/src/components/settings/AppearanceAdvancedDisclosure.fixture.tsx rename to src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.fixture.tsx index f184a1b0f5a..f9c3f367480 100644 --- a/src/renderer/src/components/settings/AppearanceAdvancedDisclosure.fixture.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.fixture.tsx @@ -1,6 +1,6 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' +import { defineFixture } from '../../../component-fixtures/component-fixture' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' import { AppearanceAdvancedDisclosure } from './AppearanceAdvancedDisclosure' function AdvancedFontControls(): React.JSX.Element { diff --git a/src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsx b/src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.tsx similarity index 93% rename from src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsx rename to src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.tsx index 8407000fc10..4d45589264e 100644 --- a/src/renderer/src/components/settings/AppearanceAdvancedDisclosure.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceAdvancedDisclosure.tsx @@ -2,8 +2,8 @@ import type React from 'react' import { useState } from 'react' import { ChevronRight } from 'lucide-react' import { cn } from '@/lib/utils' -import { useAppStore } from '../../store' -import { normalizeSettingsSearchQuery } from './settings-search' +import { useAppStore } from '../../../store/index' +import { normalizeSettingsSearchQuery } from '../search/settings-search' import { translate } from '@/i18n/i18n' type AppearanceAdvancedDisclosureProps = { diff --git a/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx similarity index 94% rename from src/renderer/src/components/settings/AppearanceInterfaceSection.tsx rename to src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx index ad32ee6c8a2..c8b777e8ef8 100644 --- a/src/renderer/src/components/settings/AppearanceInterfaceSection.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceInterfaceSection.tsx @@ -1,43 +1,43 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' import { UIZoomControl } from './UIZoomControl' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { ReduceVisualEffectsSetting } from './ReduceVisualEffectsSetting' import { getReduceVisualEffectsEntries } from './appearance-reduce-visual-effects-search' import { AppearanceAdvancedDisclosure } from './AppearanceAdvancedDisclosure' -import { SettingsSearchableSelect } from './SettingsSearchableSelect' -import { useAppStore } from '../../store' +import { SettingsSearchableSelect } from '../form-controls/SettingsSearchableSelect' +import { useAppStore } from '../../../store/index' import { useShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' import { ShortcutHintList } from './AppearanceShortcutHintList' -import { FontAutocomplete, SettingsRow, SettingsSwitchRow } from './SettingsFormControls' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/constants' +import { FontAutocomplete } from './fonts/FontAutocomplete' +import { SettingsRow, SettingsSwitchRow } from '../form-controls/SettingsFormControls' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/constants' import { getCodeEditorThemeEntries, getLanguageEntries, - getMenuBarIconEntries, - getSystemTrayEntries, getThemeEntries, getTitlebarEntries, getTypographyEntries, getZoomEntries } from './appearance-search' +import { getMenuBarIconEntries, getSystemTrayEntries } from './appearance-system-presence-search' import { getUiLanguageChoiceLabel, SHOW_UI_LANGUAGE_SETTING, UI_LANGUAGE_CHOICES } from '@/i18n/supported-languages' import { translate } from '@/i18n/i18n' -import type { UiLanguage } from '../../../../shared/ui-language' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' -import { translateSearchKeyword } from './settings-search-keywords' +import type { UiLanguage } from '../../../../../shared/ui-language' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from '../search/settings-search' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { usePluginLanguagePacks } from '@/store/plugin-language-packs' import { AppearanceThemeControl, AppearanceThemeSlotSelect, CodeEditorThemeSelect -} from './AppearanceThemeControl' +} from './themes/AppearanceThemeControl' import { usePluginIconThemes } from '@/store/plugin-icon-themes' type AppearanceInterfaceSectionProps = { diff --git a/src/renderer/src/components/settings/AppearancePane.test.tsx b/src/renderer/src/components/settings/appearance/AppearancePane.test.tsx similarity index 97% rename from src/renderer/src/components/settings/AppearancePane.test.tsx rename to src/renderer/src/components/settings/appearance/AppearancePane.test.tsx index f8e4b54dbd2..0131d31e103 100644 --- a/src/renderer/src/components/settings/AppearancePane.test.tsx +++ b/src/renderer/src/components/settings/appearance/AppearancePane.test.tsx @@ -7,9 +7,9 @@ import { I18nextProvider } from 'react-i18next' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { i18n } from '@/i18n/i18n' import { resetRendererAppPlatformCacheForTests } from '@/lib/renderer-app-platform' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' const mocks = vi.hoisted(() => ({ state: { @@ -33,7 +33,7 @@ const mocks = vi.hoisted(() => ({ } })) -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: (selector: (state: typeof mocks.state) => unknown) => selector(mocks.state) })) @@ -42,15 +42,15 @@ vi.mock('@/hooks/useShortcutLabel', async (importOriginal) => ({ useShortcutKeyComboDetails: () => [] })) -vi.mock('../status-bar/use-available-status-bar-toggles', () => ({ +vi.mock('../../status-bar/use-available-status-bar-toggles', () => ({ useAvailableStatusBarToggles: () => mocks.state.availableStatusBarToggles })) -vi.mock('./TerminalAppearanceSection', () => ({ +vi.mock('../terminal/appearance/TerminalAppearanceSection', () => ({ TerminalAppearanceSection: () => null })) -vi.mock('../ui/select', async () => { +vi.mock('../../ui/select', async () => { const React = await import('react') const SelectContext = React.createContext<{ @@ -105,8 +105,8 @@ vi.mock('../ui/select', async () => { }) import { AppearancePane } from './AppearancePane' -import { TooltipProvider } from '../ui/tooltip' -import type { UseTerminalConfigImportReturn } from './useTerminalConfigImport' +import { TooltipProvider } from '../../ui/tooltip' +import type { UseTerminalConfigImportReturn } from '../terminal/configuration/useTerminalConfigImport' const mountedRoots: Root[] = [] diff --git a/src/renderer/src/components/settings/AppearancePane.tsx b/src/renderer/src/components/settings/appearance/AppearancePane.tsx similarity index 92% rename from src/renderer/src/components/settings/AppearancePane.tsx rename to src/renderer/src/components/settings/appearance/AppearancePane.tsx index 04c1c1c2192..1eecaedf513 100644 --- a/src/renderer/src/components/settings/AppearancePane.tsx +++ b/src/renderer/src/components/settings/appearance/AppearancePane.tsx @@ -2,47 +2,45 @@ import type React from 'react' import { useLayoutEffect, useState } from 'react' import { AppWindow, PanelLeft, TerminalSquare } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { AppearanceSection } from './AppearanceSection' import { AppearanceInterfaceSection } from './AppearanceInterfaceSection' import { AppearanceWindowSidebarSection } from './AppearanceWindowSidebarSection' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' -import { useAppStore } from '../../store' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from '../search/settings-search' +import { useAppStore } from '../../../store/index' import { USAGE_PERCENTAGE_DISPLAY_SETTING_ID } from './appearance-usage-percentage-search' import { getAppIconEntries, - getAppearancePaneSearchEntries, getCodeEditorThemeEntries, getLanguageEntries, getLayoutEntries, - getMenuBarIconEntries, - getSidebarEntries, getStatusBarEntries, - getSystemTrayEntries, getThemeEntries, getTitlebarEntries, getTypographyEntries, getZoomEntries } from './appearance-search' +import { getMenuBarIconEntries, getSystemTrayEntries } from './appearance-system-presence-search' +import { + getSidebarEntries, + getLeftSidebarAppearanceEntry, + getWorkspaceCardLayoutEntry +} from './appearance-sidebar-search' import { getReduceVisualEffectsEntries } from './appearance-reduce-visual-effects-search' -import { getTerminalAppearanceSearchEntries } from './terminal-search' -import { TerminalAppearanceSection } from './TerminalAppearanceSection' -import type { UseTerminalConfigImportReturn } from './useTerminalConfigImport' -import type { UseWarpThemeImportReturn } from './useWarpThemeImport' +import { getTerminalAppearanceSearchEntries } from '../terminal/terminal-search' +import { TerminalAppearanceSection } from '../terminal/appearance/TerminalAppearanceSection' +import type { UseTerminalConfigImportReturn } from '../terminal/configuration/useTerminalConfigImport' +import type { UseWarpThemeImportReturn } from '../terminal/themes/useWarpThemeImport' import { AppIconSelector } from './AppIconSelector' -import { normalizeAppIconId } from '../../../../shared/app-icon' +import { normalizeAppIconId } from '../../../../../shared/app-icon' import { getRendererAppPlatform } from '@/lib/renderer-app-platform' import { isWebClientLocation } from '@/lib/web-client-location' import { SHOW_UI_LANGUAGE_SETTING } from '@/i18n/supported-languages' import { translate } from '@/i18n/i18n' -import { - getLeftSidebarAppearanceEntry, - getWorkspaceCardLayoutEntry -} from './appearance-sidebar-search' + import { resolveInterfaceSectionSummary } from './appearance-interface-summary' -export { getAppearancePaneSearchEntries } type AppearancePaneProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/AppearanceSection.tsx b/src/renderer/src/components/settings/appearance/AppearanceSection.tsx similarity index 100% rename from src/renderer/src/components/settings/AppearanceSection.tsx rename to src/renderer/src/components/settings/appearance/AppearanceSection.tsx diff --git a/src/renderer/src/components/settings/AppearanceShortcutHintList.tsx b/src/renderer/src/components/settings/appearance/AppearanceShortcutHintList.tsx similarity index 93% rename from src/renderer/src/components/settings/AppearanceShortcutHintList.tsx rename to src/renderer/src/components/settings/appearance/AppearanceShortcutHintList.tsx index 5bff575c8f5..081abeca8f4 100644 --- a/src/renderer/src/components/settings/AppearanceShortcutHintList.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceShortcutHintList.tsx @@ -1,7 +1,7 @@ import type React from 'react' import type { ShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' -import { ShortcutKeyCombo } from '../ShortcutKeyCombo' +import { ShortcutKeyCombo } from '../../ShortcutKeyCombo' import { translate } from '@/i18n/i18n' export function ShortcutHintList({ diff --git a/src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx b/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx similarity index 95% rename from src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx rename to src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx index 42938f050fa..dee0330ce1c 100644 --- a/src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx +++ b/src/renderer/src/components/settings/appearance/AppearanceWindowSidebarSection.tsx @@ -1,34 +1,35 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' -import type { FeatureInteractionId } from '../../../../shared/feature-interaction-catalog' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' +import type { FeatureInteractionId } from '../../../../../shared/feature-interaction-catalog' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { AppearanceAdvancedDisclosure } from './AppearanceAdvancedDisclosure' -import { useAppStore } from '../../store' +import { useAppStore } from '../../../store/index' import { SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader, SettingsSwitchRow -} from './SettingsFormControls' -import { useAvailableStatusBarToggles } from '../status-bar/use-available-status-bar-toggles' +} from '../form-controls/SettingsFormControls' +import { useAvailableStatusBarToggles } from '../../status-bar/use-available-status-bar-toggles' +import { getLayoutEntries, getFollowSymlinkedDirectoriesEntry } from './appearance-search' import { - getLayoutEntries, - getFollowSymlinkedDirectoriesEntry, getSidebarEntries, - getStatusBarToggles, - getUsagePercentageDisplayEntry -} from './appearance-search' -import { USAGE_PERCENTAGE_DISPLAY_SETTING_ID } from './appearance-usage-percentage-search' -import { LeftSidebarAppearanceSetting } from './LeftSidebarAppearanceSetting' -import { getLeftSidebarAppearanceEntry, getShowPinnedWorktreesInGroupsEntry, getWorkspaceCardLayoutEntry } from './appearance-sidebar-search' +import { getStatusBarToggles } from './appearance-status-bar-search' +import { + getUsagePercentageDisplayEntry, + USAGE_PERCENTAGE_DISPLAY_SETTING_ID +} from './appearance-usage-percentage-search' + +import { LeftSidebarAppearanceSetting } from './LeftSidebarAppearanceSetting' + import { translate } from '@/i18n/i18n' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from '../search/settings-search' type AppearanceWindowSidebarSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsx b/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx similarity index 93% rename from src/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsx rename to src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx index c7ad4b1e7e3..8187d8798e0 100644 --- a/src/renderer/src/components/settings/LeftSidebarAppearanceSetting.tsx +++ b/src/renderer/src/components/settings/appearance/LeftSidebarAppearanceSetting.tsx @@ -1,18 +1,18 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { LeftSidebarAppearanceMode } from '../../../../shared/ui-chrome-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { LeftSidebarAppearanceMode } from '../../../../../shared/ui-chrome-types' import { DEFAULT_LEFT_SIDEBAR_TINT_COLOR, DEFAULT_LEFT_SIDEBAR_TINT_OPACITY, MAX_LEFT_SIDEBAR_TINT_OPACITY -} from '../../../../shared/left-sidebar-appearance' +} from '../../../../../shared/left-sidebar-appearance' import { translate } from '@/i18n/i18n' import { ColorField, NumberField, SettingsRow, SettingsSegmentedControl -} from './SettingsFormControls' +} from '../form-controls/SettingsFormControls' type LeftSidebarAppearanceSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/RecentTabOrderControl.tsx b/src/renderer/src/components/settings/appearance/RecentTabOrderControl.tsx similarity index 87% rename from src/renderer/src/components/settings/RecentTabOrderControl.tsx rename to src/renderer/src/components/settings/appearance/RecentTabOrderControl.tsx index adb8432973b..32cf6ca2b47 100644 --- a/src/renderer/src/components/settings/RecentTabOrderControl.tsx +++ b/src/renderer/src/components/settings/appearance/RecentTabOrderControl.tsx @@ -1,8 +1,8 @@ import React from 'react' -import type { CtrlTabOrderMode } from '../../../../shared/tab-types' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow } from './SettingsFormControls' +import type { CtrlTabOrderMode } from '../../../../../shared/tab-types' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsRow } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' export function RecentTabOrderControl({ diff --git a/src/renderer/src/components/settings/ReduceVisualEffectsSetting.tsx b/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx similarity index 71% rename from src/renderer/src/components/settings/ReduceVisualEffectsSetting.tsx rename to src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx index 268aa446a34..908c3092c75 100644 --- a/src/renderer/src/components/settings/ReduceVisualEffectsSetting.tsx +++ b/src/renderer/src/components/settings/appearance/ReduceVisualEffectsSetting.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { SettingsSearchEntry } from './settings-search' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { SettingsSearchEntry } from '../search/settings-search' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' export function ReduceVisualEffectsSetting({ diff --git a/src/renderer/src/components/settings/UIZoomControl.tsx b/src/renderer/src/components/settings/appearance/UIZoomControl.tsx similarity index 89% rename from src/renderer/src/components/settings/UIZoomControl.tsx rename to src/renderer/src/components/settings/appearance/UIZoomControl.tsx index eafee9b796b..42d8a1385e7 100644 --- a/src/renderer/src/components/settings/UIZoomControl.tsx +++ b/src/renderer/src/components/settings/appearance/UIZoomControl.tsx @@ -1,8 +1,13 @@ import { useEffect, useState, useCallback } from 'react' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' import { Minus, Plus, RotateCcw } from 'lucide-react' import { applyUIZoom } from '@/lib/ui-zoom' -import { ZOOM_STEP, ZOOM_MIN, ZOOM_MAX, zoomLevelToPercent } from './SettingsConstants' +import { + UI_ZOOM_STEP as ZOOM_STEP, + UI_ZOOM_MIN as ZOOM_MIN, + UI_ZOOM_MAX as ZOOM_MAX, + zoomLevelToPercent +} from '../../../../../shared/ui-zoom-level' import { translate } from '@/i18n/i18n' export function UIZoomControl(): React.JSX.Element { diff --git a/src/renderer/src/components/settings/WindowMaterialSetting.tsx b/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx similarity index 95% rename from src/renderer/src/components/settings/WindowMaterialSetting.tsx rename to src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx index 2edefa7b51b..8d434cce3cd 100644 --- a/src/renderer/src/components/settings/WindowMaterialSetting.tsx +++ b/src/renderer/src/components/settings/appearance/WindowMaterialSetting.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { RotateCw } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { hostWindowMaterial, resolveWindowMaterial, @@ -8,10 +8,10 @@ import { windowMaterialPreference, type WindowMaterial, type WindowMaterialHost -} from '../../../../shared/window-material' -import { Button } from '../ui/button' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SettingsRow } from './SettingsFormControls' +} from '../../../../../shared/window-material' +import { Button } from '../../ui/button' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' +import { SettingsRow } from '../form-controls/SettingsFormControls' import { useMountedRef } from '@/hooks/useMountedRef' import { readPrefersReducedTransparency } from '@/hooks/use-reduce-visual-effects' import { activeWindowMaterial, rendererWindowMaterialHost } from '@/lib/window-material-runtime' diff --git a/src/renderer/src/components/settings/appearance-interface-summary.ts b/src/renderer/src/components/settings/appearance/appearance-interface-summary.ts similarity index 94% rename from src/renderer/src/components/settings/appearance-interface-summary.ts rename to src/renderer/src/components/settings/appearance/appearance-interface-summary.ts index ee2497be488..4e684aa5ce1 100644 --- a/src/renderer/src/components/settings/appearance-interface-summary.ts +++ b/src/renderer/src/components/settings/appearance/appearance-interface-summary.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { getUiLanguageChoiceLabel, SHOW_UI_LANGUAGE_SETTING, diff --git a/src/renderer/src/components/settings/appearance-reduce-visual-effects-search.ts b/src/renderer/src/components/settings/appearance/appearance-reduce-visual-effects-search.ts similarity index 88% rename from src/renderer/src/components/settings/appearance-reduce-visual-effects-search.ts rename to src/renderer/src/components/settings/appearance/appearance-reduce-visual-effects-search.ts index 564dc2a7a97..8bcafe1f4e9 100644 --- a/src/renderer/src/components/settings/appearance-reduce-visual-effects-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-reduce-visual-effects-search.ts @@ -1,7 +1,7 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getReduceVisualEffectsEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ { diff --git a/src/renderer/src/components/settings/appearance-search.ts b/src/renderer/src/components/settings/appearance/appearance-search.ts similarity index 96% rename from src/renderer/src/components/settings/appearance-search.ts rename to src/renderer/src/components/settings/appearance/appearance-search.ts index 481b94c6324..38742c483b6 100644 --- a/src/renderer/src/components/settings/appearance-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-search.ts @@ -1,22 +1,15 @@ -import type { SettingsSearchEntry } from './settings-search' -import { getTerminalAppearanceSearchEntries } from './terminal-search' -import { getLeftSidebarAppearanceEntry, getSidebarEntries } from './appearance-sidebar-search' +import type { SettingsSearchEntry } from '../search/settings-search' +import { getTerminalAppearanceSearchEntries } from '../terminal/terminal-search' +import { getSidebarEntries } from './appearance-sidebar-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { SHOW_UI_LANGUAGE_SETTING } from '@/i18n/supported-languages' import { getStatusBarToggles } from './appearance-status-bar-search' import { getUsagePercentageDisplayEntry } from './appearance-usage-percentage-search' import { getMenuBarIconEntries, getSystemTrayEntries } from './appearance-system-presence-search' import { getReduceVisualEffectsEntries } from './appearance-reduce-visual-effects-search' -export { - getMenuBarIconEntries, - getStatusBarToggles, - getSystemTrayEntries, - getUsagePercentageDisplayEntry -} - export const getThemeEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ { title: translate('auto.components.settings.appearance.search.71e06350b4', 'Theme'), @@ -231,8 +224,6 @@ export const getStatusBarEntries = createLocalizedCatalog((): SettingsSearchEntr })) ]) -export { getLeftSidebarAppearanceEntry, getSidebarEntries } - export const getAppIconEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ { title: translate('auto.components.settings.appearance.search.2b313598c6', 'App Icon'), diff --git a/src/renderer/src/components/settings/appearance-sidebar-search.ts b/src/renderer/src/components/settings/appearance/appearance-sidebar-search.ts similarity index 98% rename from src/renderer/src/components/settings/appearance-sidebar-search.ts rename to src/renderer/src/components/settings/appearance/appearance-sidebar-search.ts index d43ca889664..d5cf01a7ee3 100644 --- a/src/renderer/src/components/settings/appearance-sidebar-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-sidebar-search.ts @@ -1,7 +1,7 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getLeftSidebarAppearanceEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ title: translate( diff --git a/src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts similarity index 89% rename from src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts index 0b0474e85e7..a1b768b5d63 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-antigravity-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-antigravity-toggle-search.ts @@ -1,6 +1,6 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getAntigravityStatusBarToggleSearchEntry(): { id: StatusBarItem diff --git a/src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts similarity index 88% rename from src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts index 0d76761cb3f..e5b996658ed 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-cursor-toggle-search.ts @@ -1,6 +1,6 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getCursorStatusBarToggleSearchEntry(): { id: StatusBarItem diff --git a/src/renderer/src/components/settings/appearance-status-bar-grok-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts similarity index 89% rename from src/renderer/src/components/settings/appearance-status-bar-grok-toggle-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts index f2709bbe8a7..a566d660e64 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-grok-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-grok-toggle-search.ts @@ -1,6 +1,6 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getGrokStatusBarToggleSearchEntry(): { id: StatusBarItem diff --git a/src/renderer/src/components/settings/appearance-status-bar-minimax-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts similarity index 90% rename from src/renderer/src/components/settings/appearance-status-bar-minimax-toggle-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts index 4b514acd2eb..337d8766e15 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-minimax-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-minimax-toggle-search.ts @@ -1,6 +1,6 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getMiniMaxStatusBarToggleSearchEntry(): { id: StatusBarItem diff --git a/src/renderer/src/components/settings/appearance-status-bar-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts similarity index 98% rename from src/renderer/src/components/settings/appearance-status-bar-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts index 16749f4ab31..1cd1cca331e 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-search.ts @@ -1,7 +1,7 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { getAntigravityStatusBarToggleSearchEntry } from './appearance-status-bar-antigravity-toggle-search' import { getMiniMaxStatusBarToggleSearchEntry } from './appearance-status-bar-minimax-toggle-search' import { getGrokStatusBarToggleSearchEntry } from './appearance-status-bar-grok-toggle-search' diff --git a/src/renderer/src/components/settings/appearance-status-bar-zcode-toggle-search.ts b/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts similarity index 88% rename from src/renderer/src/components/settings/appearance-status-bar-zcode-toggle-search.ts rename to src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts index 1d618a65dc3..c65ea6e55d7 100644 --- a/src/renderer/src/components/settings/appearance-status-bar-zcode-toggle-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-status-bar-zcode-toggle-search.ts @@ -1,6 +1,6 @@ -import type { StatusBarItem } from '../../../../shared/ui-chrome-types' +import type { StatusBarItem } from '../../../../../shared/ui-chrome-types' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getZcodeStatusBarToggleSearchEntry(): { id: StatusBarItem diff --git a/src/renderer/src/components/settings/appearance-system-presence-search.ts b/src/renderer/src/components/settings/appearance/appearance-system-presence-search.ts similarity index 96% rename from src/renderer/src/components/settings/appearance-system-presence-search.ts rename to src/renderer/src/components/settings/appearance/appearance-system-presence-search.ts index 3676dfd728f..a9e65a56e8b 100644 --- a/src/renderer/src/components/settings/appearance-system-presence-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-system-presence-search.ts @@ -2,8 +2,8 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { getRendererAppPlatform } from '@/lib/renderer-app-platform' import { isWebClientLocation } from '@/lib/web-client-location' -import type { SettingsSearchEntry } from './settings-search' -import { translateSearchKeyword } from './settings-search-keywords' +import type { SettingsSearchEntry } from '../search/settings-search' +import { translateSearchKeyword } from '../search/settings-search-keywords' const getSystemTrayEntryCatalog = createLocalizedCatalog((): SettingsSearchEntry[] => [ { diff --git a/src/renderer/src/components/settings/appearance-usage-percentage-search.ts b/src/renderer/src/components/settings/appearance/appearance-usage-percentage-search.ts similarity index 94% rename from src/renderer/src/components/settings/appearance-usage-percentage-search.ts rename to src/renderer/src/components/settings/appearance/appearance-usage-percentage-search.ts index 1a4352751f2..c1f12be9a9b 100644 --- a/src/renderer/src/components/settings/appearance-usage-percentage-search.ts +++ b/src/renderer/src/components/settings/appearance/appearance-usage-percentage-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' /** Stable Settings deep-link / scroll target for the Used/Remaining control. */ export const USAGE_PERCENTAGE_DISPLAY_SETTING_ID = 'usage-percentage-display' diff --git a/src/renderer/src/components/settings/AppearanceChatContrastControls.draft.test.tsx b/src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.draft.test.tsx similarity index 91% rename from src/renderer/src/components/settings/AppearanceChatContrastControls.draft.test.tsx rename to src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.draft.test.tsx index 2c664843de1..3f032cefae6 100644 --- a/src/renderer/src/components/settings/AppearanceChatContrastControls.draft.test.tsx +++ b/src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.draft.test.tsx @@ -1,16 +1,17 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import type { ComponentProps } from 'react' import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { Slider } from '../ui/slider' -import { resolveNativeChatAppearanceSettings } from '../../../../shared/native-chat/native-chat-appearance-settings' +import type { Slider } from '../../../ui/slider' +import { resolveNativeChatAppearanceSettings } from '../../../../../../shared/native-chat/native-chat-appearance-settings' import { AppearanceChatContrastControls } from './AppearanceChatContrastControls' -vi.mock('../../store', () => ({ +vi.mock('../../../../store/index', () => ({ useAppStore: (selector: (state: { settingsSearchQuery: string }) => unknown) => selector({ settingsSearchQuery: '' }) })) -vi.mock('../ui/slider', () => ({ +vi.mock('../../../ui/slider', () => ({ Slider: ({ value, onValueChange, onValueCommit }: ComponentProps) => ( ({ +vi.mock('../../../../store/index', () => ({ useAppStore: Object.assign( (selector: (state: typeof mock.state) => unknown) => selector(mock.state), { getState: () => mock.state } diff --git a/src/renderer/src/components/settings/AppearanceChatContrastControls.tsx b/src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.tsx similarity index 87% rename from src/renderer/src/components/settings/AppearanceChatContrastControls.tsx rename to src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.tsx index 60f4a33c3d6..c2d20b78f3e 100644 --- a/src/renderer/src/components/settings/AppearanceChatContrastControls.tsx +++ b/src/renderer/src/components/settings/appearance/chat/AppearanceChatContrastControls.tsx @@ -1,15 +1,15 @@ import { useState } from 'react' -import type { NativeChatAppearanceSettings } from '../../../../shared/native-chat/native-chat-appearance-settings' +import type { NativeChatAppearanceSettings } from '../../../../../../shared/native-chat/native-chat-appearance-settings' import { chatTerminalControlledHint, chatTerminalControlledTooltip, getChatContrastEntriesByKey } from './chat-appearance-search' import { translate } from '@/i18n/i18n' -import { Slider } from '../ui/slider' -import { SearchableSetting } from './SearchableSetting' -import { SettingsDisabledControlTooltip } from './SettingsDisabledControlTooltip' -import { SettingsRow, SettingsSwitchRow } from './SettingsFormControls' +import { Slider } from '../../../ui/slider' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsDisabledControlTooltip } from '../../form-controls/SettingsDisabledControlTooltip' +import { SettingsRow, SettingsSwitchRow } from '../../form-controls/SettingsFormControls' type ChatContrastControlsProps = { appearance: Required diff --git a/src/renderer/src/components/settings/AppearanceChatSection.test.tsx b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.test.tsx similarity index 95% rename from src/renderer/src/components/settings/AppearanceChatSection.test.tsx rename to src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.test.tsx index 5a7142b4346..ea510c644d0 100644 --- a/src/renderer/src/components/settings/AppearanceChatSection.test.tsx +++ b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.test.tsx @@ -1,16 +1,19 @@ // @vitest-environment happy-dom -import type { KeybindingOverrides } from '../../../../shared/keybindings' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +// @vitest-environment happy-dom +// @vitest-environment happy-dom +// @vitest-environment happy-dom +import type { KeybindingOverrides } from '../../../../../../shared/keybindings/types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import { TooltipProvider } from '../ui/tooltip' +import { getDefaultSettings } from '../../../../../../shared/constants' +import { TooltipProvider } from '../../../ui/tooltip' import { AppearanceChatSection } from './AppearanceChatSection' import { getChatAppearanceEntriesByKey, getChatAppearanceSearchEntries } from './chat-appearance-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from '../../search/settings-search' const mocks = vi.hoisted( (): { @@ -29,7 +32,7 @@ const mocks = vi.hoisted( vi.mock('@/lib/shortcut-platform', () => ({ getShortcutPlatform: () => mocks.platform })) -vi.mock('../../store', () => ({ +vi.mock('../../../../store/index', () => ({ useAppStore: Object.assign( (selector: (state: typeof mocks.state) => unknown) => selector(mocks.state), { getState: () => mocks.state } diff --git a/src/renderer/src/components/settings/AppearanceChatSection.tsx b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx similarity index 89% rename from src/renderer/src/components/settings/AppearanceChatSection.tsx rename to src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx index fb826790a25..2390910ffdd 100644 --- a/src/renderer/src/components/settings/AppearanceChatSection.tsx +++ b/src/renderer/src/components/settings/appearance/chat/AppearanceChatSection.tsx @@ -3,23 +3,27 @@ import { resetNativeChatAppearanceSettings, resolveNativeChatAppearanceSettings, type NativeChatAppearanceSettings -} from '../../../../shared/native-chat/native-chat-appearance-settings' -import { useAppStore } from '../../store' +} from '../../../../../../shared/native-chat/native-chat-appearance-settings' +import { useAppStore } from '../../../../store/index' import { formatPrimaryShortcutLabel } from '@/hooks/useShortcutLabel' import { translate } from '@/i18n/i18n' import { AppearanceChatContrastControls } from './AppearanceChatContrastControls' import { ChatFontFamilySetting } from './ChatFontFamilySetting' -import { Button } from '../ui/button' -import { SearchableSetting } from './SearchableSetting' -import { NumberField, SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { Button } from '../../../ui/button' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { + NumberField, + SettingsRow, + SettingsSegmentedControl +} from '../../form-controls/SettingsFormControls' import { chatTerminalControlledHint, chatTerminalControlledTooltip, getChatAppearanceEntriesByKey, getChatWidthOptions } from './chat-appearance-search' -import { writeNativeChatAppearance } from '../native-chat/native-chat-appearance-write' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { writeNativeChatAppearance } from '../../../native-chat/native-chat-appearance-write' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' export type AppearanceChatSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/ChatFontFamilySetting.tsx b/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx similarity index 84% rename from src/renderer/src/components/settings/ChatFontFamilySetting.tsx rename to src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx index 509d789b95d..5dd01d7e9d0 100644 --- a/src/renderer/src/components/settings/ChatFontFamilySetting.tsx +++ b/src/renderer/src/components/settings/appearance/chat/ChatFontFamilySetting.tsx @@ -1,14 +1,15 @@ import { useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { resolveNativeChatAppearanceSettings } from '../../../../shared/native-chat/native-chat-appearance-settings' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { resolveNativeChatAppearanceSettings } from '../../../../../../shared/native-chat/native-chat-appearance-settings' import { translate } from '@/i18n/i18n' import { NATIVE_CHAT_APPEARANCE_ROOT_CLASS, useNativeChatAppearanceStyle -} from '../native-chat/native-chat-appearance-style' -import { FontAutocomplete, SettingsRow } from './SettingsFormControls' -import { SettingsDisabledControlTooltip } from './SettingsDisabledControlTooltip' -import { SearchableSetting } from './SearchableSetting' +} from '../../../native-chat/native-chat-appearance-style' +import { FontAutocomplete } from '../fonts/FontAutocomplete' +import { SettingsRow } from '../../form-controls/SettingsFormControls' +import { SettingsDisabledControlTooltip } from '../../form-controls/SettingsDisabledControlTooltip' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { chatTerminalControlledHint, chatTerminalControlledTooltip, diff --git a/src/renderer/src/components/settings/chat-appearance-search.ts b/src/renderer/src/components/settings/appearance/chat/chat-appearance-search.ts similarity index 97% rename from src/renderer/src/components/settings/chat-appearance-search.ts rename to src/renderer/src/components/settings/appearance/chat/chat-appearance-search.ts index 085926c6ff2..05a29157a6b 100644 --- a/src/renderer/src/components/settings/chat-appearance-search.ts +++ b/src/renderer/src/components/settings/appearance/chat/chat-appearance-search.ts @@ -1,7 +1,7 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { translateSearchKeyword } from './settings-search-keywords' -import type { SettingsSearchEntry } from './settings-search' +import { translateSearchKeyword } from '../../search/settings-search-keywords' +import type { SettingsSearchEntry } from '../../search/settings-search' import { formatPrimaryShortcutLabel } from '@/hooks/useShortcutLabel' export function chatTerminalControlledHint(): string { diff --git a/src/renderer/src/components/settings/SettingsFormControls.font-autocomplete.test.tsx b/src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx similarity index 98% rename from src/renderer/src/components/settings/SettingsFormControls.font-autocomplete.test.tsx rename to src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx index dfdbb68e419..0fdcfe7daf1 100644 --- a/src/renderer/src/components/settings/SettingsFormControls.font-autocomplete.test.tsx +++ b/src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx @@ -1,10 +1,11 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, useState, type ReactNode } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { FontAutocomplete } from './SettingsFormControls' -import { FONT_SUGGESTION_RENDER_LIMIT } from './settings-form-option-filter' +import { FontAutocomplete } from './FontAutocomplete' +import { FONT_SUGGESTION_RENDER_LIMIT } from './font-suggestion-filter' vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, defaultValue: string) => defaultValue diff --git a/src/renderer/src/components/settings/FontAutocomplete.tsx b/src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.tsx similarity index 98% rename from src/renderer/src/components/settings/FontAutocomplete.tsx rename to src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.tsx index 6e39e9dadeb..89d1a09713c 100644 --- a/src/renderer/src/components/settings/FontAutocomplete.tsx +++ b/src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.tsx @@ -1,10 +1,10 @@ import type React from 'react' import { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react' import { Check, ChevronsUpDown, CircleX } from 'lucide-react' -import { Input } from '../ui/input' -import { Popover, PopoverAnchor, PopoverContent } from '../ui/popover' -import { ScrollArea } from '../ui/scroll-area' -import { filterFontSuggestions, getRenderedFontSuggestions } from './settings-form-option-filter' +import { Input } from '../../../ui/input' +import { Popover, PopoverAnchor, PopoverContent } from '../../../ui/popover' +import { ScrollArea } from '../../../ui/scroll-area' +import { filterFontSuggestions, getRenderedFontSuggestions } from './font-suggestion-filter' import { useInstalledFontsUnavailable } from './installed-font-list' import { translate } from '@/i18n/i18n' import { buildAppFontFamily } from '@/lib/app-font-family' diff --git a/src/renderer/src/components/settings/appearance/fonts/font-suggestion-filter.ts b/src/renderer/src/components/settings/appearance/fonts/font-suggestion-filter.ts new file mode 100644 index 00000000000..678dbe80c52 --- /dev/null +++ b/src/renderer/src/components/settings/appearance/fonts/font-suggestion-filter.ts @@ -0,0 +1,51 @@ +import { normalizeSettingsFormOptionQuery } from '../../form-controls/settings-form-option-filter' + +export const FONT_SUGGESTION_RENDER_LIMIT = 320 + +export type RenderedFontSuggestion = { + font: string + sourceIndex: number +} + +export function filterFontSuggestions( + suggestions: readonly string[], + query: string, + defaultOptionLabel = '' +): string[] { + const normalizedQuery = normalizeSettingsFormOptionQuery(query) + if (normalizedQuery === null) { + return [] + } + if (!normalizedQuery) { + return [...suggestions] + } + + const startsWith: string[] = [] + const includes: string[] = [] + for (const font of suggestions) { + const normalizedFont = (font || defaultOptionLabel).toLowerCase() + if (normalizedFont.startsWith(normalizedQuery)) { + startsWith.push(font) + } else if (normalizedFont.includes(normalizedQuery)) { + includes.push(font) + } + } + return [...startsWith, ...includes] +} + +export function getRenderedFontSuggestions( + suggestions: readonly string[], + highlightedIndex: number, + limit = FONT_SUGGESTION_RENDER_LIMIT +): RenderedFontSuggestion[] { + const cappedLength = Math.min(suggestions.length, limit) + if (cappedLength <= 0) { + return [] + } + + const sourceIndexes = Array.from({ length: cappedLength }, (_value, index) => index) + if (highlightedIndex >= cappedLength && highlightedIndex < suggestions.length) { + sourceIndexes[cappedLength - 1] = highlightedIndex + } + return sourceIndexes.map((sourceIndex) => ({ font: suggestions[sourceIndex] ?? '', sourceIndex })) +} diff --git a/src/renderer/src/components/settings/SettingsConstants.test.ts b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.test.ts similarity index 78% rename from src/renderer/src/components/settings/SettingsConstants.test.ts rename to src/renderer/src/components/settings/appearance/fonts/font-suggestions.test.ts index 46876796784..42a517ea09d 100644 --- a/src/renderer/src/components/settings/SettingsConstants.test.ts +++ b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/constants' -import { mergeFontSuggestions } from './SettingsConstants' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../../shared/constants' +import { mergeFontSuggestions } from './font-suggestions' describe('mergeFontSuggestions', () => { it('keeps installed fonts beyond the old hydration cutoff', () => { diff --git a/src/renderer/src/components/settings/SettingsConstants.ts b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts similarity index 58% rename from src/renderer/src/components/settings/SettingsConstants.ts rename to src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts index 7442f7bc025..2ed5472fb39 100644 --- a/src/renderer/src/components/settings/SettingsConstants.ts +++ b/src/renderer/src/components/settings/appearance/fonts/font-suggestions.ts @@ -1,19 +1,4 @@ -import { DEFAULT_APP_FONT_FAMILY, getDefaultRepoHookSettings } from '../../../../shared/constants' -import { DESKTOP_TERMINAL_SCROLLBACK_ROW_PRESETS } from '../../../../shared/terminal-scrollback-policy' -import { uiZoomFactorFromLevel } from '../../../../shared/ui-zoom-level' - -export const DEFAULT_REPO_HOOK_SETTINGS = getDefaultRepoHookSettings() -export const MAX_THEME_RESULTS = 80 -export const SCROLLBACK_PRESETS_ROWS = DESKTOP_TERMINAL_SCROLLBACK_ROW_PRESETS -export { - UI_ZOOM_STEP as ZOOM_STEP, - UI_ZOOM_MIN as ZOOM_MIN, - UI_ZOOM_MAX as ZOOM_MAX -} from '../../../../shared/ui-zoom-level' - -export function zoomLevelToPercent(level: number): number { - return Math.round(100 * uiZoomFactorFromLevel(level)) -} +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../../shared/constants' export function mergeFontSuggestions( systemFonts: readonly string[], diff --git a/src/renderer/src/components/settings/installed-font-list.ts b/src/renderer/src/components/settings/appearance/fonts/installed-font-list.ts similarity index 100% rename from src/renderer/src/components/settings/installed-font-list.ts rename to src/renderer/src/components/settings/appearance/fonts/installed-font-list.ts diff --git a/src/renderer/src/components/settings/AppearanceThemeControl.tsx b/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx similarity index 94% rename from src/renderer/src/components/settings/AppearanceThemeControl.tsx rename to src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx index 22370d383be..ddebd3bada9 100644 --- a/src/renderer/src/components/settings/AppearanceThemeControl.tsx +++ b/src/renderer/src/components/settings/appearance/themes/AppearanceThemeControl.tsx @@ -1,26 +1,26 @@ import type React from 'react' import { Loader2, Store, Zap } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { PluginThemeRegistration } from '../../../../shared/plugins/artifacts/plugin-theme-artifact' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { PluginThemeRegistration } from '../../../../../../shared/plugins/artifacts/plugin-theme-artifact' import { editorThemeSlotUpdate, MATCH_TERMINAL_APP_THEME, pluginAppThemeSlotUpdate -} from '../../../../shared/plugin-theme-settings' -import { Button } from '../ui/button' +} from '../../../../../../shared/plugin-theme-settings' +import { Button } from '../../../ui/button' import { SettingsSearchableSelect, type SettingsSearchableSelectAction, type SettingsSearchableSelectGroup -} from './SettingsSearchableSelect' -import { SettingsSegmentedControl } from './SettingsFormControls' +} from '../../form-controls/SettingsSearchableSelect' +import { SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' import { usePluginTerminalThemes, usePluginThemes } from '@/store/plugin-themes' -import { PluginThemeSwatch, ThemeColorSwatch } from '../plugins/page/PluginThemeSwatch' +import { PluginThemeSwatch, ThemeColorSwatch } from '../../../plugins/page/PluginThemeSwatch' import { isPluginTerminalThemeSelected, terminalThemeUpdate -} from '../plugins/state/plugin-theme-apply' +} from '../../../plugins/state/plugin-theme-apply' import { findCodeEditorTheme } from '@/lib/code-editor-theme' import { isWebClientLocation } from '@/lib/web-client-location' import { requestPluginBrowse } from '@/store/plugin-preview-request' diff --git a/src/renderer/src/components/settings/use-catalog-app-themes.test.ts b/src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.test.ts similarity index 95% rename from src/renderer/src/components/settings/use-catalog-app-themes.test.ts rename to src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.test.ts index b73e71713ae..e280dc42517 100644 --- a/src/renderer/src/components/settings/use-catalog-app-themes.test.ts +++ b/src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import type { PluginMarketplaceHostListing } from '../../../../preload/api-types' +import type { PluginMarketplaceHostListing } from '../../../../../../preload/api/plugin-host-api' import { catalogAppThemes } from './use-catalog-app-themes' function themeListing( diff --git a/src/renderer/src/components/settings/use-catalog-app-themes.ts b/src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.ts similarity index 88% rename from src/renderer/src/components/settings/use-catalog-app-themes.ts rename to src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.ts index b3114b8c251..c30a303c10b 100644 --- a/src/renderer/src/components/settings/use-catalog-app-themes.ts +++ b/src/renderer/src/components/settings/appearance/themes/use-catalog-app-themes.ts @@ -1,14 +1,12 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import type { - PluginHostListEntry, - PluginMarketplaceHostListing -} from '../../../../preload/api-types' -import type { PluginThemeRegistration } from '../../../../shared/plugins/artifacts/plugin-theme-artifact' -import { pluginHostVersion } from '../../../../shared/plugins/installation/plugin-host-version' -import { buildPluginListEntries, needsNewerOrca } from '../plugins/list/plugin-list-entries' -import { applyPluginAppThemeToSlot } from '../plugins/state/plugin-theme-apply' -import { createPluginPagePreviewCache } from '../plugins/state/use-plugin-catalog' -import { usePluginInstallAction } from '../plugins/state/use-plugin-install-action' +import type { PluginHostListEntry } from '../../../../../../shared/plugins/plugin-list-entry' +import type { PluginMarketplaceHostListing } from '../../../../../../preload/api/plugin-host-api' +import type { PluginThemeRegistration } from '../../../../../../shared/plugins/artifacts/plugin-theme-artifact' +import { pluginHostVersion } from '../../../../../../shared/plugins/installation/plugin-host-version' +import { buildPluginListEntries, needsNewerOrca } from '../../../plugins/list/plugin-list-entries' +import { applyPluginAppThemeToSlot } from '../../../plugins/state/plugin-theme-apply' +import { createPluginPagePreviewCache } from '../../../plugins/state/use-plugin-catalog' +import { usePluginInstallAction } from '../../../plugins/state/use-plugin-install-action' type CatalogSnapshot = { installed: readonly PluginHostListEntry[] diff --git a/src/renderer/src/components/settings/ArtifactsSettingsPane.test.tsx b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.test.tsx similarity index 98% rename from src/renderer/src/components/settings/ArtifactsSettingsPane.test.tsx rename to src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.test.tsx index e5475c54f6a..652b34d278d 100644 --- a/src/renderer/src/components/settings/ArtifactsSettingsPane.test.tsx +++ b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.test.tsx @@ -4,7 +4,7 @@ import '@testing-library/jest-dom/vitest' import { cleanup, render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' const mocks = vi.hoisted(() => ({ connect: vi.fn(), @@ -27,7 +27,7 @@ vi.mock('@/lib/web-client-location', () => ({ isWebClientLocation: () => mocks.state.isWebClient })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ ...mocks.state, diff --git a/src/renderer/src/components/settings/ArtifactsSettingsPane.tsx b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx similarity index 96% rename from src/renderer/src/components/settings/ArtifactsSettingsPane.tsx rename to src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx index 19040ff8074..21ec2c5d1ac 100644 --- a/src/renderer/src/components/settings/ArtifactsSettingsPane.tsx +++ b/src/renderer/src/components/settings/artifacts/ArtifactsSettingsPane.tsx @@ -1,12 +1,12 @@ import { ArrowRight, Files } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { Button } from '@/components/ui/button' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { useOrcaProfileAuthStatusRefresh } from '@/hooks/use-orca-profile-auth-status-refresh' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { isWebClientLocation } from '@/lib/web-client-location' import { translate } from '@/i18n/i18n' -import { OrcaSignInButton, OrcaSignInWaitNotice } from '../OrcaSignInProgress' +import { OrcaSignInButton, OrcaSignInWaitNotice } from '../../OrcaSignInProgress' type HowToStep = { key: string; title: string; description: string } diff --git a/src/renderer/src/components/settings/artifacts-settings-search.ts b/src/renderer/src/components/settings/artifacts/artifacts-settings-search.ts similarity index 95% rename from src/renderer/src/components/settings/artifacts-settings-search.ts rename to src/renderer/src/components/settings/artifacts/artifacts-settings-search.ts index 00a0d230715..4ebdb8cbcd3 100644 --- a/src/renderer/src/components/settings/artifacts-settings-search.ts +++ b/src/renderer/src/components/settings/artifacts/artifacts-settings-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getArtifactsSettingsSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/auto-rename-branch-search.ts b/src/renderer/src/components/settings/auto-rename-branch-search.ts index 0fd2d1938bc..1c3c1b61312 100644 --- a/src/renderer/src/components/settings/auto-rename-branch-search.ts +++ b/src/renderer/src/components/settings/auto-rename-branch-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getAutoRenameBranchParentSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/AutomationsSettingsPane.test.tsx b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.test.tsx similarity index 93% rename from src/renderer/src/components/settings/AutomationsSettingsPane.test.tsx rename to src/renderer/src/components/settings/automations/AutomationsSettingsPane.test.tsx index 2661c4177c1..8f106d38709 100644 --- a/src/renderer/src/components/settings/AutomationsSettingsPane.test.tsx +++ b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.test.tsx @@ -4,7 +4,7 @@ import '@testing-library/jest-dom/vitest' import { cleanup, render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' const mocks = vi.hoisted(() => ({ openAutomationsPage: vi.fn() @@ -14,7 +14,7 @@ vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ openAutomationsPage: mocks.openAutomationsPage }) })) diff --git a/src/renderer/src/components/settings/AutomationsSettingsPane.tsx b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx similarity index 96% rename from src/renderer/src/components/settings/AutomationsSettingsPane.tsx rename to src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx index 991081e4739..b119ed41d87 100644 --- a/src/renderer/src/components/settings/AutomationsSettingsPane.tsx +++ b/src/renderer/src/components/settings/automations/AutomationsSettingsPane.tsx @@ -1,8 +1,8 @@ import { ArrowRight, CalendarClock } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { Button } from '@/components/ui/button' -import { SettingsSwitchRow } from './SettingsFormControls' -import { useAppStore } from '@/store' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' +import { useAppStore } from '@/store/index' import { translate } from '@/i18n/i18n' export function AutomationsSettingsPane({ diff --git a/src/renderer/src/components/settings/automations-settings-search.ts b/src/renderer/src/components/settings/automations/automations-settings-search.ts similarity index 92% rename from src/renderer/src/components/settings/automations-settings-search.ts rename to src/renderer/src/components/settings/automations/automations-settings-search.ts index 3ab93d69c47..a18a17743f2 100644 --- a/src/renderer/src/components/settings/automations-settings-search.ts +++ b/src/renderer/src/components/settings/automations/automations-settings-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getAutomationsSettingsSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/BrowserDefaultZoomSetting.tsx b/src/renderer/src/components/settings/browser/BrowserDefaultZoomSetting.tsx similarity index 91% rename from src/renderer/src/components/settings/BrowserDefaultZoomSetting.tsx rename to src/renderer/src/components/settings/browser/BrowserDefaultZoomSetting.tsx index 418ab9f6a50..7e6f5aa7e8f 100644 --- a/src/renderer/src/components/settings/BrowserDefaultZoomSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserDefaultZoomSetting.tsx @@ -2,10 +2,10 @@ import { BROWSER_PAGE_ZOOM_LEVELS, browserPageZoomLevelToPercent, normalizeBrowserPageZoomLevel -} from '../../../../shared/browser-page-zoom' -import { Label } from '../ui/label' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' +} from '../../../../../shared/browser-page-zoom' +import { Label } from '../../ui/label' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' type BrowserDefaultZoomSettingProps = { diff --git a/src/renderer/src/components/settings/BrowserHomePageSetting.tsx b/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx similarity index 88% rename from src/renderer/src/components/settings/BrowserHomePageSetting.tsx rename to src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx index f0b25262ea6..4e11e6b870e 100644 --- a/src/renderer/src/components/settings/BrowserHomePageSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserHomePageSetting.tsx @@ -1,10 +1,10 @@ import { toast } from 'sonner' -import { ORCA_BROWSER_BLANK_URL } from '../../../../shared/constants' -import { normalizeBrowserNavigationUrl } from '../../../../shared/browser-url' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' +import { ORCA_BROWSER_BLANK_URL } from '../../../../../shared/constants' +import { normalizeBrowserNavigationUrl } from '../../../../../shared/browser-url' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' type BrowserHomePageSettingProps = { diff --git a/src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx b/src/renderer/src/components/settings/browser/BrowserPane.search-catalog.test.tsx similarity index 82% rename from src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx rename to src/renderer/src/components/settings/browser/BrowserPane.search-catalog.test.tsx index f0746ded82f..daf754acf8a 100644 --- a/src/renderer/src/components/settings/BrowserPane.search-catalog.test.tsx +++ b/src/renderer/src/components/settings/browser/BrowserPane.search-catalog.test.tsx @@ -1,7 +1,8 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { BrowserPane } from './BrowserPane' import { getBrowserPaneSearchEntries } from './browser-search' import type * as BrowserSearch from './browser-search' @@ -22,7 +23,7 @@ vi.mock('./browser-search', async (importOriginal) => { const original = await importOriginal() return { ...original, getBrowserPaneSearchEntries: vi.fn(original.getBrowserPaneSearchEntries) } }) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ settingsSearchQuery: fake.query, @@ -38,7 +39,7 @@ vi.mock('@/store', () => ({ }) })) vi.mock('@/components/terminal-pane/pane-helpers', () => ({ isMacUserAgent: () => false })) -vi.mock('../sidebar/sidebar-host-options', () => ({ +vi.mock('../../sidebar/sidebar-host-options', () => ({ buildSidebarHostOptions: () => fake.hostOptions })) vi.mock('./BrowserHomePageSetting', () => ({ @@ -56,48 +57,48 @@ vi.mock('./BrowserHomePageSetting', () => ({ /> ) })) -vi.mock('./BrowserUsePane', () => ({ BrowserUseSetup: () => Browser use row })) +vi.mock('./use/BrowserUsePane', () => ({ BrowserUseSetup: () => Browser use row })) vi.mock('./BrowserDefaultZoomSetting', () => ({ BrowserDefaultZoomSetting: () => Zoom row })) vi.mock('./BrowserSearchEngineSetting', () => ({ BrowserSearchEngineSetting: () => Search row })) -vi.mock('./BrowserLinkRoutingSetting', () => ({ +vi.mock('./routing/BrowserLinkRoutingSetting', () => ({ BrowserLinkRoutingSetting: () => Routing row })) -vi.mock('./BrowserLinkRoutingModifierSetting', () => ({ +vi.mock('./routing/BrowserLinkRoutingModifierSetting', () => ({ BrowserLinkRoutingModifierSetting: () => Modifier row })) -vi.mock('./BrowserLinkRoutingBackgroundSetting', () => ({ +vi.mock('./routing/BrowserLinkRoutingBackgroundSetting', () => ({ BrowserLinkRoutingBackgroundSetting: () => Background links row })) -vi.mock('./BrowserTerminalLinkActionsSetting', () => ({ +vi.mock('./routing/BrowserTerminalLinkActionsSetting', () => ({ BrowserTerminalLinkActionsSetting: () => Terminal links row })) -vi.mock('./BrowserLocalhostWorktreeLabelsSetting', () => ({ +vi.mock('./routing/BrowserLocalhostWorktreeLabelsSetting', () => ({ BrowserLocalhostWorktreeLabelsSetting: () => Localhost row })) vi.mock('./BrowserSitePermissionsSetting', () => ({ BrowserSitePermissionsSetting: () => Site permissions row })) -vi.mock('./BrowserClientHostedRemoteSetting', () => ({ +vi.mock('./routing/BrowserClientHostedRemoteSetting', () => ({ BrowserClientHostedRemoteSetting: () => Remote row })) -vi.mock('./BrowserSshWorkspaceRoutingSetting', () => ({ +vi.mock('./routing/BrowserSshWorkspaceRoutingSetting', () => ({ BrowserSshWorkspaceRoutingSetting: () => SSH row })) -vi.mock('./BrowserProfileScopeSetting', () => ({ +vi.mock('./profiles/BrowserProfileScopeSetting', () => ({ BrowserProfileScopeSetting: () => Profile scope row })) vi.mock('./BrowserUserAgentSetting', () => ({ BrowserUserAgentSetting: () => Identity row })) -vi.mock('./SettingsFormControls', () => ({ SettingsSubsectionHeader: () => null })) -vi.mock('./BrowserSessionCookiesSection', () => ({ +vi.mock('../form-controls/SettingsFormControls', () => ({ SettingsSubsectionHeader: () => null })) +vi.mock('./profiles/BrowserSessionCookiesSection', () => ({ BrowserSessionCookiesSection: () => Cookies row })) -vi.mock('./BrowserNewProfileDialog', () => ({ BrowserNewProfileDialog: () => null })) +vi.mock('./profiles/BrowserNewProfileDialog', () => ({ BrowserNewProfileDialog: () => null })) beforeEach(() => { vi.clearAllMocks() diff --git a/src/renderer/src/components/settings/BrowserPane.test.ts b/src/renderer/src/components/settings/browser/BrowserPane.test.ts similarity index 100% rename from src/renderer/src/components/settings/BrowserPane.test.ts rename to src/renderer/src/components/settings/browser/BrowserPane.test.ts diff --git a/src/renderer/src/components/settings/BrowserPane.tsx b/src/renderer/src/components/settings/browser/BrowserPane.tsx similarity index 88% rename from src/renderer/src/components/settings/BrowserPane.tsx rename to src/renderer/src/components/settings/browser/BrowserPane.tsx index 3f5ebe15cac..efd52dbde1a 100644 --- a/src/renderer/src/components/settings/BrowserPane.tsx +++ b/src/renderer/src/components/settings/browser/BrowserPane.tsx @@ -1,47 +1,46 @@ import { useCallback, useEffect, useMemo, useRef, useState, type MutableRefObject } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { useAppStore } from '../../store' -import { matchesSettingsSearch } from './settings-search' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { useAppStore } from '../../../store/index' +import { matchesSettingsSearch } from '../search/settings-search' import { getBrowserPaneSearchEntries } from './browser-search' -import { getBrowserLinkRoutingDescription } from './browser-link-routing-copy' -import { getBrowserUsePaneSearchEntries } from './browser-use-search' -import { getBrowserPaneCombinedSearchEntries } from './browser-pane-search' +import { getBrowserLinkRoutingDescription } from './routing/browser-link-routing-copy' +import { getBrowserUsePaneSearchEntries } from './use/browser-use-search' + import { BrowserHomePageSetting } from './BrowserHomePageSetting' import { BrowserDefaultZoomSetting } from './BrowserDefaultZoomSetting' -import { BrowserUseSetup } from './BrowserUsePane' +import { BrowserUseSetup } from './use/BrowserUsePane' import { BrowserSearchEngineSetting } from './BrowserSearchEngineSetting' -import { BrowserLinkRoutingSetting } from './BrowserLinkRoutingSetting' -import { BrowserLinkRoutingModifierSetting } from './BrowserLinkRoutingModifierSetting' -import { BrowserLinkRoutingBackgroundSetting } from './BrowserLinkRoutingBackgroundSetting' -import { BrowserTerminalLinkActionsSetting } from './BrowserTerminalLinkActionsSetting' -import { BrowserLocalhostWorktreeLabelsSetting } from './BrowserLocalhostWorktreeLabelsSetting' -import { BrowserClientHostedRemoteSetting } from './BrowserClientHostedRemoteSetting' -import { BrowserSshWorkspaceRoutingSetting } from './BrowserSshWorkspaceRoutingSetting' -import { BrowserProfileScopeSetting } from './BrowserProfileScopeSetting' +import { BrowserLinkRoutingSetting } from './routing/BrowserLinkRoutingSetting' +import { BrowserLinkRoutingModifierSetting } from './routing/BrowserLinkRoutingModifierSetting' +import { BrowserLinkRoutingBackgroundSetting } from './routing/BrowserLinkRoutingBackgroundSetting' +import { BrowserTerminalLinkActionsSetting } from './routing/BrowserTerminalLinkActionsSetting' +import { BrowserLocalhostWorktreeLabelsSetting } from './routing/BrowserLocalhostWorktreeLabelsSetting' +import { BrowserClientHostedRemoteSetting } from './routing/BrowserClientHostedRemoteSetting' +import { BrowserSshWorkspaceRoutingSetting } from './routing/BrowserSshWorkspaceRoutingSetting' +import { BrowserProfileScopeSetting } from './profiles/BrowserProfileScopeSetting' import { BrowserUserAgentSetting } from './BrowserUserAgentSetting' import { BrowserSitePermissionsSetting } from './BrowserSitePermissionsSetting' -import { SettingsSubsectionHeader } from './SettingsFormControls' -import { BrowserSessionCookiesSection } from './BrowserSessionCookiesSection' -import { BrowserNewProfileDialog } from './BrowserNewProfileDialog' -import { BrowserExtensionsSection } from './BrowserExtensionsSection' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' +import { BrowserSessionCookiesSection } from './profiles/BrowserSessionCookiesSection' +import { BrowserNewProfileDialog } from './profiles/BrowserNewProfileDialog' +import { BrowserExtensionsSection } from './extensions/BrowserExtensionsSection' import { createBrowserHomePageDraftState, resolveBrowserHomePageDraftState } from './browser-home-page-draft-state' -import { buildSidebarHostOptions } from '../sidebar/sidebar-host-options' -import { getHostDisplayLabelOverrides } from '../../../../shared/host-setting-overrides' +import { buildSidebarHostOptions } from '../../sidebar/sidebar-host-options' +import { getHostDisplayLabelOverrides } from '../../../../../shared/host-setting-overrides' import { getSettingsFocusedExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../../shared/execution-host' import { isMacUserAgent } from '@/components/terminal-pane/pane-helpers' import { translate } from '@/i18n/i18n' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' -import { resolveAvailableBrowserSessionHostId } from './browser-session-host-selection' +import { resolveAvailableBrowserSessionHostId } from './profiles/browser-session-host-selection' import { getDefaultBrowserProfileForHost } from '@/store/slices/browser/browser-host-state' import { motionSafeScrollBehavior } from '@/hooks/usePrefersReducedMotion' -export { getBrowserPaneCombinedSearchEntries } type BrowserPaneProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/BrowserSearchEngineSetting.tsx b/src/renderer/src/components/settings/browser/BrowserSearchEngineSetting.tsx similarity index 93% rename from src/renderer/src/components/settings/BrowserSearchEngineSetting.tsx rename to src/renderer/src/components/settings/browser/BrowserSearchEngineSetting.tsx index c2cbf75686d..76f11238b9e 100644 --- a/src/renderer/src/components/settings/BrowserSearchEngineSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserSearchEngineSetting.tsx @@ -1,7 +1,7 @@ -import { Label } from '../ui/label' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SEARCH_ENGINE_LABELS, type SearchEngine } from '../../../../shared/browser-url' -import { SearchableSetting } from './SearchableSetting' +import { Label } from '../../ui/label' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' +import { SEARCH_ENGINE_LABELS, type SearchEngine } from '../../../../../shared/browser-url' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { KagiSessionLinkForm } from './KagiSessionLinkForm' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/BrowserSitePermissionsSetting.test.tsx b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.test.tsx similarity index 93% rename from src/renderer/src/components/settings/BrowserSitePermissionsSetting.test.tsx rename to src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.test.tsx index dfb22d3d8d4..7e785dab943 100644 --- a/src/renderer/src/components/settings/BrowserSitePermissionsSetting.test.tsx +++ b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.test.tsx @@ -3,8 +3,8 @@ import '@testing-library/jest-dom/vitest' import { act, cleanup, fireEvent, render, screen, within } from '@testing-library/react' import { afterEach, expect, it, vi } from 'vitest' -import type { BrowserSitePermissionEntry } from '../../../../shared/browser-site-permission' -import type { BrowserSessionProfile } from '../../../../shared/browser-workspace-types' +import type { BrowserSitePermissionEntry } from '../../../../../shared/browser-site-permission' +import type { BrowserSessionProfile } from '../../../../../shared/browser-workspace-types' const storeState = vi.hoisted(() => { const profile = (id: string, label: string): BrowserSessionProfile => ({ @@ -23,12 +23,12 @@ const storeState = vi.hoisted(() => { } }) -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: (selector: (state: typeof storeState) => unknown) => selector(storeState) })) // Why: Radix Select needs pointer/layout APIs happy-dom lacks; a native select keeps value testable. -vi.mock('../ui/select', () => ({ +vi.mock('../../ui/select', () => ({ Select: ({ value, onValueChange, diff --git a/src/renderer/src/components/settings/BrowserSitePermissionsSetting.tsx b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx similarity index 91% rename from src/renderer/src/components/settings/BrowserSitePermissionsSetting.tsx rename to src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx index 982bd38986f..68733980435 100644 --- a/src/renderer/src/components/settings/BrowserSitePermissionsSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserSitePermissionsSetting.tsx @@ -1,23 +1,23 @@ // @protected-copy: saved site permission choices. import { useEffect, useState } from 'react' -import type { BrowserSessionProfile } from '../../../../shared/browser-workspace-types' +import type { BrowserSessionProfile } from '../../../../../shared/browser-workspace-types' import { BROWSER_SITE_PERMISSIONS, isBrowserSitePermissionDecision, type BrowserSitePermission, type BrowserSitePermissionEntry -} from '../../../../shared/browser-site-permission' -import { Label } from '../ui/label' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' +} from '../../../../../shared/browser-site-permission' +import { Label } from '../../ui/label' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' import { browserSitePermissionLabel, browserSitePermissionSiteName -} from '../browser-pane/browser-site-permission-copy' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow } from './SettingsFormControls' +} from '../../browser-pane/browser-site-permission-copy' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsRow } from '../form-controls/SettingsFormControls' import { getBrowserSitePermissionsSearchEntry } from './browser-site-permissions-search' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import { useAppStore } from '../../store' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { useAppStore } from '../../../store/index' import { translate } from '@/i18n/i18n' function SitePermissionRow({ diff --git a/src/renderer/src/components/settings/BrowserUserAgentSetting.test.tsx b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.test.tsx similarity index 96% rename from src/renderer/src/components/settings/BrowserUserAgentSetting.test.tsx rename to src/renderer/src/components/settings/browser/BrowserUserAgentSetting.test.tsx index 5cea1ed9e60..243184bcc28 100644 --- a/src/renderer/src/components/settings/BrowserUserAgentSetting.test.tsx +++ b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.test.tsx @@ -1,8 +1,9 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' -import { TooltipProvider } from '../ui/tooltip' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' +import { TooltipProvider } from '../../ui/tooltip' import { BrowserUserAgentSetting } from './BrowserUserAgentSetting' const identityGet = vi.fn() diff --git a/src/renderer/src/components/settings/BrowserUserAgentSetting.tsx b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx similarity index 95% rename from src/renderer/src/components/settings/BrowserUserAgentSetting.tsx rename to src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx index c0e3baf0341..7f17d88fdea 100644 --- a/src/renderer/src/components/settings/BrowserUserAgentSetting.tsx +++ b/src/renderer/src/components/settings/browser/BrowserUserAgentSetting.tsx @@ -2,12 +2,12 @@ import { useEffect, useState } from 'react' import type { BrowserIdentityModeStatus, BrowserUserAgentMode -} from '../../../../shared/browser-user-agent-mode' -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +} from '../../../../../shared/browser-user-agent-mode' +import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../../shared/execution-host' import { BROWSER_USER_AGENT_SETTINGS_TARGET_ID } from '@/lib/settings-navigation-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from '../form-controls/SettingsFormControls' type BrowserUserAgentSettingProps = { hostId: ExecutionHostId diff --git a/src/renderer/src/components/settings/KagiSessionLinkForm.test.ts b/src/renderer/src/components/settings/browser/KagiSessionLinkForm.test.ts similarity index 97% rename from src/renderer/src/components/settings/KagiSessionLinkForm.test.ts rename to src/renderer/src/components/settings/browser/KagiSessionLinkForm.test.ts index 4ac0a76d957..9df050eda04 100644 --- a/src/renderer/src/components/settings/KagiSessionLinkForm.test.ts +++ b/src/renderer/src/components/settings/browser/KagiSessionLinkForm.test.ts @@ -35,7 +35,7 @@ const { rejectAppStoreAccess } = vi.hoisted(() => ({ }) })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: Object.assign(rejectAppStoreAccess, { getState: rejectAppStoreAccess, getInitialState: rejectAppStoreAccess, diff --git a/src/renderer/src/components/settings/KagiSessionLinkForm.tsx b/src/renderer/src/components/settings/browser/KagiSessionLinkForm.tsx similarity index 95% rename from src/renderer/src/components/settings/KagiSessionLinkForm.tsx rename to src/renderer/src/components/settings/browser/KagiSessionLinkForm.tsx index 111d272aaff..35290f7049f 100644 --- a/src/renderer/src/components/settings/KagiSessionLinkForm.tsx +++ b/src/renderer/src/components/settings/browser/KagiSessionLinkForm.tsx @@ -1,9 +1,9 @@ import { useState } from 'react' import { toast } from 'sonner' -import { normalizeKagiSessionLink } from '../../../../shared/browser-url' -import { useAppStore } from '../../store' -import { Button } from '../ui/button' -import { Input } from '../ui/input' +import { normalizeKagiSessionLink } from '../../../../../shared/browser-url' +import { useAppStore } from '../../../store/index' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' import { translate } from '@/i18n/i18n' export type KagiSessionLinkDraftState = { diff --git a/src/renderer/src/components/settings/browser-home-page-draft-state.ts b/src/renderer/src/components/settings/browser/browser-home-page-draft-state.ts similarity index 100% rename from src/renderer/src/components/settings/browser-home-page-draft-state.ts rename to src/renderer/src/components/settings/browser/browser-home-page-draft-state.ts diff --git a/src/renderer/src/components/settings/browser-pane-search.ts b/src/renderer/src/components/settings/browser/browser-pane-search.ts similarity index 69% rename from src/renderer/src/components/settings/browser-pane-search.ts rename to src/renderer/src/components/settings/browser/browser-pane-search.ts index 11aa668a3e8..096ecdc0601 100644 --- a/src/renderer/src/components/settings/browser-pane-search.ts +++ b/src/renderer/src/components/settings/browser/browser-pane-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { getBrowserPaneSearchEntries } from './browser-search' -import { getBrowserUsePaneSearchEntries } from './browser-use-search' +import { getBrowserUsePaneSearchEntries } from './use/browser-use-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserPaneCombinedSearchEntries = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/browser-search.ts b/src/renderer/src/components/settings/browser/browser-search.ts similarity index 96% rename from src/renderer/src/components/settings/browser-search.ts rename to src/renderer/src/components/settings/browser/browser-search.ts index e1ffda171ac..4da9c94ad29 100644 --- a/src/renderer/src/components/settings/browser-search.ts +++ b/src/renderer/src/components/settings/browser/browser-search.ts @@ -1,24 +1,24 @@ -import type { SettingsSearchEntry } from './settings-search' -import { isMacUserAgent } from '../terminal-pane/pane-helpers' +import type { SettingsSearchEntry } from '../search/settings-search' +import { isMacUserAgent } from '../../terminal-pane/pane-helpers' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { getBrowserUserAgentSearchEntry } from './browser-user-agent-search' -import { getBrowserProfileScopeSearchEntry } from './browser-profile-scope-search' +import { getBrowserProfileScopeSearchEntry } from './profiles/browser-profile-scope-search' import { getBrowserSitePermissionsSearchEntry } from './browser-site-permissions-search' import { getBrowserLinkRoutingDescription, getLinkRoutingBackgroundSearchEntry, getLinkRoutingModifierDescription, getLinkRoutingModifierTitle -} from './browser-link-routing-copy' +} from './routing/browser-link-routing-copy' import { getBrowserClientHostedRemoteDescription, getBrowserClientHostedRemoteTitle -} from './browser-client-hosted-remote-copy' +} from './routing/browser-client-hosted-remote-copy' import { getBrowserSshWorkspaceRoutingDescription, getBrowserSshWorkspaceRoutingTitle -} from './browser-ssh-workspace-routing-copy' +} from './routing/browser-ssh-workspace-routing-copy' export type BrowserShortcutPlatform = { isMac: boolean diff --git a/src/renderer/src/components/settings/browser-site-permissions-search.ts b/src/renderer/src/components/settings/browser/browser-site-permissions-search.ts similarity index 90% rename from src/renderer/src/components/settings/browser-site-permissions-search.ts rename to src/renderer/src/components/settings/browser/browser-site-permissions-search.ts index 941f3623f08..35e35276528 100644 --- a/src/renderer/src/components/settings/browser-site-permissions-search.ts +++ b/src/renderer/src/components/settings/browser/browser-site-permissions-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserSitePermissionsSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/browser-user-agent-search.ts b/src/renderer/src/components/settings/browser/browser-user-agent-search.ts similarity index 88% rename from src/renderer/src/components/settings/browser-user-agent-search.ts rename to src/renderer/src/components/settings/browser/browser-user-agent-search.ts index 25a56583bc4..484f8c43c62 100644 --- a/src/renderer/src/components/settings/browser-user-agent-search.ts +++ b/src/renderer/src/components/settings/browser/browser-user-agent-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserUserAgentSearchEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ diff --git a/src/renderer/src/components/settings/BrowserExtensionsExperimentalSetting.tsx b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsExperimentalSetting.tsx similarity index 80% rename from src/renderer/src/components/settings/BrowserExtensionsExperimentalSetting.tsx rename to src/renderer/src/components/settings/browser/extensions/BrowserExtensionsExperimentalSetting.tsx index 720135a214d..ed1674b74d9 100644 --- a/src/renderer/src/components/settings/BrowserExtensionsExperimentalSetting.tsx +++ b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsExperimentalSetting.tsx @@ -1,9 +1,9 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' -import { getExperimentalSearchEntry } from './experimental-search' +import { Label } from '../../../ui/label' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSwitch } from '../../form-controls/SettingsFormControls' +import { getExperimentalSearchEntry } from '../../advanced/experimental-search' type BrowserExtensionsExperimentalSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/BrowserExtensionsSection.tsx b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx similarity index 94% rename from src/renderer/src/components/settings/BrowserExtensionsSection.tsx rename to src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx index b5feedfd990..bce3afc2d97 100644 --- a/src/renderer/src/components/settings/BrowserExtensionsSection.tsx +++ b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsSection.tsx @@ -5,16 +5,16 @@ import type { BrowserExtensionActionResult, BrowserExtensionListing, BrowserExtensionListResult -} from '../../../../shared/browser-extension-types' +} from '../../../../../../shared/browser-extension-types' import { translate } from '@/i18n/i18n' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { useConfirmationDialog } from '../confirmation-dialog-context' -import { describeUnsupportedBrowserExtensionFeatures } from '../browser-extension-permission-messages' -import { browserExtensionRemovalDescription } from '../browser-extension-removal-description' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitch } from './SettingsFormControls' +import { Button } from '../../../ui/button' +import { Label } from '../../../ui/label' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' +import { useConfirmationDialog } from '../../../confirmation-dialog-context' +import { describeUnsupportedBrowserExtensionFeatures } from '../../../browser-extension-permission-messages' +import { browserExtensionRemovalDescription } from '../../../browser-extension-removal-description' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSwitch } from '../../form-controls/SettingsFormControls' import { getBrowserExtensionsSearchEntry } from './browser-extensions-search' import { BrowserExtensionsWebStoreInstall } from './BrowserExtensionsWebStoreInstall' diff --git a/src/renderer/src/components/settings/BrowserExtensionsWebStoreInstall.tsx b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsWebStoreInstall.tsx similarity index 92% rename from src/renderer/src/components/settings/BrowserExtensionsWebStoreInstall.tsx rename to src/renderer/src/components/settings/browser/extensions/BrowserExtensionsWebStoreInstall.tsx index dab7edd9eda..8e668da4fa8 100644 --- a/src/renderer/src/components/settings/BrowserExtensionsWebStoreInstall.tsx +++ b/src/renderer/src/components/settings/browser/extensions/BrowserExtensionsWebStoreInstall.tsx @@ -1,11 +1,11 @@ import { useState } from 'react' import { toast } from 'sonner' -import { CHROME_WEB_STORE_HOME_URL } from '../../../../shared/browser-extension-webstore' +import { CHROME_WEB_STORE_HOME_URL } from '../../../../../../shared/browser-extension-webstore' import { translate } from '@/i18n/i18n' -import { useAppStore } from '@/store' -import { LoadingSpinner } from '../LoadingSpinner' -import { Button } from '../ui/button' -import { Input } from '../ui/input' +import { useAppStore } from '@/store/index' +import { LoadingSpinner } from '../../../LoadingSpinner' +import { Button } from '../../../ui/button' +import { Input } from '../../../ui/input' type BrowserExtensionsWebStoreInstallProps = { profileId: string diff --git a/src/renderer/src/components/settings/browser-extensions-experimental-search.ts b/src/renderer/src/components/settings/browser/extensions/browser-extensions-experimental-search.ts similarity index 88% rename from src/renderer/src/components/settings/browser-extensions-experimental-search.ts rename to src/renderer/src/components/settings/browser/extensions/browser-extensions-experimental-search.ts index 3f6e1925679..c7a0c67ee76 100644 --- a/src/renderer/src/components/settings/browser-extensions-experimental-search.ts +++ b/src/renderer/src/components/settings/browser/extensions/browser-extensions-experimental-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserExtensionsExperimentalSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/browser-extensions-search.ts b/src/renderer/src/components/settings/browser/extensions/browser-extensions-search.ts similarity index 87% rename from src/renderer/src/components/settings/browser-extensions-search.ts rename to src/renderer/src/components/settings/browser/extensions/browser-extensions-search.ts index 2bc04f8bb56..bbdf4db9a06 100644 --- a/src/renderer/src/components/settings/browser-extensions-search.ts +++ b/src/renderer/src/components/settings/browser/extensions/browser-extensions-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' // Why not in getBrowserPaneSearchEntries: that catalog is static, and this section exists only diff --git a/src/renderer/src/components/settings/BrowserNewProfileDialog.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserNewProfileDialog.tsx similarity index 94% rename from src/renderer/src/components/settings/BrowserNewProfileDialog.tsx rename to src/renderer/src/components/settings/browser/profiles/BrowserNewProfileDialog.tsx index 341f9e8ec50..4cdaeb85582 100644 --- a/src/renderer/src/components/settings/BrowserNewProfileDialog.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserNewProfileDialog.tsx @@ -1,9 +1,9 @@ import { useState } from 'react' import { toast } from 'sonner' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../ui/dialog' -import { useAppStore } from '../../store' +import { Button } from '../../../ui/button' +import { Input } from '../../../ui/input' +import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../../../ui/dialog' +import { useAppStore } from '../../../../store/index' import { useMountedRef } from '@/hooks/useMountedRef' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.google-cookie-clear.test.tsx similarity index 96% rename from src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx rename to src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.google-cookie-clear.test.tsx index d51537f79d9..02f9743a4e9 100644 --- a/src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.google-cookie-clear.test.tsx @@ -1,15 +1,16 @@ import { publicRuntimeEnvironment } from '@/runtime/paired-runtime-environment-test-fixture' // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { Profiler, StrictMode, type ReactNode } from 'react' import { useStore } from 'zustand' -import { ConfirmationDialogContext } from '../confirmation-dialog-context' +import { ConfirmationDialogContext } from '../../../confirmation-dialog-context' import { createTestStore, createBrowserMockApi } from '@/store/slices/browser-slice-test-harness' import { getDefaultBrowserProfileForHost } from '@/store/slices/browser/browser-host-state' import type { AppState } from '@/store/types' import { createCompatibleRuntimeStatusResponse } from '@/runtime/runtime-compatibility-test-fixture' -import type { GoogleCookieClearLocalTarget } from '../../../../shared/browser-google-cookie-clear' +import type { GoogleCookieClearLocalTarget } from '../../../../../../shared/browser-google-cookie-clear' import { i18n } from '@/i18n/i18n' let store: ReturnType @@ -20,7 +21,7 @@ const mocks = vi.hoisted(() => ({ clear: vi.fn(), fromPartition: vi.fn() })) -vi.mock('@/store', async () => { +vi.mock('@/store/index', async () => { const { useStore } = await import('zustand') return { useAppStore: Object.assign( @@ -32,18 +33,18 @@ vi.mock('@/store', async () => { vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: mocks.error, warning: vi.fn() } })) -vi.mock('../BrowserCookieImportMachineNotice', () => ({ +vi.mock('../../../BrowserCookieImportMachineNotice', () => ({ BrowserCookieImportMachineNotice: () => null })) -vi.mock('../../../../main/browser/browser-manager', () => ({ browserManager: {} })) -vi.mock('../../../../main/browser/browser-session-registry', () => ({ +vi.mock('../../../../../../main/browser/browser-manager', () => ({ browserManager: {} })) +vi.mock('../../../../../../main/browser/browser-session-registry', () => ({ browserSessionRegistry: { getProfile: () => profile, listProfiles: () => [profile], updateProfileSource: vi.fn() } })) -vi.mock('../../../../main/browser/cookies/browser-cookie-import', () => ({ +vi.mock('../../../../../../main/browser/cookies/browser-cookie-import', () => ({ detectInstalledBrowsers: () => [browser], importCookiesFromBrowser: vi.fn(), selectBrowserProfile: vi.fn() @@ -52,7 +53,7 @@ vi.mock('electron', () => ({ ipcMain: {}, session: { fromPartition: mocks.fromPartition } })) -import type { RuntimeRpcResponse } from '../../../../shared/runtime-rpc-envelope' +import type { RuntimeRpcResponse } from '../../../../../../shared/runtime-rpc-envelope' type ProfileDispatcher = { dispatch(request: { @@ -64,7 +65,7 @@ type ProfileDispatcher = { } const { browserProfileRpcFixture } = await vi.importActual<{ browserProfileRpcFixture(executorRuntimeId: string): { dispatcher: ProfileDispatcher } -}>('../../../../main/runtime/browser/browser-profile-rpc-test-fixture') +}>('../../../../../../main/runtime/browser/browser-profile-rpc-test-fixture') import { BrowserSessionCookiesSection } from './BrowserSessionCookiesSection' import { replaceRuntimeEnvironmentRevisions } from '@/runtime/runtime-environment-revision' diff --git a/src/renderer/src/components/settings/BrowserProfileRow.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx similarity index 95% rename from src/renderer/src/components/settings/BrowserProfileRow.tsx rename to src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx index 26d5950560f..a058213bf73 100644 --- a/src/renderer/src/components/settings/BrowserProfileRow.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserProfileRow.tsx @@ -4,8 +4,8 @@ import { emitBrowserCookieImportToast } from '@/lib/browser-cookie-import-toast' import type { BrowserCookieImportSummary, BrowserSessionProfile -} from '../../../../shared/browser-workspace-types' -import { Button } from '../ui/button' +} from '../../../../../../shared/browser-workspace-types' +import { Button } from '../../../ui/button' import { DropdownMenu, DropdownMenuContent, @@ -16,11 +16,11 @@ import { DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger -} from '../ui/dropdown-menu' -import { BrowserCookieImportDisclosure } from '../BrowserCookieImportDisclosure' -import { BrowserCookieImportMachineNotice } from '../BrowserCookieImportMachineNotice' -import { useAppStore } from '../../store' -import { BROWSER_FAMILY_LABELS } from '../../../../shared/constants' +} from '../../../ui/dropdown-menu' +import { BrowserCookieImportDisclosure } from '../../../BrowserCookieImportDisclosure' +import { BrowserCookieImportMachineNotice } from '../../../BrowserCookieImportMachineNotice' +import { useAppStore } from '../../../../store/index' +import { BROWSER_FAMILY_LABELS } from '../../../../../../shared/constants' import { translate } from '@/i18n/i18n' import { browserCookieImportFailureText } from '@/lib/browser-cookie-import-error-copy' diff --git a/src/renderer/src/components/settings/BrowserProfileScopeSetting.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx similarity index 89% rename from src/renderer/src/components/settings/BrowserProfileScopeSetting.tsx rename to src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx index 151f2156642..5665306a292 100644 --- a/src/renderer/src/components/settings/BrowserProfileScopeSetting.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserProfileScopeSetting.tsx @@ -1,7 +1,7 @@ import { translate } from '@/i18n/i18n' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { getBrowserProfileScopeSearchEntry } from './browser-profile-scope-search' type BrowserProfileScopeSettingProps = { diff --git a/src/renderer/src/components/settings/BrowserSessionCookiesSection.tsx b/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx similarity index 92% rename from src/renderer/src/components/settings/BrowserSessionCookiesSection.tsx rename to src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx index 53b4e7b52f4..a131d2caa86 100644 --- a/src/renderer/src/components/settings/BrowserSessionCookiesSection.tsx +++ b/src/renderer/src/components/settings/browser/profiles/BrowserSessionCookiesSection.tsx @@ -1,14 +1,14 @@ -import { useGoogleCookieClear } from '../use-google-cookie-clear' +import { useGoogleCookieClear } from '../../../use-google-cookie-clear' import { Plus } from 'lucide-react' -import type { BrowserSessionProfile } from '../../../../shared/browser-workspace-types' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' +import type { BrowserSessionProfile } from '../../../../../../shared/browser-workspace-types' +import { Button } from '../../../ui/button' +import { Label } from '../../../ui/label' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { BrowserProfileRow, type BrowserProfileRowProps } from './BrowserProfileRow' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { ExecutionHostId } from '../../../../../../shared/execution-host' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' type BrowserSessionHostOption = { id: ExecutionHostId diff --git a/src/renderer/src/components/settings/browser-profile-scope-search.ts b/src/renderer/src/components/settings/browser/profiles/browser-profile-scope-search.ts similarity index 89% rename from src/renderer/src/components/settings/browser-profile-scope-search.ts rename to src/renderer/src/components/settings/browser/profiles/browser-profile-scope-search.ts index f55e37583d5..7424bd7a617 100644 --- a/src/renderer/src/components/settings/browser-profile-scope-search.ts +++ b/src/renderer/src/components/settings/browser/profiles/browser-profile-scope-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserProfileScopeSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/browser-session-host-selection.test.ts b/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts similarity index 100% rename from src/renderer/src/components/settings/browser-session-host-selection.test.ts rename to src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.test.ts diff --git a/src/renderer/src/components/settings/browser-session-host-selection.ts b/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts similarity index 81% rename from src/renderer/src/components/settings/browser-session-host-selection.ts rename to src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts index a24e114e984..ee50fcec852 100644 --- a/src/renderer/src/components/settings/browser-session-host-selection.ts +++ b/src/renderer/src/components/settings/browser/profiles/browser-session-host-selection.ts @@ -1,4 +1,7 @@ -import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../../../../shared/execution-host' +import { + LOCAL_EXECUTION_HOST_ID, + type ExecutionHostId +} from '../../../../../../shared/execution-host' export function resolveAvailableBrowserSessionHostId( options: readonly { id: ExecutionHostId }[], diff --git a/src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.test.tsx b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.test.tsx similarity index 88% rename from src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.test.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.test.tsx index 973eec70c03..627c9546210 100644 --- a/src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.test.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.test.tsx @@ -1,14 +1,15 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { TooltipProvider } from '../ui/tooltip' +import { TooltipProvider } from '../../../ui/tooltip' import { BrowserClientHostedRemoteSetting } from './BrowserClientHostedRemoteSetting' -import { getBrowserPaneSearchEntries } from './browser-search' -import { matchesSettingsSearch } from './settings-search' +import { getBrowserPaneSearchEntries } from '../browser-search' +import { matchesSettingsSearch } from '../../search/settings-search' import { getBrowserClientHostedRemoteTitle } from './browser-client-hosted-remote-copy' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' -vi.mock('../../store', () => ({ +vi.mock('../../../../store/index', () => ({ useAppStore: (selector: (state: { settingsSearchQuery: string }) => unknown) => selector({ settingsSearchQuery: '' }) })) diff --git a/src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx index a5541435259..11638cdb3f0 100644 --- a/src/renderer/src/components/settings/BrowserClientHostedRemoteSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserClientHostedRemoteSetting.tsx @@ -1,8 +1,8 @@ import { translate } from '@/i18n/i18n' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { BROWSER_CLIENT_HOSTED_REMOTE_SETTINGS_TARGET_ID } from '@/lib/settings-navigation-types' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { getBrowserClientHostedRemoteDescription, getBrowserClientHostedRemoteTitle diff --git a/src/renderer/src/components/settings/BrowserLinkRoutingBackgroundSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx similarity index 81% rename from src/renderer/src/components/settings/BrowserLinkRoutingBackgroundSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx index 3dc320878fc..28149bafc1f 100644 --- a/src/renderer/src/components/settings/BrowserLinkRoutingBackgroundSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingBackgroundSetting.tsx @@ -1,6 +1,6 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { getLinkRoutingBackgroundSearchEntry } from './browser-link-routing-copy' type BrowserLinkRoutingBackgroundSettingProps = { diff --git a/src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx similarity index 85% rename from src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx index 03f72e66d32..9749fdd6be6 100644 --- a/src/renderer/src/components/settings/BrowserLinkRoutingModifierSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingModifierSetting.tsx @@ -1,6 +1,6 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' import { getLinkRoutingModifierDescription, getLinkRoutingModifierTitle diff --git a/src/renderer/src/components/settings/BrowserLinkRoutingSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx similarity index 85% rename from src/renderer/src/components/settings/BrowserLinkRoutingSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx index 7ec1bc47ff3..2446cdc13cd 100644 --- a/src/renderer/src/components/settings/BrowserLinkRoutingSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLinkRoutingSetting.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { Label } from '../../../ui/label' +import { Switch } from '../../../ui/switch' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' type BrowserLinkRoutingSettingProps = { diff --git a/src/renderer/src/components/settings/BrowserLocalhostWorktreeLabelsSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx similarity index 84% rename from src/renderer/src/components/settings/BrowserLocalhostWorktreeLabelsSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx index fb18663e497..d32a32c60b0 100644 --- a/src/renderer/src/components/settings/BrowserLocalhostWorktreeLabelsSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserLocalhostWorktreeLabelsSetting.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../../form-controls/SettingsFormControls' type BrowserLocalhostWorktreeLabelsSettingProps = { settings: Pick diff --git a/src/renderer/src/components/settings/BrowserSshWorkspaceRoutingSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx similarity index 92% rename from src/renderer/src/components/settings/BrowserSshWorkspaceRoutingSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx index 164a6075dab..fedd2161744 100644 --- a/src/renderer/src/components/settings/BrowserSshWorkspaceRoutingSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserSshWorkspaceRoutingSetting.tsx @@ -1,10 +1,10 @@ import { translate } from '@/i18n/i18n' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { Button } from '@/components/ui/button' import { BROWSER_SSH_WORKSPACE_ROUTING_SETTINGS_TARGET_ID } from '@/lib/settings-navigation-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { getBrowserSshWorkspaceRoutingDescription, getBrowserSshWorkspaceRoutingTitle diff --git a/src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.tsx b/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx similarity index 93% rename from src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.tsx rename to src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx index b3e0c62879b..d639f2eab35 100644 --- a/src/renderer/src/components/settings/BrowserTerminalLinkActionsSetting.tsx +++ b/src/renderer/src/components/settings/browser/routing/BrowserTerminalLinkActionsSetting.tsx @@ -1,17 +1,17 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' import { BROWSER_TERMINAL_LINK_ACTIONS_SETTINGS_TARGET_ID } from '@/lib/settings-navigation-types' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader -} from './SettingsFormControls' -import { getTerminalLinkActionSearchKeywords } from './browser-search' +} from '../../form-controls/SettingsFormControls' +import { getTerminalLinkActionSearchKeywords } from '../browser-search' import { terminalLinkClickBehaviorFor, type TerminalLinkClickBehavior -} from '../terminal-pane/terminal-link-click-behavior' +} from '../../../terminal-pane/terminal-link-click-behavior' type BrowserTerminalLinkActionsSettingProps = { settings: Pick< diff --git a/src/renderer/src/components/settings/browser-client-hosted-remote-copy.ts b/src/renderer/src/components/settings/browser/routing/browser-client-hosted-remote-copy.ts similarity index 100% rename from src/renderer/src/components/settings/browser-client-hosted-remote-copy.ts rename to src/renderer/src/components/settings/browser/routing/browser-client-hosted-remote-copy.ts diff --git a/src/renderer/src/components/settings/browser-link-routing-copy.ts b/src/renderer/src/components/settings/browser/routing/browser-link-routing-copy.ts similarity index 95% rename from src/renderer/src/components/settings/browser-link-routing-copy.ts rename to src/renderer/src/components/settings/browser/routing/browser-link-routing-copy.ts index 7c2122dfa7c..8958645e426 100644 --- a/src/renderer/src/components/settings/browser-link-routing-copy.ts +++ b/src/renderer/src/components/settings/browser/routing/browser-link-routing-copy.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' -import type { SettingsSearchEntry } from './settings-search' -import { translateSearchKeyword } from './settings-search-keywords' +import type { SettingsSearchEntry } from '../../search/settings-search' +import { translateSearchKeyword } from '../../search/settings-search-keywords' export function getBrowserLinkRoutingShortcutLabel(platform: { isMac: boolean }): string { return platform.isMac ? '⇧⌘-click' : 'Shift+Ctrl+click' diff --git a/src/renderer/src/components/settings/browser-ssh-workspace-routing-copy.ts b/src/renderer/src/components/settings/browser/routing/browser-ssh-workspace-routing-copy.ts similarity index 100% rename from src/renderer/src/components/settings/browser-ssh-workspace-routing-copy.ts rename to src/renderer/src/components/settings/browser/routing/browser-ssh-workspace-routing-copy.ts diff --git a/src/renderer/src/components/settings/BrowserUseComputerUseNotice.tsx b/src/renderer/src/components/settings/browser/use/BrowserUseComputerUseNotice.tsx similarity index 97% rename from src/renderer/src/components/settings/BrowserUseComputerUseNotice.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUseComputerUseNotice.tsx index c498caf9fef..f0953270ff7 100644 --- a/src/renderer/src/components/settings/BrowserUseComputerUseNotice.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUseComputerUseNotice.tsx @@ -1,5 +1,5 @@ import { MousePointerClick } from 'lucide-react' -import { Button } from '../ui/button' +import { Button } from '../../../ui/button' import { translate } from '@/i18n/i18n' export function BrowserUseComputerUseNotice({ diff --git a/src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx b/src/renderer/src/components/settings/browser/use/BrowserUseCookieImportStep.tsx similarity index 94% rename from src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUseCookieImportStep.tsx index 7618d9a3be1..ed55fdd416f 100644 --- a/src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUseCookieImportStep.tsx @@ -1,9 +1,9 @@ import { Import, Loader2 } from 'lucide-react' import { toast } from 'sonner' import { emitBrowserCookieImportToast } from '@/lib/browser-cookie-import-toast' -import { Button } from '../ui/button' -import { BrowserCookieImportDisclosure } from '../BrowserCookieImportDisclosure' -import { BrowserCookieImportMachineNotice } from '../BrowserCookieImportMachineNotice' +import { Button } from '../../../ui/button' +import { BrowserCookieImportDisclosure } from '../../../BrowserCookieImportDisclosure' +import { BrowserCookieImportMachineNotice } from '../../../BrowserCookieImportMachineNotice' import { DropdownMenu, DropdownMenuContent, @@ -14,10 +14,10 @@ import { DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger -} from '../ui/dropdown-menu' -import { useAppStore } from '../../store' -import { SearchableSetting } from './SearchableSetting' -import { StepBadge } from './SetupStepBadge' +} from '../../../ui/dropdown-menu' +import { useAppStore } from '../../../../store/index' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { StepBadge } from '../../setup-guide/SetupStepBadge' import { getBrowserUsePaneSearchEntries } from './browser-use-search' import { translate } from '@/i18n/i18n' import { browserCookieImportFailureText } from '@/lib/browser-cookie-import-error-copy' diff --git a/src/renderer/src/components/settings/BrowserUseEnableSwitch.tsx b/src/renderer/src/components/settings/browser/use/BrowserUseEnableSwitch.tsx similarity index 100% rename from src/renderer/src/components/settings/BrowserUseEnableSwitch.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUseEnableSwitch.tsx diff --git a/src/renderer/src/components/settings/BrowserUseExamples.tsx b/src/renderer/src/components/settings/browser/use/BrowserUseExamples.tsx similarity index 97% rename from src/renderer/src/components/settings/BrowserUseExamples.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUseExamples.tsx index 1bcbad97a28..47446fec5fc 100644 --- a/src/renderer/src/components/settings/BrowserUseExamples.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUseExamples.tsx @@ -1,7 +1,7 @@ import { Copy, Sparkles } from 'lucide-react' import { toast } from 'sonner' -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' const EXAMPLE_PROMPTS: string[] = [ diff --git a/src/renderer/src/components/settings/BrowserUsePane.tsx b/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx similarity index 96% rename from src/renderer/src/components/settings/BrowserUsePane.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx index b7a57a5e475..6aff186bb87 100644 --- a/src/renderer/src/components/settings/BrowserUsePane.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUsePane.tsx @@ -7,10 +7,10 @@ import { } from '@/hooks/useInstalledAgentSkills' import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime' import { cn } from '@/lib/utils' -import { useAppStore } from '../../store' -import { BROWSER_FAMILY_LABELS } from '../../../../shared/constants' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' +import { useAppStore } from '../../../../store/index' +import { BROWSER_FAMILY_LABELS } from '../../../../../../shared/constants' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { matchesSettingsSearch } from '../../search/settings-search' import { getBrowserUsePaneSearchEntries } from './browser-use-search' import { BrowserUseExamples } from './BrowserUseExamples' import { BrowserUseComputerUseNotice } from './BrowserUseComputerUseNotice' diff --git a/src/renderer/src/components/settings/BrowserUseSkillStep.tsx b/src/renderer/src/components/settings/browser/use/BrowserUseSkillStep.tsx similarity index 90% rename from src/renderer/src/components/settings/BrowserUseSkillStep.tsx rename to src/renderer/src/components/settings/browser/use/BrowserUseSkillStep.tsx index 4cfd2c61275..2336ac308db 100644 --- a/src/renderer/src/components/settings/BrowserUseSkillStep.tsx +++ b/src/renderer/src/components/settings/browser/use/BrowserUseSkillStep.tsx @@ -1,6 +1,6 @@ import { ORCA_CLI_SKILL_NAME } from '@/lib/agent-feature-skill-names' -import { AgentSkillSetupPanel } from './AgentSkillSetupPanel' -import { StepBadge } from './SetupStepBadge' +import { AgentSkillSetupPanel } from '../../AgentSkillSetupPanel' +import { StepBadge } from '../../setup-guide/SetupStepBadge' import { translate } from '@/i18n/i18n' type Props = { diff --git a/src/renderer/src/components/settings/browser-use-search.ts b/src/renderer/src/components/settings/browser/use/browser-use-search.ts similarity index 97% rename from src/renderer/src/components/settings/browser-use-search.ts rename to src/renderer/src/components/settings/browser/use/browser-use-search.ts index 411b82b9eb2..e1a4b3294ac 100644 --- a/src/renderer/src/components/settings/browser-use-search.ts +++ b/src/renderer/src/components/settings/browser/use/browser-use-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getBrowserUsePaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/ChatAgentLaunchSettings.tsx b/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx similarity index 84% rename from src/renderer/src/components/settings/ChatAgentLaunchSettings.tsx rename to src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx index da52928e3a6..86ef5df6934 100644 --- a/src/renderer/src/components/settings/ChatAgentLaunchSettings.tsx +++ b/src/renderer/src/components/settings/chat/ChatAgentLaunchSettings.tsx @@ -1,16 +1,16 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { useEffect } from 'react' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' import { AgentIcon, getAgentCatalog } from '@/lib/agent-catalog' import { chatProviderAgents, useHostStructuredAgentsVersion } from '@/lib/chat-provider-agents' import { readChatProgram, resolveChatProgramContext } from '@/lib/host-chat-program' import { useChatProgramFacts } from '@/lib/host-chat-program-acquisition' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { readNativeDetectedAgents } from '@/store/slices/local-detected-agent-store-state' -import { Card, CardContent } from '../ui/card' -import { AgentOpensAsControl } from './AgentChatChoiceControls' -import { buildAgentOpensAs } from './native-chat-provider-choice' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { Card, CardContent } from '../../ui/card' +import { AgentOpensAsControl } from '../AgentChatChoiceControls' +import { buildAgentOpensAs } from '../native-chat-provider-choice' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' import { getChatLaunchEntriesByKey } from './chat-launch-search' const WORKSPACE = { kind: 'floating' } as const diff --git a/src/renderer/src/components/settings/ChatBehaviorSetting.test.tsx b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.test.tsx similarity index 95% rename from src/renderer/src/components/settings/ChatBehaviorSetting.test.tsx rename to src/renderer/src/components/settings/chat/ChatBehaviorSetting.test.tsx index 7ea4ead7053..df91a211b0f 100644 --- a/src/renderer/src/components/settings/ChatBehaviorSetting.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.test.tsx @@ -1,17 +1,18 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, fireEvent, render } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-create-capabilities' -import { AGENT_SESSION_QUEUED_MESSAGES_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-runtime-capabilities' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/agent-session-create-capabilities' +import { AGENT_SESSION_QUEUED_MESSAGES_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/agent-session-runtime-capabilities' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { ChatBehaviorSetting } from './ChatBehaviorSetting' import { i18n } from '@/i18n/i18n' -import de from '../../i18n/locales/de.json' -import { TooltipProvider } from '../ui/tooltip' +import de from '../../../i18n/locales/de.json' +import { TooltipProvider } from '../../ui/tooltip' afterEach(() => { cleanup() diff --git a/src/renderer/src/components/settings/ChatBehaviorSetting.tsx b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/ChatBehaviorSetting.tsx rename to src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx index 515db8e58c5..1c211808c0a 100644 --- a/src/renderer/src/components/settings/ChatBehaviorSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatBehaviorSetting.tsx @@ -1,22 +1,22 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import type { RuntimeClientTarget } from '../../../../shared/runtime-client-target' -import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-create-capabilities' +import type { RuntimeClientTarget } from '../../../../../shared/runtime-client-target' +import { AGENT_SESSION_USAGE_LIMIT_AUTO_CONTINUE_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/agent-session-create-capabilities' import { useChatSettingsOwnPermissions, useStructuredAgentSessionHostCapabilityState, useStructuredAgentSessionHostQueuesMessages } from '@/runtime/structured-agent-session-host-capability' -import { useAppStore } from '../../store' -import { Card, CardContent } from '../ui/card' +import { useAppStore } from '../../../store/index' +import { Card, CardContent } from '../../ui/card' import { ChatPermissionSetting } from './ChatPermissionSetting' import { NativeChatShellEnvironmentSetting } from './NativeChatShellEnvironmentSetting' -import { SearchableSetting } from './SearchableSetting' -import { nativeChatQueueFollowUps } from '../../../../shared/native-chat/input/native-chat-follow-up-behavior' -import { SettingsSubsectionHeader, SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { nativeChatQueueFollowUps } from '../../../../../shared/native-chat/input/native-chat-follow-up-behavior' +import { SettingsSubsectionHeader, SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { getChatBehaviorEntriesByKey, getChatBehaviorTitle } from './chat-behavior-search' import { getChatPermissionSearchEntry } from './chat-permission-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from '../search/settings-search' // Edit this machine’s runtime; older paired hosts ignore queueing and send follow-ups immediately. const STRUCTURED_CHAT_HOST: RuntimeClientTarget = { kind: 'local' } diff --git a/src/renderer/src/components/settings/ChatNamingSetting.test.tsx b/src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx similarity index 97% rename from src/renderer/src/components/settings/ChatNamingSetting.test.tsx rename to src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx index 42f61221349..983e13d7541 100644 --- a/src/renderer/src/components/settings/ChatNamingSetting.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatNamingSetting.test.tsx @@ -1,20 +1,21 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { SourceControlAiSettingsPatch } from '../../../../shared/source-control-ai-types' -import { normalizeSourceControlAiSettings } from '../../../../shared/source-control-ai' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control-ai-types' +import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control-ai' import { ChatNamingSetting } from './ChatNamingSetting' import { savedChatNamingCatalog, observeChatNamingCatalogWork -} from '../../../../shared/chat-naming-catalog-work.test-fixture' +} from '../../../../../shared/chat-naming-catalog-work.test-fixture' import { toast } from 'sonner' import { startTransition, StrictMode, Suspense } from 'react' const state = vi.hoisted(() => ({ settingsSearchQuery: '' })) -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: (selector: (value: typeof state) => unknown) => selector(state) })) vi.mock('sonner', () => ({ toast: { error: vi.fn() } })) diff --git a/src/renderer/src/components/settings/ChatNamingSetting.tsx b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/ChatNamingSetting.tsx rename to src/renderer/src/components/settings/chat/ChatNamingSetting.tsx index 501e7fc7580..d9fa3645594 100644 --- a/src/renderer/src/components/settings/ChatNamingSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatNamingSetting.tsx @@ -1,28 +1,28 @@ import { useCallback, useLayoutEffect, useRef, useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { SourceControlAiSettingsPatch } from '../../../../shared/source-control-ai-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control-ai-types' import { normalizeSourceControlAiSettings, resolveSourceControlAiForOperation -} from '../../../../shared/source-control-ai' +} from '../../../../../shared/source-control-ai' import { DEFAULT_SOURCE_CONTROL_ACTION_COMMAND_TEMPLATES, setSourceControlActionDefault -} from '../../../../shared/source-control-ai-actions' -import { CUSTOM_AGENT_ID } from '../../../../shared/commit-message-agent-spec' -import { isTuiAgent } from '../../../../shared/tui-agent-config' +} from '../../../../../shared/source-control-ai-actions' +import { CUSTOM_AGENT_ID } from '../../../../../shared/commit-message-agent-spec' +import { isTuiAgent } from '../../../../../shared/tui-agent-config' import { getAgentLabel } from '@/lib/agent-catalog' import { translate } from '@/i18n/i18n' -import { Switch } from '../ui/switch' -import { Card, CardContent } from '../ui/card' -import { SourceControlActionRecipeRow } from './SourceControlActionRecipeRow' -import { CustomAgentCommandField } from './CustomAgentCommandField' -import { SettingsSubsectionHeader } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +import { Switch } from '../../ui/switch' +import { Card, CardContent } from '../../ui/card' +import { SourceControlActionRecipeRow } from '../SourceControlActionRecipeRow' +import { CustomAgentCommandField } from '../CustomAgentCommandField' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { getChatNamingSearchEntry } from './chat-naming-search' -import type { ActionRecipeDraftValue } from './source-control-ai-action-recipe-draft' -import { AppearanceAdvancedDisclosure } from './AppearanceAdvancedDisclosure' +import type { ActionRecipeDraftValue } from '../source-control-ai-action-recipe-draft' +import { AppearanceAdvancedDisclosure } from '../appearance/AppearanceAdvancedDisclosure' type ChatNamingSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/ChatPermissionSetting.test.tsx b/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx similarity index 91% rename from src/renderer/src/components/settings/ChatPermissionSetting.test.tsx rename to src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx index bdac24c4807..c125ee33d12 100644 --- a/src/renderer/src/components/settings/ChatPermissionSetting.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatPermissionSetting.test.tsx @@ -1,9 +1,10 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, render, screen, waitFor, within } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { ChatPermissionSetting } from './ChatPermissionSetting' -import { TooltipProvider } from '../ui/tooltip' +import { TooltipProvider } from '../../ui/tooltip' const mocks = vi.hoisted(() => ({ web: false, @@ -27,7 +28,7 @@ vi.mock('@/runtime/runtime-host-contact-regained', () => ({ return () => mocks.contacts.delete(listener) } })) -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: ( selector: (value: { settingsSearchQuery: string @@ -35,8 +36,8 @@ vi.mock('../../store', () => ({ }) => unknown ) => selector({ settingsSearchQuery: '', runtimeEnvironments: mocks.environments }) })) -import { mutateHostAgentLaunchSettings } from './agent-launch-settings-transport' -import { projectAgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import { mutateHostAgentLaunchSettings } from '../agent-launch-settings-transport' +import { projectAgentLaunchSettings } from '../../../../../shared/agent-launch-settings' beforeEach(() => { mocks.web = false mocks.capability = 'unsupported' diff --git a/src/renderer/src/components/settings/ChatPermissionSetting.tsx b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx similarity index 76% rename from src/renderer/src/components/settings/ChatPermissionSetting.tsx rename to src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx index 8ad6e32fc97..b5cc56abcc1 100644 --- a/src/renderer/src/components/settings/ChatPermissionSetting.tsx +++ b/src/renderer/src/components/settings/chat/ChatPermissionSetting.tsx @@ -1,18 +1,18 @@ import { useChatPermissionSettings } from './use-chat-permission-settings' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { AGENT_CHAT_PERMISSION_MODES, - agentChatPermissionModes, newChatPermissionModeForSettings -} from '../../../../shared/agent-chat-permission-mode' -import { TUI_AGENT_DISPLAY_NAMES } from '../../../../shared/tui-agent-display-names' -import { PERMISSION_CHOICE_AGENTS } from '../../../../shared/tui-agent-permission-choice' -import { useAppStore } from '@/store' -import { Button } from '../ui/button' -import { NativeChatPermissionModePicker } from '../native-chat/NativeChatPermissionModePicker' -import { nativeChatPermissionModeLabel } from '../native-chat/native-chat-permission-mode-labels' -import { SettingsRow } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../../../../shared/agent-chat-permission-mode' +import { agentChatPermissionModes } from '../../../../../shared/agent-chat-permission-support' +import { TUI_AGENT_DISPLAY_NAMES } from '../../../../../shared/tui-agent-display-names' +import { PERMISSION_CHOICE_AGENTS } from '../../../../../shared/tui-agent-permission-choice' +import { useAppStore } from '@/store/index' +import { Button } from '../../ui/button' +import { NativeChatPermissionModePicker } from '../../native-chat/NativeChatPermissionModePicker' +import { nativeChatPermissionModeLabel } from '../../native-chat/native-chat-permission-mode-labels' +import { SettingsRow } from '../form-controls/SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { getChatPermissionSearchEntry } from './chat-permission-search' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/ChatSettingsSection.fixture.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.fixture.tsx similarity index 79% rename from src/renderer/src/components/settings/ChatSettingsSection.fixture.tsx rename to src/renderer/src/components/settings/chat/ChatSettingsSection.fixture.tsx index f4497b30715..32f943075d1 100644 --- a/src/renderer/src/components/settings/ChatSettingsSection.fixture.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.fixture.tsx @@ -1,7 +1,7 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { useAppStore } from '@/store' +import { defineFixture } from '../../../component-fixtures/component-fixture' +import { useAppStore } from '@/store/index' import { ChatSettingsSection } from './ChatSettingsSection' -import { ActiveSettingsSectionProvider } from './SettingsSection' +import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' function ChatSettingsPreview(): React.JSX.Element | null { const settings = useAppStore((state) => state.settings) diff --git a/src/renderer/src/components/settings/ChatSettingsSection.navigation.test.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.navigation.test.tsx similarity index 87% rename from src/renderer/src/components/settings/ChatSettingsSection.navigation.test.tsx rename to src/renderer/src/components/settings/chat/ChatSettingsSection.navigation.test.tsx index ca095d79fb3..35a47c2dc43 100644 --- a/src/renderer/src/components/settings/ChatSettingsSection.navigation.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.navigation.test.tsx @@ -1,21 +1,22 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { useRef, useState } from 'react' import { cleanup, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { buildSettingsNavigationMetadata } from '@/hooks/useSettingsNavigationMetadata' import { ChatSettingsSection } from './ChatSettingsSection' -import { TooltipProvider } from '../ui/tooltip' -import { ActiveSettingsSectionProvider } from './SettingsSection' -import { getChatAppearanceSearchEntries } from './chat-appearance-search' +import { TooltipProvider } from '../../ui/tooltip' +import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' +import { getChatAppearanceSearchEntries } from '../appearance/chat/chat-appearance-search' import { getChatNamingSearchEntry } from './chat-naming-search' import { getChatInlineVisualsSearchEntry } from './chat-inline-visuals-search' -import { useSettingsRepoScrollEffects } from './use-settings-repo-scroll-effects' -import type { SettingsStoreModel } from './use-settings-store-model' -import type { SettingsInteractionController } from './use-settings-interaction-controller' -import type { SettingsNavigationModel } from './use-settings-navigation-model' -import type { SettingsTerminalModel } from './use-settings-terminal-model' -import { useAppStore } from '@/store' +import { useSettingsRepoScrollEffects } from '../navigation/use-settings-repo-scroll-effects' +import type { SettingsStoreModel } from '../page/use-settings-store-model' +import type { SettingsInteractionController } from '../page/use-settings-interaction-controller' +import type { SettingsNavigationModel } from '../navigation/use-settings-navigation-model' +import type { SettingsTerminalModel } from '../page/use-settings-terminal-model' +import { useAppStore } from '@/store/index' vi.mock('@/lib/host-chat-program-acquisition', () => ({ useChatProgramFacts: () => {} })) beforeEach(() => { diff --git a/src/renderer/src/components/settings/ChatSettingsSection.test.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx similarity index 93% rename from src/renderer/src/components/settings/ChatSettingsSection.test.tsx rename to src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx index f03f1ee1319..79694552a7b 100644 --- a/src/renderer/src/components/settings/ChatSettingsSection.test.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.test.tsx @@ -1,25 +1,29 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { ChatSettingsSection } from './ChatSettingsSection' -import { TooltipProvider } from '../ui/tooltip' -import { ActiveSettingsSectionProvider } from './SettingsSection' -import { getChatAppearanceSearchEntries } from './chat-appearance-search' +import { TooltipProvider } from '../../ui/tooltip' +import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' +import { getChatAppearanceSearchEntries } from '../appearance/chat/chat-appearance-search' import { getChatNamingSearchEntry } from './chat-naming-search' import { getChatInlineVisualsSearchEntry } from './chat-inline-visuals-search' import { getChatBehaviorSearchEntries } from './chat-behavior-search' -import { AGENT_SESSION_QUEUED_MESSAGES_RUNTIME_CAPABILITY } from '../../../../shared/agent-session/agent-session-runtime-capabilities' +import { AGENT_SESSION_QUEUED_MESSAGES_RUNTIME_CAPABILITY } from '../../../../../shared/agent-session/agent-session-runtime-capabilities' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' import { i18n } from '@/i18n/i18n' import { buildSettingsNavigationMetadata } from '@/hooks/useSettingsNavigationMetadata' -import { buildCmdJSettingsResults } from '../cmd-j/palette-results' +import { buildCmdJSettingsResults } from '../../cmd-j/palette-results' import { isSettingsNavigationTarget } from '@/lib/settings-navigation-types' -import { getSettingsSectionId, getSettingsScrollTarget } from './settings-navigation-foundations' +import { + getSettingsSectionId, + getSettingsScrollTarget +} from '../navigation/settings-navigation-foundations' import ja from '@/i18n/locales/ja.json' -import { getSettingsSectionSearchEntries, matchesSettingsSearch } from './settings-search' -import { useAppStore } from '@/store' +import { getSettingsSectionSearchEntries, matchesSettingsSearch } from '../search/settings-search' +import { useAppStore } from '@/store/index' import { getChatLaunchSearchEntries } from './chat-launch-search' vi.mock('@/lib/host-chat-program-acquisition', () => ({ useChatProgramFacts: () => {} })) diff --git a/src/renderer/src/components/settings/ChatSettingsSection.tsx b/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx similarity index 84% rename from src/renderer/src/components/settings/ChatSettingsSection.tsx rename to src/renderer/src/components/settings/chat/ChatSettingsSection.tsx index 2f3103ad9e6..df9b537c5fd 100644 --- a/src/renderer/src/components/settings/ChatSettingsSection.tsx +++ b/src/renderer/src/components/settings/chat/ChatSettingsSection.tsx @@ -1,22 +1,22 @@ import { translate } from '@/i18n/i18n' -import { AppearanceChatSection } from './AppearanceChatSection' +import { AppearanceChatSection } from '../appearance/chat/AppearanceChatSection' import { ChatBehaviorSetting } from './ChatBehaviorSetting' import { ChatNamingSetting } from './ChatNamingSetting' import { NativeChatInlineVisualsSetting } from './NativeChatInlineVisualsSetting' -import { SettingsSection } from './SettingsSection' -import { SettingsSubsectionHeader } from './SettingsFormControls' -import { matchesSettingsSearch } from './settings-search' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { SourceControlAiSettingsPatch } from '../../../../shared/source-control-ai-types' -import type { SettingsSearchEntry } from './settings-search' -import { useAppStore } from '../../store' -import { Card, CardContent } from '../ui/card' -import { getChatAppearanceSearchEntries } from './chat-appearance-search' +import { SettingsSection } from '../section-layout/SettingsSection' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' +import { matchesSettingsSearch } from '../search/settings-search' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control-ai-types' +import type { SettingsSearchEntry } from '../search/settings-search' +import { useAppStore } from '../../../store/index' +import { Card, CardContent } from '../../ui/card' +import { getChatAppearanceSearchEntries } from '../appearance/chat/chat-appearance-search' import { getChatBehaviorTitle } from './chat-behavior-search' -import { AgentDefaultSurfaceSection } from './AgentDefaultSurfaceSection' +import { AgentDefaultSurfaceSection } from '../AgentDefaultSurfaceSection' import { ChatAgentLaunchSettings } from './ChatAgentLaunchSettings' import { getChatLaunchEntriesByKey } from './chat-launch-search' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' export function ChatSettingsSection({ settings, diff --git a/src/renderer/src/components/settings/NativeChatInlineVisualsSetting.tsx b/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx similarity index 81% rename from src/renderer/src/components/settings/NativeChatInlineVisualsSetting.tsx rename to src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx index 4013be576c9..9d88a4b72c6 100644 --- a/src/renderer/src/components/settings/NativeChatInlineVisualsSetting.tsx +++ b/src/renderer/src/components/settings/chat/NativeChatInlineVisualsSetting.tsx @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SettingsSwitchRow } from './SettingsFormControls' -import { Card, CardContent } from '../ui/card' -import { SearchableSetting } from './SearchableSetting' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' +import { Card, CardContent } from '../../ui/card' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { getChatInlineVisualsSearchEntry } from './chat-inline-visuals-search' type NativeChatInlineVisualsSettingProps = { diff --git a/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx b/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx similarity index 92% rename from src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx rename to src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx index 1bdb3fd2be1..ae8049086c4 100644 --- a/src/renderer/src/components/settings/NativeChatShellEnvironmentSetting.tsx +++ b/src/renderer/src/components/settings/chat/NativeChatShellEnvironmentSetting.tsx @@ -1,12 +1,12 @@ import { useRef, useState } from 'react' import { Plus, X } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { isNativeChatShellEnvironmentName } from '../../../../shared/native-chat/native-chat-shell-environment' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { isNativeChatShellEnvironmentName } from '../../../../../shared/native-chat/native-chat-shell-environment' import { translate } from '@/i18n/i18n' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { SettingsSwitchRow } from './SettingsFormControls' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { getChatBehaviorEntriesByKey } from './chat-behavior-search' type NativeChatShellEnvironmentSettingProps = { diff --git a/src/renderer/src/components/settings/chat-behavior-search.ts b/src/renderer/src/components/settings/chat/chat-behavior-search.ts similarity index 98% rename from src/renderer/src/components/settings/chat-behavior-search.ts rename to src/renderer/src/components/settings/chat/chat-behavior-search.ts index 18fcc8450a6..084c50faf2b 100644 --- a/src/renderer/src/components/settings/chat-behavior-search.ts +++ b/src/renderer/src/components/settings/chat/chat-behavior-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { NATIVE_CHAT_RESUME_SETTING_SECTION_ID } from './native-chat-resume-setting-target' import { NATIVE_CHAT_USAGE_LIMIT_CONTINUE_SETTING_SECTION_ID } from './native-chat-usage-limit-continue-setting-target' diff --git a/src/renderer/src/components/settings/chat-inline-visuals-search.ts b/src/renderer/src/components/settings/chat/chat-inline-visuals-search.ts similarity index 88% rename from src/renderer/src/components/settings/chat-inline-visuals-search.ts rename to src/renderer/src/components/settings/chat/chat-inline-visuals-search.ts index cf9ac9b4743..c4d4577572c 100644 --- a/src/renderer/src/components/settings/chat-inline-visuals-search.ts +++ b/src/renderer/src/components/settings/chat/chat-inline-visuals-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' export const getChatInlineVisualsSearchEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ targetSectionId: 'chat-inline-visuals', diff --git a/src/renderer/src/components/settings/chat-launch-search.ts b/src/renderer/src/components/settings/chat/chat-launch-search.ts similarity index 90% rename from src/renderer/src/components/settings/chat-launch-search.ts rename to src/renderer/src/components/settings/chat/chat-launch-search.ts index 6bd0da69c53..26e13661bd7 100644 --- a/src/renderer/src/components/settings/chat-launch-search.ts +++ b/src/renderer/src/components/settings/chat/chat-launch-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' -import type { SettingsSearchEntry } from './settings-search' -import { translateSearchKeyword } from './settings-search-keywords' +import type { SettingsSearchEntry } from '../search/settings-search' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getChatLaunchEntriesByKey() { return { diff --git a/src/renderer/src/components/settings/chat-naming-persistence.test.tsx b/src/renderer/src/components/settings/chat/chat-naming-persistence.test.tsx similarity index 95% rename from src/renderer/src/components/settings/chat-naming-persistence.test.tsx rename to src/renderer/src/components/settings/chat/chat-naming-persistence.test.tsx index d7070dfea21..71dda168284 100644 --- a/src/renderer/src/components/settings/chat-naming-persistence.test.tsx +++ b/src/renderer/src/components/settings/chat/chat-naming-persistence.test.tsx @@ -1,26 +1,27 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, fireEvent, render, renderHook, screen, waitFor, within } from '@testing-library/react' import { expect, it, vi } from 'vitest' import { toast } from 'sonner' -import { setSourceControlActionDefault } from '../../../../shared/source-control-ai-actions' +import { setSourceControlActionDefault } from '../../../../../shared/source-control-ai-actions' import { normalizeSourceControlAiSettings, resolveSourceControlAiForOperation -} from '../../../../shared/source-control-ai' -import { useAppStore } from '../../store' +} from '../../../../../shared/source-control-ai' +import { useAppStore } from '../../../store/index' import { renderChatSettingsSection, type ChatSettingsRenderContext -} from './settings-interface-secondary-section-renderers' +} from '../page/settings-interface-secondary-section-renderers' import { getChatNamingSearchEntry } from './chat-naming-search' -import { useSettingsInteractionController } from './use-settings-interaction-controller' +import { useSettingsInteractionController } from '../page/use-settings-interaction-controller' import { persist, settingsModel, type SettingsPersistenceModel -} from './__fixtures__/settings-persistence-test-fixture' -import { ActiveSettingsSectionProvider } from './SettingsSection' -import { TooltipProvider } from '../ui/tooltip' +} from '../__fixtures__/settings-persistence-test-fixture' +import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' +import { TooltipProvider } from '../../ui/tooltip' vi.mock('sonner', () => ({ toast: { error: vi.fn(), success: vi.fn(), info: vi.fn() } })) diff --git a/src/renderer/src/components/settings/chat-naming-search.ts b/src/renderer/src/components/settings/chat/chat-naming-search.ts similarity index 91% rename from src/renderer/src/components/settings/chat-naming-search.ts rename to src/renderer/src/components/settings/chat/chat-naming-search.ts index cf064faa8f7..7959696ab78 100644 --- a/src/renderer/src/components/settings/chat-naming-search.ts +++ b/src/renderer/src/components/settings/chat/chat-naming-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' export const getChatNamingSearchEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ targetSectionId: 'chat-names', diff --git a/src/renderer/src/components/settings/chat-permission-search.ts b/src/renderer/src/components/settings/chat/chat-permission-search.ts similarity index 93% rename from src/renderer/src/components/settings/chat-permission-search.ts rename to src/renderer/src/components/settings/chat/chat-permission-search.ts index 45b4973354d..1f63b1156ea 100644 --- a/src/renderer/src/components/settings/chat-permission-search.ts +++ b/src/renderer/src/components/settings/chat/chat-permission-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' const getTypedEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ targetSectionId: 'chat-permissions', diff --git a/src/renderer/src/components/settings/native-chat-resume-setting-target.ts b/src/renderer/src/components/settings/chat/native-chat-resume-setting-target.ts similarity index 100% rename from src/renderer/src/components/settings/native-chat-resume-setting-target.ts rename to src/renderer/src/components/settings/chat/native-chat-resume-setting-target.ts diff --git a/src/renderer/src/components/settings/native-chat-usage-limit-continue-setting-target.ts b/src/renderer/src/components/settings/chat/native-chat-usage-limit-continue-setting-target.ts similarity index 100% rename from src/renderer/src/components/settings/native-chat-usage-limit-continue-setting-target.ts rename to src/renderer/src/components/settings/chat/native-chat-usage-limit-continue-setting-target.ts diff --git a/src/renderer/src/components/settings/use-chat-permission-settings.ts b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts similarity index 91% rename from src/renderer/src/components/settings/use-chat-permission-settings.ts rename to src/renderer/src/components/settings/chat/use-chat-permission-settings.ts index 142f317ce6e..6188f91d109 100644 --- a/src/renderer/src/components/settings/use-chat-permission-settings.ts +++ b/src/renderer/src/components/settings/chat/use-chat-permission-settings.ts @@ -1,14 +1,14 @@ import { useEffect, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { AgentLaunchSettings } from '../../../../shared/agent-launch-settings' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { AgentLaunchSettings } from '../../../../../shared/agent-launch-settings' import { isWebClientLocation } from '@/lib/web-client-location' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { useStructuredAgentSessionOwnPermissionState } from '@/runtime/structured-agent-session-host-capability' import { subscribeRuntimeHostContactRegained } from '@/runtime/runtime-host-contact-regained' import { readHostAgentLaunchSettings, subscribeHostAgentLaunchSettings -} from './agent-launch-settings-transport' +} from '../agent-launch-settings-transport' export function useChatPermissionSettings(settings: GlobalSettings) { const web = isWebClientLocation() diff --git a/src/renderer/src/components/settings/claude-account-switch-copy.test.tsx b/src/renderer/src/components/settings/claude-account-switch-copy.test.tsx index ec043e973ad..0d390587c4d 100644 --- a/src/renderer/src/components/settings/claude-account-switch-copy.test.tsx +++ b/src/renderer/src/components/settings/claude-account-switch-copy.test.tsx @@ -13,7 +13,7 @@ import ko from '@/i18n/locales/ko.json' import zh from '@/i18n/locales/zh.json' import { ClaudeRunningSessionSwitchSetting } from './claude-running-session-switch-setting' import { getAccountsClaudeSearchEntries } from './accounts-claude-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' import { createClaudeAccountActionRunner } from './accounts-pane-account-actions' import { getClaudeAccountSwitchPrompt, diff --git a/src/renderer/src/components/settings/claude-running-session-switch-setting.tsx b/src/renderer/src/components/settings/claude-running-session-switch-setting.tsx index 3b82eafa0dd..70086b7c7be 100644 --- a/src/renderer/src/components/settings/claude-running-session-switch-setting.tsx +++ b/src/renderer/src/components/settings/claude-running-session-switch-setting.tsx @@ -3,7 +3,7 @@ import type { ClaudeAccountSwitchRunningSessions } from '../../../../shared/clau import { translate } from '@/i18n/i18n' import { Label } from '../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' +import { SearchableSetting } from './section-layout/SearchableSetting' const POLICIES: readonly ClaudeAccountSwitchRunningSessions[] = ['ask', 'restart', 'keep'] diff --git a/src/renderer/src/components/settings/claude-subagent-navigation-copy.ts b/src/renderer/src/components/settings/claude-subagent-navigation-copy.ts index 4fc128cf583..8175acb3056 100644 --- a/src/renderer/src/components/settings/claude-subagent-navigation-copy.ts +++ b/src/renderer/src/components/settings/claude-subagent-navigation-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getClaudeSubagentNavigationTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/codex-history-sharing-copy.ts b/src/renderer/src/components/settings/codex-history-sharing-copy.ts index 0a9e4a7868f..39720ad830a 100644 --- a/src/renderer/src/components/settings/codex-history-sharing-copy.ts +++ b/src/renderer/src/components/settings/codex-history-sharing-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getCodexHistorySharingTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/codex-terminal-server-isolation-copy.ts b/src/renderer/src/components/settings/codex-terminal-server-isolation-copy.ts index 0f82e70f43e..737e507a65c 100644 --- a/src/renderer/src/components/settings/codex-terminal-server-isolation-copy.ts +++ b/src/renderer/src/components/settings/codex-terminal-server-isolation-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getCodexTerminalServerIsolationTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/commit-message-ai-search.ts b/src/renderer/src/components/settings/commit-message-ai-search.ts index 8ec0d820c0d..7090f0305e8 100644 --- a/src/renderer/src/components/settings/commit-message-ai-search.ts +++ b/src/renderer/src/components/settings/commit-message-ai-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getCommitMessageAiPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/computer-use-search.ts b/src/renderer/src/components/settings/computer-use-search.ts index 1dc154c6287..647c7f19ed6 100644 --- a/src/renderer/src/components/settings/computer-use-search.ts +++ b/src/renderer/src/components/settings/computer-use-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getComputerUsePaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/DeveloperPermissionActions.tsx b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionActions.tsx similarity index 94% rename from src/renderer/src/components/settings/DeveloperPermissionActions.tsx rename to src/renderer/src/components/settings/developer-permissions/DeveloperPermissionActions.tsx index fa5b52e181a..a2c0a2db490 100644 --- a/src/renderer/src/components/settings/DeveloperPermissionActions.tsx +++ b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionActions.tsx @@ -3,9 +3,9 @@ import { toast } from 'sonner' import type { DeveloperPermissionId, DeveloperPermissionStatus -} from '../../../../shared/developer-permissions-types' +} from '../../../../../shared/developer-permissions-types' import { translate } from '@/i18n/i18n' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' type DeveloperPermissionActionsProps = { id: DeveloperPermissionId diff --git a/src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx similarity index 95% rename from src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx rename to src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx index e37e15df9c1..1516f60eba6 100644 --- a/src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx +++ b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.test.tsx @@ -1,9 +1,10 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import type { DeveloperPermissionState } from '../../../../shared/developer-permissions-types' +import type { DeveloperPermissionState } from '../../../../../shared/developer-permissions-types' import { DeveloperPermissionsPane } from './DeveloperPermissionsPane' const toastMessageMock = vi.hoisted(() => vi.fn()) diff --git a/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.tsx similarity index 98% rename from src/renderer/src/components/settings/DeveloperPermissionsPane.tsx rename to src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.tsx index 010c48db215..ad6ca092ec8 100644 --- a/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx +++ b/src/renderer/src/components/settings/developer-permissions/DeveloperPermissionsPane.tsx @@ -16,8 +16,8 @@ import { toast } from 'sonner' import type { DeveloperPermissionId, DeveloperPermissionState -} from '../../../../shared/developer-permissions-types' -import { Button } from '../ui/button' +} from '../../../../../shared/developer-permissions-types' +import { Button } from '../../ui/button' import { translate } from '@/i18n/i18n' import { DeveloperPermissionActions } from './DeveloperPermissionActions' import { LocalNetworkConnectionTest } from './LocalNetworkConnectionTest' @@ -27,7 +27,6 @@ import { } from './developer-permission-status' import { showDeveloperPermissionRequestNotice } from './developer-permission-request-notice' import { TerminalTccAttributionNotice } from './TerminalTccAttributionNotice' -export { getDeveloperPermissionsPaneSearchEntries } from './developer-permissions-search' type DeveloperPermissionsPaneProps = { highlightedSettingId?: string | null diff --git a/src/renderer/src/components/settings/LocalNetworkConnectionTest.test.tsx b/src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.test.tsx similarity index 99% rename from src/renderer/src/components/settings/LocalNetworkConnectionTest.test.tsx rename to src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.test.tsx index eacd759c7be..485f088605a 100644 --- a/src/renderer/src/components/settings/LocalNetworkConnectionTest.test.tsx +++ b/src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.test.tsx @@ -1,5 +1,6 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, expect, it, vi } from 'vitest' diff --git a/src/renderer/src/components/settings/LocalNetworkConnectionTest.tsx b/src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.tsx similarity index 97% rename from src/renderer/src/components/settings/LocalNetworkConnectionTest.tsx rename to src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.tsx index aa6db478428..4791637620e 100644 --- a/src/renderer/src/components/settings/LocalNetworkConnectionTest.tsx +++ b/src/renderer/src/components/settings/developer-permissions/LocalNetworkConnectionTest.tsx @@ -3,13 +3,13 @@ import { CheckCircle2, ChevronDown } from 'lucide-react' import type { LocalNetworkConnectionTestFailure, LocalNetworkConnectionTestResult -} from '../../../../shared/developer-permissions-types' +} from '../../../../../shared/developer-permissions-types' import { getIntlLocale, translate } from '@/i18n/i18n' import { cn } from '@/lib/utils' -import { Button } from '../ui/button' -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible' -import { Input } from '../ui/input' -import { Label } from '../ui/label' +import { Button } from '../../ui/button' +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../ui/collapsible' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' import { loadLocalNetworkConnectionSuccess, saveLocalNetworkConnectionSuccess, diff --git a/src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx b/src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx rename to src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx index 61adc41bba2..a5b6ab62815 100644 --- a/src/renderer/src/components/settings/TerminalTccAttributionNotice.test.tsx +++ b/src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.test.tsx @@ -1,5 +1,6 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, expect, it, vi } from 'vitest' @@ -9,7 +10,7 @@ const openSettingsTarget = vi.fn() const openSettingsPage = vi.fn() const setSettingsSearchQuery = vi.fn() -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: { getState: () => ({ openSettingsTarget, openSettingsPage, setSettingsSearchQuery }) } diff --git a/src/renderer/src/components/settings/TerminalTccAttributionNotice.tsx b/src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.tsx similarity index 93% rename from src/renderer/src/components/settings/TerminalTccAttributionNotice.tsx rename to src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.tsx index 5636a80d99b..3a4775b4c38 100644 --- a/src/renderer/src/components/settings/TerminalTccAttributionNotice.tsx +++ b/src/renderer/src/components/settings/developer-permissions/TerminalTccAttributionNotice.tsx @@ -1,9 +1,8 @@ import { useCallback, useEffect, useState } from 'react' import { TriangleAlert } from 'lucide-react' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' import { translate } from '@/i18n/i18n' -import { openTerminalManageSessions } from './open-terminal-manage-sessions' -export { MANAGE_SESSIONS_SECTION_ID } from './open-terminal-manage-sessions' +import { openTerminalManageSessions } from '../terminal/session-management/open-terminal-manage-sessions' /** Updates delete the daemon’s responsible app binary, silently severing macOS TCC grants for terminals (osascript -25211); surface recovery beside affected permissions (STA-3491). */ export function useMacTccAttributionSevered(refreshRevision = 0): boolean { diff --git a/src/renderer/src/components/settings/developer-permission-request-notice.ts b/src/renderer/src/components/settings/developer-permissions/developer-permission-request-notice.ts similarity index 97% rename from src/renderer/src/components/settings/developer-permission-request-notice.ts rename to src/renderer/src/components/settings/developer-permissions/developer-permission-request-notice.ts index 47b7e79b680..430443cd355 100644 --- a/src/renderer/src/components/settings/developer-permission-request-notice.ts +++ b/src/renderer/src/components/settings/developer-permissions/developer-permission-request-notice.ts @@ -1,6 +1,6 @@ import { toast } from 'sonner' import { translate } from '@/i18n/i18n' -import type { DeveloperPermissionRequestResult } from '../../../../shared/developer-permissions-types' +import type { DeveloperPermissionRequestResult } from '../../../../../shared/developer-permissions-types' /** Reports only permission outcomes supported by the corresponding macOS API. */ export function showDeveloperPermissionRequestNotice( diff --git a/src/renderer/src/components/settings/developer-permission-status.ts b/src/renderer/src/components/settings/developer-permissions/developer-permission-status.ts similarity index 97% rename from src/renderer/src/components/settings/developer-permission-status.ts rename to src/renderer/src/components/settings/developer-permissions/developer-permission-status.ts index 6416445f131..2485b0c1c2a 100644 --- a/src/renderer/src/components/settings/developer-permission-status.ts +++ b/src/renderer/src/components/settings/developer-permissions/developer-permission-status.ts @@ -2,7 +2,7 @@ import { translate } from '@/i18n/i18n' import type { DeveloperPermissionId, DeveloperPermissionStatus -} from '../../../../shared/developer-permissions-types' +} from '../../../../../shared/developer-permissions-types' export function developerPermissionStatusLabel( id: DeveloperPermissionId, diff --git a/src/renderer/src/components/settings/developer-permissions-search.test.ts b/src/renderer/src/components/settings/developer-permissions/developer-permissions-search.test.ts similarity index 96% rename from src/renderer/src/components/settings/developer-permissions-search.test.ts rename to src/renderer/src/components/settings/developer-permissions/developer-permissions-search.test.ts index 1936f84c5b6..ffb180ce1dc 100644 --- a/src/renderer/src/components/settings/developer-permissions-search.test.ts +++ b/src/renderer/src/components/settings/developer-permissions/developer-permissions-search.test.ts @@ -2,7 +2,7 @@ import { afterAll, describe, expect, it } from 'vitest' import { i18n } from '@/i18n/i18n' import { getDeveloperPermissionsPaneSearchEntries } from './developer-permissions-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from '../search/settings-search' // Use macOS 26’s actual Local Network translations (SecurityPrivacyExtension LOCAL_NETWORK). const MACOS_LOCAL_NETWORK_LABEL = { diff --git a/src/renderer/src/components/settings/developer-permissions-search.ts b/src/renderer/src/components/settings/developer-permissions/developer-permissions-search.ts similarity index 98% rename from src/renderer/src/components/settings/developer-permissions-search.ts rename to src/renderer/src/components/settings/developer-permissions/developer-permissions-search.ts index 6b757b03bd4..e660edf1ece 100644 --- a/src/renderer/src/components/settings/developer-permissions-search.ts +++ b/src/renderer/src/components/settings/developer-permissions/developer-permissions-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getDeveloperPermissionsPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/local-network-connection-history.ts b/src/renderer/src/components/settings/developer-permissions/local-network-connection-history.ts similarity index 96% rename from src/renderer/src/components/settings/local-network-connection-history.ts rename to src/renderer/src/components/settings/developer-permissions/local-network-connection-history.ts index 8712c065d6a..77063a922e7 100644 --- a/src/renderer/src/components/settings/local-network-connection-history.ts +++ b/src/renderer/src/components/settings/developer-permissions/local-network-connection-history.ts @@ -1,4 +1,4 @@ -import type { LocalNetworkConnectionTestResult } from '../../../../shared/developer-permissions-types' +import type { LocalNetworkConnectionTestResult } from '../../../../../shared/developer-permissions-types' const STORAGE_KEY = 'orca.developer-permissions.local-network-last-success.v1' diff --git a/src/renderer/src/components/settings/CollapseUnchangedRegionsSetting.tsx b/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx similarity index 87% rename from src/renderer/src/components/settings/CollapseUnchangedRegionsSetting.tsx rename to src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx index ba20c49b216..c699710fd95 100644 --- a/src/renderer/src/components/settings/CollapseUnchangedRegionsSetting.tsx +++ b/src/renderer/src/components/settings/editor/CollapseUnchangedRegionsSetting.tsx @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { Label } from '../../ui/label' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSegmentedControl } from '../form-controls/SettingsFormControls' const KEYWORDS = [ 'diff', diff --git a/src/renderer/src/components/settings/DiffShowWhitespaceSetting.tsx b/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx similarity index 88% rename from src/renderer/src/components/settings/DiffShowWhitespaceSetting.tsx rename to src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx index 998274b84a7..9549a46a59d 100644 --- a/src/renderer/src/components/settings/DiffShowWhitespaceSetting.tsx +++ b/src/renderer/src/components/settings/editor/DiffShowWhitespaceSetting.tsx @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { Label } from '../ui/label' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { Label } from '../../ui/label' +import { SettingsSegmentedControl } from '../form-controls/SettingsFormControls' type DiffShowWhitespaceSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/EditorFontFamilySetting.tsx b/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx similarity index 86% rename from src/renderer/src/components/settings/EditorFontFamilySetting.tsx rename to src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx index 7f09086c57b..01e4728eb3a 100644 --- a/src/renderer/src/components/settings/EditorFontFamilySetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorFontFamilySetting.tsx @@ -1,8 +1,9 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { FontAutocomplete, SettingsRow } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { FontAutocomplete } from '../appearance/fonts/FontAutocomplete' +import { SettingsRow } from '../form-controls/SettingsFormControls' type EditorFontFamilySettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/EditorFormatOnSaveSetting.tsx b/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx similarity index 82% rename from src/renderer/src/components/settings/EditorFormatOnSaveSetting.tsx rename to src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx index dd41ce17002..db11235928c 100644 --- a/src/renderer/src/components/settings/EditorFormatOnSaveSetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorFormatOnSaveSetting.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' export function getFormatOnSaveSearchEntry() { return { diff --git a/src/renderer/src/components/settings/EditorTypographySettings.tsx b/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx similarity index 93% rename from src/renderer/src/components/settings/EditorTypographySettings.tsx rename to src/renderer/src/components/settings/editor/EditorTypographySettings.tsx index b63bcca6c60..03b798525d2 100644 --- a/src/renderer/src/components/settings/EditorTypographySettings.tsx +++ b/src/renderer/src/components/settings/editor/EditorTypographySettings.tsx @@ -1,11 +1,11 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { TERMINAL_FONT_WEIGHT_MAX, TERMINAL_FONT_WEIGHT_MIN, TERMINAL_FONT_WEIGHT_STEP -} from '../../../../shared/terminal-fonts' -import { fontFamilyHasKnownLigatures } from '../../../../shared/terminal-ligatures' +} from '../../../../../shared/terminal-fonts' +import { fontFamilyHasKnownLigatures } from '../../../../../shared/terminal-ligatures' import { EDITOR_FONT_SIZE_MAX, EDITOR_FONT_SIZE_MIN, @@ -16,8 +16,12 @@ import { } from '@/lib/editor-typography' import { supportsCodeFontSmoothing, type CodeFontSmoothing } from '@/lib/code-font-smoothing' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { NumberField, SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { + NumberField, + SettingsRow, + SettingsSegmentedControl +} from '../form-controls/SettingsFormControls' import { getEditorTypographySearchEntries } from './editor-typography-search' type EditorTypographySettingsProps = { diff --git a/src/renderer/src/components/settings/EditorWordWrapSetting.tsx b/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx similarity index 88% rename from src/renderer/src/components/settings/EditorWordWrapSetting.tsx rename to src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx index c9283daf731..2a2936a8900 100644 --- a/src/renderer/src/components/settings/EditorWordWrapSetting.tsx +++ b/src/renderer/src/components/settings/editor/EditorWordWrapSetting.tsx @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { Label } from '../ui/label' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { Label } from '../../ui/label' +import { SettingsSegmentedControl } from '../form-controls/SettingsFormControls' type EditorWordWrapSettingProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/GeneralEditorSettingsSection.tsx b/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx similarity index 97% rename from src/renderer/src/components/settings/GeneralEditorSettingsSection.tsx rename to src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx index dd9b69028fd..cbf52dd2ace 100644 --- a/src/renderer/src/components/settings/GeneralEditorSettingsSection.tsx +++ b/src/renderer/src/components/settings/editor/GeneralEditorSettingsSection.tsx @@ -1,21 +1,21 @@ import type React from 'react' import { useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { DEFAULT_EDITOR_AUTO_SAVE_DELAY_MS, MAX_EDITOR_AUTO_SAVE_DELAY_MS, MIN_EDITOR_AUTO_SAVE_DELAY_MS -} from '../../../../shared/constants' +} from '../../../../../shared/constants' import { clampNumber } from '@/lib/terminal-theme' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { SearchableSetting } from './SearchableSetting' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { CollapseUnchangedRegionsSetting } from './CollapseUnchangedRegionsSetting' import { SettingsSegmentedControl, SettingsSubsectionHeader, SettingsSwitchRow -} from './SettingsFormControls' +} from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' import { RichMarkdownSpellcheckSetting } from './RichMarkdownSpellcheckSetting' import { DiffShowWhitespaceSetting } from './DiffShowWhitespaceSetting' diff --git a/src/renderer/src/components/settings/RichMarkdownSpellcheckSetting.tsx b/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx similarity index 86% rename from src/renderer/src/components/settings/RichMarkdownSpellcheckSetting.tsx rename to src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx index 214bff3282d..a3718448255 100644 --- a/src/renderer/src/components/settings/RichMarkdownSpellcheckSetting.tsx +++ b/src/renderer/src/components/settings/editor/RichMarkdownSpellcheckSetting.tsx @@ -1,8 +1,8 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSwitchRow } from '../form-controls/SettingsFormControls' type RichMarkdownSpellcheckSettingProps = { settings: Pick diff --git a/src/renderer/src/components/settings/auto-save-delay-draft.ts b/src/renderer/src/components/settings/editor/auto-save-delay-draft.ts similarity index 100% rename from src/renderer/src/components/settings/auto-save-delay-draft.ts rename to src/renderer/src/components/settings/editor/auto-save-delay-draft.ts diff --git a/src/renderer/src/components/settings/editor-typography-search.ts b/src/renderer/src/components/settings/editor/editor-typography-search.ts similarity index 96% rename from src/renderer/src/components/settings/editor-typography-search.ts rename to src/renderer/src/components/settings/editor/editor-typography-search.ts index 76c24f2318c..846960a4c5a 100644 --- a/src/renderer/src/components/settings/editor-typography-search.ts +++ b/src/renderer/src/components/settings/editor/editor-typography-search.ts @@ -1,8 +1,8 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { supportsCodeFontSmoothing } from '@/lib/code-font-smoothing' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' function editorTypographyKeywords(): string[] { return [ diff --git a/src/renderer/src/components/settings/general-editor-search.ts b/src/renderer/src/components/settings/editor/general-editor-search.ts similarity index 99% rename from src/renderer/src/components/settings/general-editor-search.ts rename to src/renderer/src/components/settings/editor/general-editor-search.ts index 9e984cd19b4..626c744dab2 100644 --- a/src/renderer/src/components/settings/general-editor-search.ts +++ b/src/renderer/src/components/settings/editor/general-editor-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { getVisibleEditorTypographySearchEntries } from './editor-typography-search' import { getFormatOnSaveSearchEntry } from './EditorFormatOnSaveSetting' diff --git a/src/renderer/src/components/settings/ephemeral-vms-search.ts b/src/renderer/src/components/settings/ephemeral-vms-search.ts index 8870d515858..fa32a40382f 100644 --- a/src/renderer/src/components/settings/ephemeral-vms-search.ts +++ b/src/renderer/src/components/settings/ephemeral-vms-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getEphemeralVmsSearchEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ diff --git a/src/renderer/src/components/settings/FloatingWorkspacePane.tsx b/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx similarity index 92% rename from src/renderer/src/components/settings/FloatingWorkspacePane.tsx rename to src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx index 16c7b55c9cd..bd69437d7a1 100644 --- a/src/renderer/src/components/settings/FloatingWorkspacePane.tsx +++ b/src/renderer/src/components/settings/floating-workspaces/FloatingWorkspacePane.tsx @@ -1,15 +1,15 @@ import { useEffect, useState } from 'react' import { FolderOpen } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { FloatingTerminalTriggerLocation } from '../../../../shared/ui-chrome-types' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSwitchRow } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { FloatingTerminalTriggerLocation } from '../../../../../shared/ui-chrome-types' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { ToggleGroup, ToggleGroupItem } from '../../ui/toggle-group' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsRow, SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { getFloatingWorkspaceSearchEntries } from './floating-workspace-search' -import { matchesSettingsSearch } from './settings-search' -import { useAppStore } from '../../store' +import { matchesSettingsSearch } from '../search/settings-search' +import { useAppStore } from '../../../store/index' import { translate } from '@/i18n/i18n' import { isWebClientLocation } from '@/lib/web-client-location' diff --git a/src/renderer/src/components/settings/floating-workspace-search.ts b/src/renderer/src/components/settings/floating-workspaces/floating-workspace-search.ts similarity index 97% rename from src/renderer/src/components/settings/floating-workspace-search.ts rename to src/renderer/src/components/settings/floating-workspaces/floating-workspace-search.ts index e0a40747702..dcc4475563d 100644 --- a/src/renderer/src/components/settings/floating-workspace-search.ts +++ b/src/renderer/src/components/settings/floating-workspaces/floating-workspace-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' function buildFloatingWorkspaceSearchEntries(includeBrowser: boolean) { diff --git a/src/renderer/src/components/settings/DebouncedSettingsTextInput.tsx b/src/renderer/src/components/settings/form-controls/DebouncedSettingsTextInput.tsx similarity index 95% rename from src/renderer/src/components/settings/DebouncedSettingsTextInput.tsx rename to src/renderer/src/components/settings/form-controls/DebouncedSettingsTextInput.tsx index 05e0d0af50e..4b7312dff54 100644 --- a/src/renderer/src/components/settings/DebouncedSettingsTextInput.tsx +++ b/src/renderer/src/components/settings/form-controls/DebouncedSettingsTextInput.tsx @@ -1,5 +1,5 @@ import type React from 'react' -import { Input } from '../ui/input' +import { Input } from '../../ui/input' import { useDebouncedSettingsTextDraft } from './use-debounced-settings-text-draft' type DebouncedSettingsTextInputProps = Omit< diff --git a/src/renderer/src/components/settings/SettingsDisabledControlTooltip.tsx b/src/renderer/src/components/settings/form-controls/SettingsDisabledControlTooltip.tsx similarity index 88% rename from src/renderer/src/components/settings/SettingsDisabledControlTooltip.tsx rename to src/renderer/src/components/settings/form-controls/SettingsDisabledControlTooltip.tsx index 90db73189f3..6cfc9eefe19 100644 --- a/src/renderer/src/components/settings/SettingsDisabledControlTooltip.tsx +++ b/src/renderer/src/components/settings/form-controls/SettingsDisabledControlTooltip.tsx @@ -1,5 +1,5 @@ import type React from 'react' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' export function SettingsDisabledControlTooltip({ reason, diff --git a/src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx b/src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx similarity index 95% rename from src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx rename to src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx index 2dd7c7ec1ce..935b9f7800d 100644 --- a/src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx +++ b/src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx @@ -1,7 +1,8 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import { TooltipProvider } from '../ui/tooltip' +import { TooltipProvider } from '../../ui/tooltip' import { SettingsSegmentedControl } from './SettingsFormControls' afterEach(cleanup) diff --git a/src/renderer/src/components/settings/SettingsFormControls.tsx b/src/renderer/src/components/settings/form-controls/SettingsFormControls.tsx similarity index 97% rename from src/renderer/src/components/settings/SettingsFormControls.tsx rename to src/renderer/src/components/settings/form-controls/SettingsFormControls.tsx index 587b964a5c2..8c9c19b5582 100644 --- a/src/renderer/src/components/settings/SettingsFormControls.tsx +++ b/src/renderer/src/components/settings/form-controls/SettingsFormControls.tsx @@ -1,17 +1,15 @@ +// @protected-copy: preserve copy used by security settings. import type React from 'react' import { useState } from 'react' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { Switch } from '../ui/switch' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' +import { Switch } from '../../ui/switch' import { SettingsDisabledControlTooltip } from './SettingsDisabledControlTooltip' import { normalizeColor } from '@/lib/terminal-theme' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -export { FontAutocomplete } from './FontAutocomplete' -export { ThemePicker } from './TerminalThemePicker' - type SettingsSwitchProps = { checked: boolean onChange: () => void diff --git a/src/renderer/src/components/settings/SettingsSearchableSelect.test.tsx b/src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.test.tsx similarity index 99% rename from src/renderer/src/components/settings/SettingsSearchableSelect.test.tsx rename to src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.test.tsx index 38d3ae6c277..917b2195eb0 100644 --- a/src/renderer/src/components/settings/SettingsSearchableSelect.test.tsx +++ b/src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.test.tsx @@ -1,5 +1,6 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import userEvent from '@testing-library/user-event' import { afterEach, describe, expect, it, vi } from 'vitest' diff --git a/src/renderer/src/components/settings/SettingsSearchableSelect.tsx b/src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.tsx similarity index 98% rename from src/renderer/src/components/settings/SettingsSearchableSelect.tsx rename to src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.tsx index 9cf19aa068f..ab6ab1a9484 100644 --- a/src/renderer/src/components/settings/SettingsSearchableSelect.tsx +++ b/src/renderer/src/components/settings/form-controls/SettingsSearchableSelect.tsx @@ -1,9 +1,9 @@ import type React from 'react' import { useCallback, useRef, useState } from 'react' import { Check, ChevronsUpDown } from 'lucide-react' -import { Button } from '../ui/button' -import { Command, CommandGroup, CommandInput, CommandItem, CommandList } from '../ui/command' -import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' +import { Button } from '../../ui/button' +import { Command, CommandGroup, CommandInput, CommandItem, CommandList } from '../../ui/command' +import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import { filterSearchableSelectGroups } from './settings-form-option-filter' diff --git a/src/renderer/src/components/settings/settings-form-option-filter.test.ts b/src/renderer/src/components/settings/form-controls/settings-form-option-filter.test.ts similarity index 96% rename from src/renderer/src/components/settings/settings-form-option-filter.test.ts rename to src/renderer/src/components/settings/form-controls/settings-form-option-filter.test.ts index 4546b67b2f1..0c00c381812 100644 --- a/src/renderer/src/components/settings/settings-form-option-filter.test.ts +++ b/src/renderer/src/components/settings/form-controls/settings-form-option-filter.test.ts @@ -2,13 +2,15 @@ import { describe, expect, it } from 'vitest' import type { TerminalThemeOption } from '@/lib/terminal-theme' import { FONT_SUGGESTION_RENDER_LIMIT, - SETTINGS_FORM_OPTION_QUERY_MAX_BYTES, filterFontSuggestions, + getRenderedFontSuggestions +} from '../appearance/fonts/font-suggestion-filter' +import { + SETTINGS_FORM_OPTION_QUERY_MAX_BYTES, filterSearchableSelectGroups, - filterTerminalThemeOptions, - getRenderedFontSuggestions, isSettingsFormOptionQueryTooLarge } from './settings-form-option-filter' +import { filterTerminalThemeOptions } from '../terminal/themes/terminal-theme-option-filter' function createThemeOption( label: string, diff --git a/src/renderer/src/components/settings/form-controls/settings-form-option-filter.ts b/src/renderer/src/components/settings/form-controls/settings-form-option-filter.ts new file mode 100644 index 00000000000..f301d8418ac --- /dev/null +++ b/src/renderer/src/components/settings/form-controls/settings-form-option-filter.ts @@ -0,0 +1,41 @@ +import { isClipboardTextByteLengthOverLimit } from '../../../../../shared/clipboard-text' + +export const SETTINGS_FORM_OPTION_QUERY_MAX_BYTES = 2 * 1024 + +export function isSettingsFormOptionQueryTooLarge( + query: string, + maxBytes = SETTINGS_FORM_OPTION_QUERY_MAX_BYTES +): boolean { + return isClipboardTextByteLengthOverLimit(query, maxBytes) +} + +export function normalizeSettingsFormOptionQuery(query: string): string | null { + if (isSettingsFormOptionQueryTooLarge(query)) { + return null + } + const trimmed = query.trim() + return trimmed.toLowerCase() +} + +/** Keeps options whose label, keywords or group heading contain every query term; drops empty groups. */ +export function filterSearchableSelectGroups< + TOption extends { label: string; keywords?: readonly string[] }, + TGroup extends { heading?: string; options: readonly TOption[] } +>(groups: readonly TGroup[], query: string): TGroup[] { + const normalizedQuery = normalizeSettingsFormOptionQuery(query) + if (normalizedQuery === null) { + return [] + } + const terms = normalizedQuery.split(/\s+/).filter(Boolean) + if (terms.length === 0) { + return groups.filter((group) => group.options.length > 0) + } + return groups.flatMap((group) => { + const options = group.options.filter((option) => { + const text = + `${option.label} ${option.keywords?.join(' ') ?? ''} ${group.heading ?? ''}`.toLowerCase() + return terms.every((term) => text.includes(term)) + }) + return options.length > 0 ? [{ ...group, options }] : [] + }) +} diff --git a/src/renderer/src/components/settings/use-debounced-settings-text-draft.test.ts b/src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.test.ts similarity index 99% rename from src/renderer/src/components/settings/use-debounced-settings-text-draft.test.ts rename to src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.test.ts index 4673135c874..1b36b10239c 100644 --- a/src/renderer/src/components/settings/use-debounced-settings-text-draft.test.ts +++ b/src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.test.ts @@ -1,5 +1,6 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { StrictMode } from 'react' import { act, cleanup, renderHook } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' diff --git a/src/renderer/src/components/settings/use-debounced-settings-text-draft.ts b/src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.ts similarity index 100% rename from src/renderer/src/components/settings/use-debounced-settings-text-draft.ts rename to src/renderer/src/components/settings/form-controls/use-debounced-settings-text-draft.ts diff --git a/src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx b/src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx similarity index 93% rename from src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx rename to src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx index 434f98f4443..ac51b2e6367 100644 --- a/src/renderer/src/components/settings/GeneralPane.section-lifetime.test.tsx +++ b/src/renderer/src/components/settings/general/GeneralPane.section-lifetime.test.tsx @@ -1,10 +1,11 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { GeneralPane } from './GeneralPane' -import { TooltipProvider } from '../ui/tooltip' -import type { UpdateStatus } from '../../../../shared/update-status-types' +import { TooltipProvider } from '../../ui/tooltip' +import type { UpdateStatus } from '../../../../../shared/update-status-types' const fake = vi.hoisted(() => ({ query: '', getVersion: vi.fn(async () => '1.4.100'), @@ -26,7 +27,7 @@ vi.mock('@/i18n/i18n', () => ({ fallback ) })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ settingsSearchQuery: fake.query, @@ -39,19 +40,22 @@ vi.mock('@/store', () => ({ setRemoteServerUpdateDialogOpen: fake.action }) })) -vi.mock('@/components/settings/GeneralWorkspaceSettingsSection', () => ({ +vi.mock('@/components/settings/general/GeneralWorkspaceSettingsSection', () => ({ GeneralWorkspaceSettingsSection: () => null })) vi.mock('@/components/settings/CliSection', () => ({ CliSection: () => null })) -vi.mock('@/components/settings/GeneralSupportSection', () => ({ +vi.mock('@/components/settings/general/GeneralSupportSection', () => ({ GeneralSupportSection: () => null })) -vi.mock('@/components/settings/ReleaseChannelSection', () => ({ +vi.mock('@/components/settings/updates/ReleaseChannelSection', () => ({ ReleaseChannelSection: () =>
Release picker open
})) -vi.mock('@/components/settings/DefaultWindowsProjectRuntimeSetting', () => ({ - DefaultWindowsProjectRuntimeSetting: () => null -})) +vi.mock( + '@/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting', + () => ({ + DefaultWindowsProjectRuntimeSetting: () => null + }) +) beforeEach(() => { vi.clearAllMocks() fake.query = '' diff --git a/src/renderer/src/components/settings/GeneralPane.test.ts b/src/renderer/src/components/settings/general/GeneralPane.test.ts similarity index 91% rename from src/renderer/src/components/settings/GeneralPane.test.ts rename to src/renderer/src/components/settings/general/GeneralPane.test.ts index e4f7fe9fb58..f8e42987a65 100644 --- a/src/renderer/src/components/settings/GeneralPane.test.ts +++ b/src/renderer/src/components/settings/general/GeneralPane.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it, vi } from 'vitest' import { createAutoSaveDelayDraftState, - shouldShowProjectRuntimeSection, updateAutoSaveDelayDraftState -} from './GeneralPane' +} from '../editor/auto-save-delay-draft' +import { shouldShowProjectRuntimeSection } from './GeneralPane' -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: () => { throw new Error('Pure settings helpers must not access the app store') } diff --git a/src/renderer/src/components/settings/GeneralPane.tsx b/src/renderer/src/components/settings/general/GeneralPane.tsx similarity index 90% rename from src/renderer/src/components/settings/GeneralPane.tsx rename to src/renderer/src/components/settings/general/GeneralPane.tsx index b952e5ab624..50dbaa7d349 100644 --- a/src/renderer/src/components/settings/GeneralPane.tsx +++ b/src/renderer/src/components/settings/general/GeneralPane.tsx @@ -1,37 +1,29 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { useAppStore } from '../../store' -import { CliSection } from './CliSection' -import { GeneralEditorSettingsSection } from './GeneralEditorSettingsSection' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { useAppStore } from '../../../store/index' +import { CliSection } from '../CliSection' +import { GeneralEditorSettingsSection } from '../editor/GeneralEditorSettingsSection' import { GeneralSupportSection } from './GeneralSupportSection' -import { GeneralUpdateSettingsSection } from './GeneralUpdateSettingsSection' +import { GeneralUpdateSettingsSection } from '../updates/GeneralUpdateSettingsSection' import { GeneralWorkspaceSettingsSection } from './GeneralWorkspaceSettingsSection' import { getGeneralCliSearchEntries, - getGeneralEditorSearchEntries, getGeneralNavigationSearchEntries, - getGeneralPaneSearchEntries, - getGeneralSupportSearchEntries, getGeneralUpdateSearchEntries, getGeneralWorkspaceSearchEntries } from './general-search' -import { getGeneralProjectRuntimeSearchEntries } from './general-project-runtime-search' -import { RecentTabOrderControl } from './RecentTabOrderControl' -import { SettingsSectionStack } from './SettingsSectionStack' -import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader, SettingsSwitchRow } from './SettingsFormControls' +import { getGeneralEditorSearchEntries } from '../editor/general-editor-search' +import { getGeneralSupportSearchEntries } from './general-support-search' +import { getGeneralProjectRuntimeSearchEntries } from './project-runtime/general-project-runtime-search' +import { RecentTabOrderControl } from '../appearance/RecentTabOrderControl' +import { SettingsSectionStack } from '../section-layout/SettingsSectionStack' +import { matchesSettingsSearch, type SettingsSearchEntry } from '../search/settings-search' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader, SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' -import { DefaultWindowsProjectRuntimeSetting } from './DefaultWindowsProjectRuntimeSetting' +import { DefaultWindowsProjectRuntimeSetting } from './project-runtime/DefaultWindowsProjectRuntimeSetting' import { defaultScopeHost } from '@/lib/default-creation-host' -export { - createAutoSaveDelayDraftState, - updateAutoSaveDelayDraftState, - type AutoSaveDelayDraftState -} from './auto-save-delay-draft' -export { shouldCommitOpenInApplicationsDraft } from './OpenInMenuSetting' - type GeneralSearchEntry = ReturnType[number] export function getDesktopPlatformFromUserAgent(userAgent: string): 'darwin' | 'win32' | 'other' { @@ -44,8 +36,6 @@ export function getDesktopPlatformFromUserAgent(userAgent: string): 'darwin' | ' return 'other' } -export { getGeneralPaneSearchEntries } - /** Gate Windows directly: empty search matches empty entries and would leave an orphan header after the inner control self-hides. */ export function shouldShowProjectRuntimeSection( wslSupportedPlatform: boolean | undefined, diff --git a/src/renderer/src/components/settings/GeneralSupportSection.tsx b/src/renderer/src/components/settings/general/GeneralSupportSection.tsx similarity index 95% rename from src/renderer/src/components/settings/GeneralSupportSection.tsx rename to src/renderer/src/components/settings/general/GeneralSupportSection.tsx index 61360c9593e..cb0f61f6a68 100644 --- a/src/renderer/src/components/settings/GeneralSupportSection.tsx +++ b/src/renderer/src/components/settings/general/GeneralSupportSection.tsx @@ -2,11 +2,11 @@ import type React from 'react' import { useEffect, useState } from 'react' import { ExternalLink, Loader2, Star } from 'lucide-react' import { useMountedRef } from '@/hooks/useMountedRef' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Separator } from '../ui/separator' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' +import { Separator } from '../../ui/separator' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' // Do not deep-link to /stargazers: GitHub 404s that page for users without repo write access. diff --git a/src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.test.tsx b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.test.tsx similarity index 95% rename from src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.test.tsx rename to src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.test.tsx index 45e636bff47..61dcacc003b 100644 --- a/src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.test.tsx +++ b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.test.tsx @@ -1,12 +1,13 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' +import { getDefaultSettings } from '../../../../../shared/constants' import { GeneralWorkspaceSettingsSection } from './GeneralWorkspaceSettingsSection' import type { ReactNode } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' vi.mock('./WorkspaceDirectorySetting', () => ({ WorkspaceDirectorySetting: () => null })) vi.mock('./OpenInMenuSetting', () => ({ OpenInMenuSetting: () => null })) diff --git a/src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.tsx b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx similarity index 97% rename from src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.tsx rename to src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx index f2c65e518b9..0805027781e 100644 --- a/src/renderer/src/components/settings/GeneralWorkspaceSettingsSection.tsx +++ b/src/renderer/src/components/settings/general/GeneralWorkspaceSettingsSection.tsx @@ -1,8 +1,8 @@ import type React from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { OpenInMenuSetting } from './OpenInMenuSetting' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader, SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader, SettingsSwitchRow } from '../form-controls/SettingsFormControls' import { WorkspaceDirectorySetting } from './WorkspaceDirectorySetting' import { translate } from '@/i18n/i18n' import { GlobalWorktreeVisibilitySourcesSetting } from './GlobalWorktreeVisibilitySourcesSetting' diff --git a/src/renderer/src/components/settings/GlobalWorktreeVisibilitySourcesSetting.tsx b/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/GlobalWorktreeVisibilitySourcesSetting.tsx rename to src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx index b660b25a3f3..c29b7788490 100644 --- a/src/renderer/src/components/settings/GlobalWorktreeVisibilitySourcesSetting.tsx +++ b/src/renderer/src/components/settings/general/GlobalWorktreeVisibilitySourcesSetting.tsx @@ -1,23 +1,24 @@ import { useCallback, useMemo, useRef, useState } from 'react' -import type { CustomWorktreeVisibilitySource } from '../../../../shared/repo-types' import type { - GlobalSettings, + CustomWorktreeVisibilitySource, WorktreeVisibilityDefaults -} from '../../../../shared/global-settings-types' +} from '../../../../../shared/repo-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' + import { MAX_CUSTOM_WORKTREE_VISIBILITY_SOURCES, normalizeCustomWorktreeVisibilitySources -} from '../../../../shared/worktree/visibility-sources' +} from '../../../../../shared/worktree/visibility-sources' import { buildDefaultWorktreeSourcePreferenceUpdate, removeDefaultCustomWorktreeSourcePreference -} from '../../../../shared/worktree/visibility-source-preferences' +} from '../../../../../shared/worktree/visibility-source-preferences' +import type { WorktreeVisibilitySourceAddResult } from '../../sidebar/WorktreeVisibilitySourceAddForm' import WorktreeVisibilitySourceList, { - type WorktreeVisibilitySourceAddResult, type WorktreeVisibilitySourceRow -} from '../sidebar/WorktreeVisibilitySourceList' +} from '../../sidebar/WorktreeVisibilitySourceList' import { translate } from '@/i18n/i18n' -import { createBrowserUuid } from '@/lib/browser-uuid' +import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/non-secure-context-uuid' type Props = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/OpenInMenuSetting.tsx b/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx similarity index 96% rename from src/renderer/src/components/settings/OpenInMenuSetting.tsx rename to src/renderer/src/components/settings/general/OpenInMenuSetting.tsx index b174d0611bf..7560e5ea49f 100644 --- a/src/renderer/src/components/settings/OpenInMenuSetting.tsx +++ b/src/renderer/src/components/settings/general/OpenInMenuSetting.tsx @@ -1,19 +1,19 @@ import type React from 'react' import { useState } from 'react' import { Check, ChevronDown, Pencil, Trash2 } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { OpenInApplication } from '../../../../shared/ui-chrome-types' -import { OPEN_IN_APPLICATIONS_MAX } from '../../../../shared/open-in-applications' -import { Button } from '../ui/button' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { OpenInApplication } from '../../../../../shared/ui-chrome-types' +import { OPEN_IN_APPLICATIONS_MAX } from '../../../../../shared/open-in-applications' +import { Button } from '../../ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuShortcut, DropdownMenuTrigger -} from '../ui/dropdown-menu' -import { Input } from '../ui/input' -import { Label } from '../ui/label' +} from '../../ui/dropdown-menu' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' import { cn } from '@/lib/utils' import { getOpenInAppPreset, @@ -23,7 +23,7 @@ import { type OpenInAppPreset } from '@/lib/open-in-app-catalog' import { translate } from '@/i18n/i18n' -import { createBrowserUuid } from '@/lib/browser-uuid' +import { createNonSecureContextUuid as createBrowserUuid } from '../../../../../shared/non-secure-context-uuid' type OpenInMenuSettingProps = { applications: OpenInApplication[] | undefined diff --git a/src/renderer/src/components/settings/WorkspaceDirectorySetting.test.tsx b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.test.tsx similarity index 94% rename from src/renderer/src/components/settings/WorkspaceDirectorySetting.test.tsx rename to src/renderer/src/components/settings/general/WorkspaceDirectorySetting.test.tsx index ea7b8242325..ed380673bf7 100644 --- a/src/renderer/src/components/settings/WorkspaceDirectorySetting.test.tsx +++ b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.test.tsx @@ -1,13 +1,14 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { WorkspaceDirectorySetting } from './WorkspaceDirectorySetting' -vi.mock('../sidebar/use-sidebar-host-scope-options', () => ({ +vi.mock('../../sidebar/use-sidebar-host-scope-options', () => ({ useSidebarHostScopeOptions: () => ({ hostOptions: [] }) })) diff --git a/src/renderer/src/components/settings/WorkspaceDirectorySetting.tsx b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx similarity index 92% rename from src/renderer/src/components/settings/WorkspaceDirectorySetting.tsx rename to src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx index 00d985639d7..c28f201cc27 100644 --- a/src/renderer/src/components/settings/WorkspaceDirectorySetting.tsx +++ b/src/renderer/src/components/settings/general/WorkspaceDirectorySetting.tsx @@ -1,26 +1,26 @@ import React, { useEffect, useId, useRef, useState } from 'react' import { FolderOpen, RotateCcw } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { getEffectiveHostSetting, getHostSettingOverride, setHostSettingOverride, clearHostSettingOverride -} from '../../../../shared/host-setting-overrides' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { HostCombobox } from '../host-picker/HostCombobox' -import { SearchableSetting } from './SearchableSetting' -import { useSidebarHostScopeOptions } from '../sidebar/use-sidebar-host-scope-options' +} from '../../../../../shared/host-setting-overrides' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' +import { HostCombobox } from '../../host-picker/HostCombobox' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { useSidebarHostScopeOptions } from '../../sidebar/use-sidebar-host-scope-options' import { isImeCompositionKeyDown } from '@/lib/ime-composition-keyboard-event' import { buildHostScopeChoices, CLIENT_DEFAULT_SCOPE, isHostScope, type HostSettingScope -} from './host-scoped-setting-scope' +} from '../host-scoped-setting-scope' import { translate } from '@/i18n/i18n' type WorkspaceDirectorySettingProps = { diff --git a/src/renderer/src/components/settings/general-search.ts b/src/renderer/src/components/settings/general/general-search.ts similarity index 96% rename from src/renderer/src/components/settings/general-search.ts rename to src/renderer/src/components/settings/general/general-search.ts index 4a03815ef02..72f503577ca 100644 --- a/src/renderer/src/components/settings/general-search.ts +++ b/src/renderer/src/components/settings/general/general-search.ts @@ -1,14 +1,11 @@ -import type { SettingsSearchEntry } from './settings-search' -import { getGeneralEditorSearchEntries } from './general-editor-search' +import type { SettingsSearchEntry } from '../search/settings-search' +import { getGeneralEditorSearchEntries } from '../editor/general-editor-search' import { translate } from '@/i18n/i18n' -import { searchKeywords, translateSearchKeyword } from './settings-search-keywords' +import { searchKeywords, translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { getGeneralProjectRuntimeSearchEntries } from './general-project-runtime-search' +import { getGeneralProjectRuntimeSearchEntries } from './project-runtime/general-project-runtime-search' import { getGeneralSupportSearchEntries } from './general-support-search' -import { getUpdateDelayDescription, getUpdateDelayTitle } from './update-delay-copy' - -export { getGeneralEditorSearchEntries } from './general-editor-search' -export { getGeneralSupportSearchEntries } from './general-support-search' +import { getUpdateDelayDescription, getUpdateDelayTitle } from '../updates/update-delay-copy' export const getGeneralWorkspaceSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/general-support-search.ts b/src/renderer/src/components/settings/general/general-support-search.ts similarity index 92% rename from src/renderer/src/components/settings/general-support-search.ts rename to src/renderer/src/components/settings/general/general-support-search.ts index fbc7af9a2bb..bdcbaa47ecc 100644 --- a/src/renderer/src/components/settings/general-support-search.ts +++ b/src/renderer/src/components/settings/general/general-support-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export const getGeneralSupportSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/DefaultWindowsProjectRuntimeSetting.tsx b/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx similarity index 94% rename from src/renderer/src/components/settings/DefaultWindowsProjectRuntimeSetting.tsx rename to src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx index a952e37eea8..e611405b291 100644 --- a/src/renderer/src/components/settings/DefaultWindowsProjectRuntimeSetting.tsx +++ b/src/renderer/src/components/settings/general/project-runtime/DefaultWindowsProjectRuntimeSetting.tsx @@ -1,8 +1,8 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { GlobalWindowsRuntimeDefault } from '../../../../shared/project-execution-runtime' -import { normalizeGlobalWindowsRuntimeDefault } from '../../../../shared/project-execution-runtime' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { GlobalWindowsRuntimeDefault } from '../../../../../../shared/project-execution-runtime' +import { normalizeGlobalWindowsRuntimeDefault } from '../../../../../../shared/project-execution-runtime' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' +import { SettingsRow, SettingsSegmentedControl } from '../../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' type DefaultRuntimeSegment = GlobalWindowsRuntimeDefault['kind'] diff --git a/src/renderer/src/components/settings/general-project-runtime-search.ts b/src/renderer/src/components/settings/general/project-runtime/general-project-runtime-search.ts similarity index 93% rename from src/renderer/src/components/settings/general-project-runtime-search.ts rename to src/renderer/src/components/settings/general/project-runtime/general-project-runtime-search.ts index 93d11a7029d..e07fe17dcc0 100644 --- a/src/renderer/src/components/settings/general-project-runtime-search.ts +++ b/src/renderer/src/components/settings/general/project-runtime/general-project-runtime-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' export const getGeneralProjectRuntimeSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/git-provider-api-budget-search.ts b/src/renderer/src/components/settings/git-provider-api-budget-search.ts index a875b239d53..aa6b45b945d 100644 --- a/src/renderer/src/components/settings/git-provider-api-budget-search.ts +++ b/src/renderer/src/components/settings/git-provider-api-budget-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getGitProviderApiBudgetSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/git-search.ts b/src/renderer/src/components/settings/git-search.ts index 7cbf49e2d9c..2b81c65583c 100644 --- a/src/renderer/src/components/settings/git-search.ts +++ b/src/renderer/src/components/settings/git-search.ts @@ -1,6 +1,6 @@ import { getAutoRenameBranchSearchEntries } from './auto-rename-branch-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getGitPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/InputPane.tsx b/src/renderer/src/components/settings/input/InputPane.tsx similarity index 91% rename from src/renderer/src/components/settings/InputPane.tsx rename to src/renderer/src/components/settings/input/InputPane.tsx index 286c7ebe351..8907d9a589a 100644 --- a/src/renderer/src/components/settings/InputPane.tsx +++ b/src/renderer/src/components/settings/input/InputPane.tsx @@ -1,10 +1,9 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { isDefaultPrimarySelectionMiddleClickPasteUserAgent } from '@/hooks/usePrimarySelectionPaste' import { translate } from '@/i18n/i18n' -export { getInputPaneSearchEntries } from './input-search' type InputPaneProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/input-search.ts b/src/renderer/src/components/settings/input/input-search.ts similarity index 95% rename from src/renderer/src/components/settings/input-search.ts rename to src/renderer/src/components/settings/input/input-search.ts index f756d0aedad..4075f3f7a61 100644 --- a/src/renderer/src/components/settings/input-search.ts +++ b/src/renderer/src/components/settings/input/input-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getInputPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/integrations-search.ts b/src/renderer/src/components/settings/integrations-search.ts index 8d8b6eff1f5..bf2137f5084 100644 --- a/src/renderer/src/components/settings/integrations-search.ts +++ b/src/renderer/src/components/settings/integrations-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getIntegrationsPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/linear-agent-skill-search.ts b/src/renderer/src/components/settings/linear-agent-skill-search.ts index 1eeda947034..c85f4017824 100644 --- a/src/renderer/src/components/settings/linear-agent-skill-search.ts +++ b/src/renderer/src/components/settings/linear-agent-skill-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getLinearAgentSkillPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/machine-name-search.ts b/src/renderer/src/components/settings/machine-name-search.ts index bde5a3fbce6..d4d944240e5 100644 --- a/src/renderer/src/components/settings/machine-name-search.ts +++ b/src/renderer/src/components/settings/machine-name-search.ts @@ -1,6 +1,6 @@ import { translate } from '@/i18n/i18n' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' export const getMachineNameSearchKeywords = createLocalizedCatalog(() => [ ...translateSearchKeyword( diff --git a/src/renderer/src/components/settings/mobile-emulator-search.ts b/src/renderer/src/components/settings/mobile-emulator-search.ts index 5d0fd5a1014..cde56e1753f 100644 --- a/src/renderer/src/components/settings/mobile-emulator-search.ts +++ b/src/renderer/src/components/settings/mobile-emulator-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getMobileEmulatorSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/mobile-pane-search.test.ts b/src/renderer/src/components/settings/mobile-pane-search.test.ts index 3ff80e28083..c5e003a0603 100644 --- a/src/renderer/src/components/settings/mobile-pane-search.test.ts +++ b/src/renderer/src/components/settings/mobile-pane-search.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { getMobilePaneSearchEntries, shouldOpenMobilePairingAddress } from './mobile-pane-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from './search/settings-search' describe('getMobilePaneSearchEntries', () => { it('keeps the shared machine-name entry searchable from the Mobile pane', () => { diff --git a/src/renderer/src/components/settings/mobile-pane-search.ts b/src/renderer/src/components/settings/mobile-pane-search.ts index 3ab73cea2c3..ca3d28d6ece 100644 --- a/src/renderer/src/components/settings/mobile-pane-search.ts +++ b/src/renderer/src/components/settings/mobile-pane-search.ts @@ -1,7 +1,7 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' -import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './settings-search' +import { matchesSettingsSearch, normalizeSettingsSearchQuery } from './search/settings-search' import { getMachineNameSearchEntries } from './machine-name-search' const getNetworkInterfaceSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/mobile-settings-search.ts b/src/renderer/src/components/settings/mobile-settings-search.ts index 3afa610f44b..1dc2b97c3b5 100644 --- a/src/renderer/src/components/settings/mobile-settings-search.ts +++ b/src/renderer/src/components/settings/mobile-settings-search.ts @@ -1,7 +1,7 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { getMobilePaneSearchEntries } from './mobile-pane-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getMobileOverviewSearchEntry = createLocalizedCatalog((): SettingsSearchEntry => ({ diff --git a/src/renderer/src/components/settings/SettingsSidebar.tsx b/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx similarity index 93% rename from src/renderer/src/components/settings/SettingsSidebar.tsx rename to src/renderer/src/components/settings/navigation/SettingsSidebar.tsx index d38b81ba9d0..4553474519d 100644 --- a/src/renderer/src/components/settings/SettingsSidebar.tsx +++ b/src/renderer/src/components/settings/navigation/SettingsSidebar.tsx @@ -1,23 +1,23 @@ import type { RefObject } from 'react' import { useMemo } from 'react' import { ArrowLeft, Search, Server } from 'lucide-react' -import type { RepoIcon } from '../../../../shared/repo-icon' +import type { RepoIcon } from '../../../../../shared/repo-icon' import type { SettingsNavIcon, SettingsNavInstallStatus } from '@/lib/settings-navigation-types' -import type { GitHubRepositoryIdentity } from '../../../../shared/github/pull-request-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GitHubRepositoryIdentity } from '../../../../../shared/github/pull-request-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { useShortcutKeyComboDetails } from '@/hooks/useShortcutLabel' -import { ShortcutKeyCombo } from '../ShortcutKeyCombo' +import { ShortcutKeyCombo } from '../../ShortcutKeyCombo' import { cn } from '@/lib/utils' -import { RepoIconGlyph } from '../repo/repo-icon' -import { RepoForkIndicator } from '../repo/repo-fork-indicator' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { SetupGuideProgressRing } from '../setup-guide/SetupGuideProgressRing' -import { useSettingsSetupGuideProgress } from './settings-setup-guide-progress' -import type { SettingsSetupGuideProgress } from './settings-setup-guide-progress' +import { RepoIconGlyph } from '../../repo/repo-icon' +import { RepoForkIndicator } from '../../repo/repo-fork-indicator' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { SetupGuideProgressRing } from '../../setup-guide/SetupGuideProgressRing' +import { useSettingsSetupGuideProgress } from '../setup-guide/settings-setup-guide-progress' +import type { SettingsSetupGuideProgress } from '../setup-guide/settings-setup-guide-progress' import { translate } from '@/i18n/i18n' import { resolveLeftSidebarStyleVariables } from '@/lib/left-sidebar-appearance' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' type NavSection = { id: string diff --git a/src/renderer/src/components/settings/settings-deep-link-target-watcher.test.ts b/src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.test.ts similarity index 99% rename from src/renderer/src/components/settings/settings-deep-link-target-watcher.test.ts rename to src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.test.ts index f3d87ee07c6..f807c8bbc8a 100644 --- a/src/renderer/src/components/settings/settings-deep-link-target-watcher.test.ts +++ b/src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.test.ts @@ -1,5 +1,6 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { afterEach, describe, expect, it, vi } from 'vitest' import { watchForSettingsDeepLinkTarget } from './settings-deep-link-target-watcher' diff --git a/src/renderer/src/components/settings/settings-deep-link-target-watcher.ts b/src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.ts similarity index 100% rename from src/renderer/src/components/settings/settings-deep-link-target-watcher.ts rename to src/renderer/src/components/settings/navigation/settings-deep-link-target-watcher.ts diff --git a/src/renderer/src/components/settings/settings-navigation-foundations.ts b/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts similarity index 92% rename from src/renderer/src/components/settings/settings-navigation-foundations.ts rename to src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts index 3c1aad085c7..f3305f9ae0a 100644 --- a/src/renderer/src/components/settings/settings-navigation-foundations.ts +++ b/src/renderer/src/components/settings/navigation/settings-navigation-foundations.ts @@ -1,9 +1,9 @@ import type { MutableRefObject } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { SpeechModelState } from '../../../../shared/speech-types' -import type { SourceControlAiSettings } from '../../../../shared/source-control-ai-types' -import { normalizeSourceControlAiSettings } from '../../../../shared/source-control-ai' -import { getDefaultVoiceSettings } from '../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { SpeechModelState } from '../../../../../shared/speech-types' +import type { SourceControlAiSettings } from '../../../../../shared/source-control-ai-types' +import { normalizeSourceControlAiSettings } from '../../../../../shared/source-control-ai' +import { getDefaultVoiceSettings } from '../../../../../shared/constants' import type { SettingsNavSection, SettingsNavTarget } from '@/lib/settings-navigation-types' import type { SettingsDeepLinkTargetWatch } from './settings-deep-link-target-watcher' diff --git a/src/renderer/src/components/settings/settings-project-list.test.ts b/src/renderer/src/components/settings/navigation/settings-project-list.test.ts similarity index 98% rename from src/renderer/src/components/settings/settings-project-list.test.ts rename to src/renderer/src/components/settings/navigation/settings-project-list.test.ts index 7d668a67084..96f17c30eb9 100644 --- a/src/renderer/src/components/settings/settings-project-list.test.ts +++ b/src/renderer/src/components/settings/navigation/settings-project-list.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it, vi } from 'vitest' -import type { ProjectHostSetup } from '../../../../shared/project-types' -import type { Repo } from '../../../../shared/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import { projectHostSetupProjectionFromRepos } from '../../../../shared/project-host-setup-projection' +import type { ProjectHostSetup } from '../../../../../shared/project-types' +import type { Repo } from '../../../../../shared/repo-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { projectHostSetupProjectionFromRepos } from '../../../../../shared/project-host-setup-projection' import { buildRepoIdToHostSelection, buildRepoIdToRepresentative, diff --git a/src/renderer/src/components/settings/settings-project-list.ts b/src/renderer/src/components/settings/navigation/settings-project-list.ts similarity index 95% rename from src/renderer/src/components/settings/settings-project-list.ts rename to src/renderer/src/components/settings/navigation/settings-project-list.ts index 261c40eb700..ca856d2ee68 100644 --- a/src/renderer/src/components/settings/settings-project-list.ts +++ b/src/renderer/src/components/settings/navigation/settings-project-list.ts @@ -1,18 +1,18 @@ -import type { Project, ProjectHostSetup } from '../../../../shared/project-types' -import type { Repo } from '../../../../shared/repo-types' +import type { Project, ProjectHostSetup } from '../../../../../shared/project-types' +import type { Repo } from '../../../../../shared/repo-types' import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID, type ExecutionHostId -} from '../../../../shared/execution-host' -import { projectHostSetupProjectionFromRepos } from '../../../../shared/project-host-setup-projection' -import { getRepoHostIdentityForParts } from '../../../../shared/repo-host-identity' -import { normalizeRuntimePathForComparison } from '../../../../shared/cross-platform-path' +} from '../../../../../shared/execution-host' +import { projectHostSetupProjectionFromRepos } from '../../../../../shared/project-host-setup-projection' +import { getRepoHostIdentityForParts } from '../../../../../shared/repo-host-identity' +import { normalizeRuntimePathForComparison } from '../../../../../shared/cross-platform-path' import { buildProjectGroupingIndex, isCheckoutScopedProjectSetup, type ProjectGroupingModel -} from '../../../../shared/project-section-grouping' +} from '../../../../../shared/project-section-grouping' export type SettingsProject = { projectId: string diff --git a/src/renderer/src/components/settings/settings-project-regrouping.test.ts b/src/renderer/src/components/settings/navigation/settings-project-regrouping.test.ts similarity index 96% rename from src/renderer/src/components/settings/settings-project-regrouping.test.ts rename to src/renderer/src/components/settings/navigation/settings-project-regrouping.test.ts index ce0e2bce67d..bbe14799a83 100644 --- a/src/renderer/src/components/settings/settings-project-regrouping.test.ts +++ b/src/renderer/src/components/settings/navigation/settings-project-regrouping.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../shared/repo-types' -import { createUIStore } from '../../store/slices/ui-slice-test-harness' +import { createUIStore } from '../../../store/slices/ui-slice-test-harness' import { buildSettingsProjectList, diff --git a/src/renderer/src/components/settings/use-settings-navigation-model.ts b/src/renderer/src/components/settings/navigation/use-settings-navigation-model.ts similarity index 93% rename from src/renderer/src/components/settings/use-settings-navigation-model.ts rename to src/renderer/src/components/settings/navigation/use-settings-navigation-model.ts index deb400bd5d3..c2639677365 100644 --- a/src/renderer/src/components/settings/use-settings-navigation-model.ts +++ b/src/renderer/src/components/settings/navigation/use-settings-navigation-model.ts @@ -8,12 +8,12 @@ import { getAgentSkillNavInstallStatus, getLinearAgentSkillNavInstallStatus } from '@/lib/agent-skill-nav-install-status' -import { getProjectHostSetupProjectionFromState } from '../../store/selectors' -import { getSettingsSectionSearchEntries, rankSettingsSearchItems } from './settings-search' -import { deriveNeededSectionIds } from './settings-load-performance' -import { SCROLLBACK_PRESETS_ROWS } from './SettingsConstants' -import type { SettingsStoreModel } from './use-settings-store-model' -import type { SettingsInteractionController } from './use-settings-interaction-controller' +import { getProjectHostSetupProjectionFromState } from '../../../store/project-host-setup-selector' +import { getSettingsSectionSearchEntries, rankSettingsSearchItems } from '../search/settings-search' +import { deriveNeededSectionIds } from '../page/settings-load-performance' +import { DESKTOP_TERMINAL_SCROLLBACK_ROW_PRESETS as SCROLLBACK_PRESETS_ROWS } from '../../../../../shared/terminal-scrollback-policy' +import type { SettingsStoreModel } from '../page/use-settings-store-model' +import type { SettingsInteractionController } from '../page/use-settings-interaction-controller' import { hasReadyVoiceModel } from './settings-navigation-foundations' export function useSettingsNavigationModel( diff --git a/src/renderer/src/components/settings/use-settings-repo-scroll-effects.test.tsx b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.test.tsx similarity index 97% rename from src/renderer/src/components/settings/use-settings-repo-scroll-effects.test.tsx rename to src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.test.tsx index 36c09b73766..2877f9bca72 100644 --- a/src/renderer/src/components/settings/use-settings-repo-scroll-effects.test.tsx +++ b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.test.tsx @@ -1,8 +1,9 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, renderHook, waitFor } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../shared/repo-types' import type { HookCheckResult } from '@/runtime/runtime-hooks-client' import { useSettingsRepoScrollEffects } from './use-settings-repo-scroll-effects' diff --git a/src/renderer/src/components/settings/use-settings-repo-scroll-effects.ts b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts similarity index 93% rename from src/renderer/src/components/settings/use-settings-repo-scroll-effects.ts rename to src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts index 8add1fb243b..eaa518da8c6 100644 --- a/src/renderer/src/components/settings/use-settings-repo-scroll-effects.ts +++ b/src/renderer/src/components/settings/navigation/use-settings-repo-scroll-effects.ts @@ -1,13 +1,13 @@ import { useEffect, useRef, useState } from 'react' -import type { OrcaHooks } from '../../../../shared/orca-yaml-hook-types' -import { isFolderRepo } from '../../../../shared/repo-kind' -import { getRepoExecutionHostId } from '../../../../shared/execution-host' +import type { OrcaHooks } from '../../../../../shared/orca-yaml-hook-types' +import { isFolderRepo } from '../../../../../shared/repo-kind' +import { getRepoExecutionHostId } from '../../../../../shared/execution-host' import { checkRuntimeHooks } from '@/runtime/runtime-hooks-client' -import { getRepoHostIdentity } from '../../store/slices/repo-host-identity' -import type { SettingsStoreModel } from './use-settings-store-model' -import type { SettingsInteractionController } from './use-settings-interaction-controller' +import { getRepoHostIdentity } from '../../../../../shared/repo-host-identity' +import type { SettingsStoreModel } from '../page/use-settings-store-model' +import type { SettingsInteractionController } from '../page/use-settings-interaction-controller' import type { SettingsNavigationModel } from './use-settings-navigation-model' -import type { SettingsTerminalModel } from './use-settings-terminal-model' +import type { SettingsTerminalModel } from '../page/use-settings-terminal-model' import { watchForSettingsDeepLinkTarget } from './settings-deep-link-target-watcher' import { cancelPendingSettingsDeepLinkTargetWatch, diff --git a/src/renderer/src/components/settings/nested-worker-depth-copy.ts b/src/renderer/src/components/settings/nested-worker-depth-copy.ts index 6f2754b637d..a5e407964e1 100644 --- a/src/renderer/src/components/settings/nested-worker-depth-copy.ts +++ b/src/renderer/src/components/settings/nested-worker-depth-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getNestedWorkerDepthTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/NotificationHostToggles.test.tsx b/src/renderer/src/components/settings/notifications/NotificationHostToggles.test.tsx similarity index 97% rename from src/renderer/src/components/settings/NotificationHostToggles.test.tsx rename to src/renderer/src/components/settings/notifications/NotificationHostToggles.test.tsx index fc7769c41eb..a56f3cf28d1 100644 --- a/src/renderer/src/components/settings/NotificationHostToggles.test.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationHostToggles.test.tsx @@ -1,7 +1,8 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { afterEach, describe, expect, it, vi } from 'vitest' import { cleanup, fireEvent, render } from '@testing-library/react' -import type { SidebarHostOption } from '../sidebar/sidebar-host-options' +import type { SidebarHostOption } from '../../sidebar/sidebar-host-options' import { NotificationHostToggles } from './NotificationHostToggles' const { hostOptions } = vi.hoisted(() => { diff --git a/src/renderer/src/components/settings/NotificationHostToggles.tsx b/src/renderer/src/components/settings/notifications/NotificationHostToggles.tsx similarity index 88% rename from src/renderer/src/components/settings/NotificationHostToggles.tsx rename to src/renderer/src/components/settings/notifications/NotificationHostToggles.tsx index 69fecf76b10..89e32da632b 100644 --- a/src/renderer/src/components/settings/NotificationHostToggles.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationHostToggles.tsx @@ -1,14 +1,14 @@ import { ChevronDown, Server } from 'lucide-react' -import type { NotificationSourceId } from '../../../../shared/notification-source' -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible' -import { Separator } from '../ui/separator' +import type { NotificationSourceId } from '../../../../../shared/notification-source' +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../ui/collapsible' +import { Separator } from '../../ui/separator' import { NotificationSettingToggle } from './NotificationSettingToggle' import { useNotificationSourceOptions } from './use-notification-source-options' -import { pickerExecutionHosts } from '../../../../shared/managed-orcad-execution-host' +import { pickerExecutionHosts } from '../../../../../shared/managed-orcad-execution-host' import { translate } from '@/i18n/i18n' -import { useBoundedHostRows } from '../host-picker/use-bounded-host-rows' -import { HostListSearchField } from '../host-picker/HostListSearchField' -import { HostListOverflowNote } from '../host-picker/HostListOverflowNote' +import { useBoundedHostRows } from '../../host-picker/use-bounded-host-rows' +import { HostListSearchField } from '../../host-picker/HostListSearchField' +import { HostListOverflowNote } from '../../host-picker/HostListOverflowNote' type NotificationHostTogglesProps = { mutedNotificationSourceIds: readonly NotificationSourceId[] diff --git a/src/renderer/src/components/settings/NotificationSettingToggle.tsx b/src/renderer/src/components/settings/notifications/NotificationSettingToggle.tsx similarity index 91% rename from src/renderer/src/components/settings/NotificationSettingToggle.tsx rename to src/renderer/src/components/settings/notifications/NotificationSettingToggle.tsx index 7b551610114..25ec220c7c5 100644 --- a/src/renderer/src/components/settings/NotificationSettingToggle.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationSettingToggle.tsx @@ -1,6 +1,6 @@ import type { ReactNode } from 'react' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' export type NotificationSettingToggleProps = { label: string diff --git a/src/renderer/src/components/settings/NotificationSoundSection.tsx b/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx similarity index 97% rename from src/renderer/src/components/settings/NotificationSoundSection.tsx rename to src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx index e90489741ae..56dcec5beb9 100644 --- a/src/renderer/src/components/settings/NotificationSoundSection.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationSoundSection.tsx @@ -1,8 +1,8 @@ import { useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Label } from '../ui/label' -import { Slider } from '../ui/slider' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Label } from '../../ui/label' +import { Slider } from '../../ui/slider' import { Select, SelectContent, @@ -10,7 +10,7 @@ import { SelectSeparator, SelectTrigger, SelectValue -} from '../ui/select' +} from '../../ui/select' import { FileAudio, Upload, Volume2 } from 'lucide-react' import { getNotificationSoundOptions } from '@/components/notification-sound-options' import { useMountedRef } from '@/hooks/useMountedRef' diff --git a/src/renderer/src/components/settings/NotificationsPane.test.tsx b/src/renderer/src/components/settings/notifications/NotificationsPane.test.tsx similarity index 87% rename from src/renderer/src/components/settings/NotificationsPane.test.tsx rename to src/renderer/src/components/settings/notifications/NotificationsPane.test.tsx index f60d351490f..131f16e745c 100644 --- a/src/renderer/src/components/settings/NotificationsPane.test.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationsPane.test.tsx @@ -1,10 +1,10 @@ -import { createGlobalSettingsFixture } from '../../../../shared/global-settings-test-fixture' +import { createGlobalSettingsFixture } from '../../../../../shared/global-settings-test-fixture' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { NotificationDispatchRequest } from '../../../../shared/notification-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { NotificationDispatchRequest } from '../../../../../shared/notification-settings-types' -import { sendNotificationSettingsTestNotification } from './NotificationsPane' +import { sendNotificationSettingsTestNotification } from './notification-settings-copy' const { toastError, toastMessage, toastSuccess } = vi.hoisted(() => ({ toastError: vi.fn(), diff --git a/src/renderer/src/components/settings/NotificationsPane.tsx b/src/renderer/src/components/settings/notifications/NotificationsPane.tsx similarity index 95% rename from src/renderer/src/components/settings/NotificationsPane.tsx rename to src/renderer/src/components/settings/notifications/NotificationsPane.tsx index 94e66d584a1..47858051172 100644 --- a/src/renderer/src/components/settings/NotificationsPane.tsx +++ b/src/renderer/src/components/settings/notifications/NotificationsPane.tsx @@ -1,9 +1,9 @@ import { useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Button } from '../ui/button' -import { Separator } from '../ui/separator' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Button } from '../../ui/button' +import { Separator } from '../../ui/separator' import { BellRing, Bot, EyeOff, MessageCircleQuestion, Siren } from 'lucide-react' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { MacNotificationPermissionCard, useMacNotificationPermissionState @@ -17,12 +17,6 @@ import { sendNotificationSettingsTestNotification } from './notification-settings-copy' import { translate } from '@/i18n/i18n' -export { getNotificationsPaneSearchEntries } from './notifications-search' -export { - createNotificationVolumeDraftState, - resolveNotificationVolumeDraftState, - sendNotificationSettingsTestNotification -} from './notification-settings-copy' type NotificationsPaneProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/notification-host-pending-save.test.tsx b/src/renderer/src/components/settings/notifications/notification-host-pending-save.test.tsx similarity index 87% rename from src/renderer/src/components/settings/notification-host-pending-save.test.tsx rename to src/renderer/src/components/settings/notifications/notification-host-pending-save.test.tsx index 479c2656720..0e9a81442a4 100644 --- a/src/renderer/src/components/settings/notification-host-pending-save.test.tsx +++ b/src/renderer/src/components/settings/notifications/notification-host-pending-save.test.tsx @@ -1,10 +1,11 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { afterEach, expect, it, vi } from 'vitest' import { act } from 'react' import { createRoot } from 'react-dom/client' -import { createGlobalSettingsFixture } from '../../../../shared/global-settings-test-fixture' -import { buildExecutionHostRegistry } from '../../../../shared/execution-host-registry' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { createGlobalSettingsFixture } from '../../../../../shared/global-settings-test-fixture' +import { buildExecutionHostRegistry } from '../../../../../shared/execution-host-registry' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { NotificationsPane } from './NotificationsPane' vi.mock('./use-notification-source-options', () => ({ diff --git a/src/renderer/src/components/settings/notification-settings-copy.ts b/src/renderer/src/components/settings/notifications/notification-settings-copy.ts similarity index 98% rename from src/renderer/src/components/settings/notification-settings-copy.ts rename to src/renderer/src/components/settings/notifications/notification-settings-copy.ts index c2e74c0e063..3dccd58edf2 100644 --- a/src/renderer/src/components/settings/notification-settings-copy.ts +++ b/src/renderer/src/components/settings/notifications/notification-settings-copy.ts @@ -1,5 +1,5 @@ import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' type SystemNotificationSettingsCopy = { diff --git a/src/renderer/src/components/settings/notifications-search.ts b/src/renderer/src/components/settings/notifications/notifications-search.ts similarity index 99% rename from src/renderer/src/components/settings/notifications-search.ts rename to src/renderer/src/components/settings/notifications/notifications-search.ts index b5f1de5a64c..d97014dcb9f 100644 --- a/src/renderer/src/components/settings/notifications-search.ts +++ b/src/renderer/src/components/settings/notifications/notifications-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getNotificationsPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/use-notification-source-options.ts b/src/renderer/src/components/settings/notifications/use-notification-source-options.ts similarity index 93% rename from src/renderer/src/components/settings/use-notification-source-options.ts rename to src/renderer/src/components/settings/notifications/use-notification-source-options.ts index 57c7d37c3e3..d8567cd1e55 100644 --- a/src/renderer/src/components/settings/use-notification-source-options.ts +++ b/src/renderer/src/components/settings/notifications/use-notification-source-options.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' import { useShallow } from 'zustand/react/shallow' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { buildNotificationSourceOptions } from '@/attention/notification-sources' export function useNotificationSourceOptions() { diff --git a/src/renderer/src/components/settings/orca-account-settings-search.ts b/src/renderer/src/components/settings/orca-account-settings-search.ts index c19c010b59c..2544ca47c99 100644 --- a/src/renderer/src/components/settings/orca-account-settings-search.ts +++ b/src/renderer/src/components/settings/orca-account-settings-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' export const getOrcaAccountSettingsSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts b/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts index 58412808ab3..f6af36636e8 100644 --- a/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts +++ b/src/renderer/src/components/settings/orchestration-panel-experimental-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getOrchestrationPanelExperimentalSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/orchestration-search.ts b/src/renderer/src/components/settings/orchestration-search.ts index 92ff6e248a7..a538bc58213 100644 --- a/src/renderer/src/components/settings/orchestration-search.ts +++ b/src/renderer/src/components/settings/orchestration-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { getNestedWorkerDepthDescription, diff --git a/src/renderer/src/components/settings/orca-logo-settings-icon.tsx b/src/renderer/src/components/settings/page/orca-logo-settings-icon.tsx similarity index 86% rename from src/renderer/src/components/settings/orca-logo-settings-icon.tsx rename to src/renderer/src/components/settings/page/orca-logo-settings-icon.tsx index fffef8e1615..3cbc2c97755 100644 --- a/src/renderer/src/components/settings/orca-logo-settings-icon.tsx +++ b/src/renderer/src/components/settings/page/orca-logo-settings-icon.tsx @@ -1,6 +1,6 @@ import { createElement } from 'react' import type { LucideProps } from 'lucide-react' -import logo from '../../../../../resources/logo.svg' +import logo from '../../../../../../resources/logo.svg' import { cn } from '@/lib/utils' export function OrcaLogoSettingsIcon({ className }: LucideProps): React.JSX.Element { diff --git a/src/renderer/src/components/settings/setting-ownership.ts b/src/renderer/src/components/settings/page/setting-ownership.ts similarity index 100% rename from src/renderer/src/components/settings/setting-ownership.ts rename to src/renderer/src/components/settings/page/setting-ownership.ts diff --git a/src/renderer/src/components/settings/settings-advanced-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-advanced-section-renderers.tsx similarity index 89% rename from src/renderer/src/components/settings/settings-advanced-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-advanced-section-renderers.tsx index de76f09f61a..82cc52f9bc6 100644 --- a/src/renderer/src/components/settings/settings-advanced-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-advanced-section-renderers.tsx @@ -1,13 +1,15 @@ import { lazy, Suspense } from 'react' -import { AdvancedPane } from './AdvancedPane' -import { ExperimentalPane } from './ExperimentalPane' -import { PluginsSettingsSection } from './PluginsSettingsSection' -import { SettingsSection } from './SettingsSection' +import { AdvancedPane } from '../advanced/AdvancedPane' +import { ExperimentalPane } from '../advanced/ExperimentalPane' +import { PluginsSettingsSection } from '../PluginsSettingsSection' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' const DevToolsPane = import.meta.env.DEV - ? lazy(() => import('./DevToolsPane').then((module) => ({ default: module.DevToolsPane }))) + ? lazy(() => + import('../advanced/DevToolsPane').then((module) => ({ default: module.DevToolsPane })) + ) : null export function renderAdvancedSettingsSection( diff --git a/src/renderer/src/components/settings/settings-capability-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-capability-section-renderers.tsx similarity index 92% rename from src/renderer/src/components/settings/settings-capability-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-capability-section-renderers.tsx index 6f938ec636f..c0586ce7cd7 100644 --- a/src/renderer/src/components/settings/settings-capability-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-capability-section-renderers.tsx @@ -1,14 +1,14 @@ -import { AccountsPane } from './AccountsPane' +import { AccountsPane } from '../AccountsPane' import { getProviderAccountsOwnerKey } from '@/runtime/runtime-provider-accounts-client' -import { AgentsPane } from './AgentsPane' -import { AgentDefaultSurfaceSection } from './AgentDefaultSurfaceSection' -import { ComputerUsePane } from './ComputerUsePane' -import { LinearAgentSkillPane } from './LinearAgentSkillPane' -import { OrchestrationPane } from './OrchestrationPane' -import { VoicePane } from './VoicePane' -import { SettingsSection } from './SettingsSection' -import { SettingsHostScopeUnavailableNotice } from './SettingsHostScopePicker' -import { LOCAL_SETTINGS_HOST_SCOPE } from './settings-host-scope' +import { AgentsPane } from '../AgentsPane' +import { AgentDefaultSurfaceSection } from '../AgentDefaultSurfaceSection' +import { ComputerUsePane } from '../ComputerUsePane' +import { LinearAgentSkillPane } from '../LinearAgentSkillPane' +import { OrchestrationPane } from '../OrchestrationPane' +import { VoicePane } from '../voice/VoicePane' +import { SettingsSection } from '../section-layout/SettingsSection' +import { SettingsHostScopeUnavailableNotice } from '../SettingsHostScopePicker' +import { LOCAL_SETTINGS_HOST_SCOPE } from '../settings-host-scope' import { wslHostDistroForTarget } from '@/lib/wsl-host-account-owner' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-content-scroll-element.tsx b/src/renderer/src/components/settings/page/settings-content-scroll-element.tsx similarity index 100% rename from src/renderer/src/components/settings/settings-content-scroll-element.tsx rename to src/renderer/src/components/settings/page/settings-content-scroll-element.tsx diff --git a/src/renderer/src/components/settings/settings-git-task-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx similarity index 90% rename from src/renderer/src/components/settings/settings-git-task-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx index 9fa2e941ef7..c12b270b3ab 100644 --- a/src/renderer/src/components/settings/settings-git-task-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-git-task-section-renderers.tsx @@ -1,8 +1,8 @@ -import { CommitMessageAiPane } from './CommitMessageAiPane' -import { GitPane } from './GitPane' -import { GitProviderApiBudgetPane } from './GitProviderApiBudgetPane' -import { TasksPane } from './TasksPane' -import { SettingsSection } from './SettingsSection' +import { CommitMessageAiPane } from '../CommitMessageAiPane' +import { GitPane } from '../GitPane' +import { GitProviderApiBudgetPane } from '../GitProviderApiBudgetPane' +import { TasksPane } from '../TasksPane' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-interface-primary-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-interface-primary-section-renderers.tsx similarity index 91% rename from src/renderer/src/components/settings/settings-interface-primary-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-interface-primary-section-renderers.tsx index ed611a53f8f..c9ecd4c038c 100644 --- a/src/renderer/src/components/settings/settings-interface-primary-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-interface-primary-section-renderers.tsx @@ -1,9 +1,9 @@ -import { BrowserPane } from './BrowserPane' -import { FloatingWorkspacePane } from './FloatingWorkspacePane' -import { MobileEmulatorSettingsPane } from './MobileEmulatorSettingsPane' -import { QuickCommandsPane } from './QuickCommandsPane' -import { TerminalPane } from './TerminalPane' -import { SettingsSection } from './SettingsSection' +import { BrowserPane } from '../browser/BrowserPane' +import { FloatingWorkspacePane } from '../floating-workspaces/FloatingWorkspacePane' +import { MobileEmulatorSettingsPane } from '../MobileEmulatorSettingsPane' +import { QuickCommandsPane } from '../quick-commands/QuickCommandsPane' +import { TerminalPane } from '../terminal/TerminalPane' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-interface-secondary-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-interface-secondary-section-renderers.tsx similarity index 92% rename from src/renderer/src/components/settings/settings-interface-secondary-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-interface-secondary-section-renderers.tsx index 6677179b87f..c9451b51412 100644 --- a/src/renderer/src/components/settings/settings-interface-secondary-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-interface-secondary-section-renderers.tsx @@ -1,10 +1,10 @@ -import { StatsPane } from '../stats/StatsPane' -import { AppearancePane } from './AppearancePane' -import { ChatSettingsSection } from './ChatSettingsSection' -import { InputPane } from './InputPane' -import { NotificationsPane } from './NotificationsPane' -import { ShortcutsPane } from './ShortcutsPane' -import { SettingsSection } from './SettingsSection' +import { StatsPane } from '../../stats/StatsPane' +import { AppearancePane } from '../appearance/AppearancePane' +import { ChatSettingsSection } from '../chat/ChatSettingsSection' +import { InputPane } from '../input/InputPane' +import { NotificationsPane } from '../notifications/NotificationsPane' +import { ShortcutsPane } from '../shortcuts/ShortcutsPane' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-load-performance.ts b/src/renderer/src/components/settings/page/settings-load-performance.ts similarity index 100% rename from src/renderer/src/components/settings/settings-load-performance.ts rename to src/renderer/src/components/settings/page/settings-load-performance.ts diff --git a/src/renderer/src/components/settings/settings-page-renderer.tsx b/src/renderer/src/components/settings/page/settings-page-renderer.tsx similarity index 96% rename from src/renderer/src/components/settings/settings-page-renderer.tsx rename to src/renderer/src/components/settings/page/settings-page-renderer.tsx index ddaeab332c9..324dc9ed4a6 100644 --- a/src/renderer/src/components/settings/settings-page-renderer.tsx +++ b/src/renderer/src/components/settings/page/settings-page-renderer.tsx @@ -1,7 +1,7 @@ -import { ActiveSettingsSectionProvider } from './SettingsSection' +import { ActiveSettingsSectionProvider } from '../section-layout/SettingsSection' import { SettingsContentScrollElementProvider } from './settings-content-scroll-element' -import { SettingsSidebar } from './SettingsSidebar' -import { PluginInstallTrustDialogHost } from '../plugins/dialogs/PluginInstallTrustDialog' +import { SettingsSidebar } from '../navigation/SettingsSidebar' +import { PluginInstallTrustDialogHost } from '../../plugins/dialogs/PluginInstallTrustDialog' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import type { SettingsInteractionController } from './use-settings-interaction-controller' @@ -59,7 +59,7 @@ import { renderProjectSettingsSections } from './settings-project-section-render import { SettingsHostScopePicker, shouldShowSettingsHostScopePicker -} from './SettingsHostScopePicker' +} from '../SettingsHostScopePicker' export function renderSettingsLoading( interactions: SettingsInteractionController diff --git a/src/renderer/src/components/settings/settings-project-section-renderer.tsx b/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx similarity index 89% rename from src/renderer/src/components/settings/settings-project-section-renderer.tsx rename to src/renderer/src/components/settings/page/settings-project-section-renderer.tsx index 42608160b5f..b776acf6f7e 100644 --- a/src/renderer/src/components/settings/settings-project-section-renderer.tsx +++ b/src/renderer/src/components/settings/page/settings-project-section-renderer.tsx @@ -1,12 +1,15 @@ -import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' -import { getRepoHostIdentity } from '../../store/slices/repo-host-identity' -import { RepositoryPane } from './repository/RepositoryPane' -import { SettingsSection } from './SettingsSection' +import { + getRepoExecutionHostId, + LOCAL_EXECUTION_HOST_ID +} from '../../../../../shared/execution-host' +import { getRepoHostIdentity } from '../../../../../shared/repo-host-identity' +import { RepositoryPane } from '../repository/RepositoryPane' +import { SettingsSection } from '../section-layout/SettingsSection' import { getSettingsEntryHostSelection, getSettingsProjectHostRepo, getSettingsProjectRemovalScope -} from './settings-project-list' +} from '../navigation/settings-project-list' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-remote-security-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-remote-security-section-renderers.tsx similarity index 89% rename from src/renderer/src/components/settings/settings-remote-security-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-remote-security-section-renderers.tsx index d47d43e29df..39a8cce78b7 100644 --- a/src/renderer/src/components/settings/settings-remote-security-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-remote-security-section-renderers.tsx @@ -1,11 +1,11 @@ -import { DeveloperPermissionsPane } from './DeveloperPermissionsPane' -import { PrivacyPane } from './PrivacyPane' -import { RuntimeEnvironmentsPane } from './RuntimeEnvironmentsPane' -import { RuntimeServersHeaderActions } from './runtime-servers-header-actions' -import { RuntimeServersPageProvider } from './runtime-servers-page-context' -import { SshPane } from './SshPane' -import { SshHostsHeaderSlot, SshHostsHeaderSlotProvider } from './ssh-hosts-header-slot' -import { SettingsSection } from './SettingsSection' +import { DeveloperPermissionsPane } from '../developer-permissions/DeveloperPermissionsPane' +import { PrivacyPane } from '../privacy/PrivacyPane' +import { RuntimeEnvironmentsPane } from '../RuntimeEnvironmentsPane' +import { RuntimeServersHeaderActions } from '../runtime-servers-header-actions' +import { RuntimeServersPageProvider } from '../runtime-servers-page-context' +import { SshPane } from '../SshPane' +import { SshHostsHeaderSlot, SshHostsHeaderSlotProvider } from '../ssh-hosts-header-slot' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-render-context.ts b/src/renderer/src/components/settings/page/settings-render-context.ts similarity index 79% rename from src/renderer/src/components/settings/settings-render-context.ts rename to src/renderer/src/components/settings/page/settings-render-context.ts index 36ad7068d7d..00b75fed9e6 100644 --- a/src/renderer/src/components/settings/settings-render-context.ts +++ b/src/renderer/src/components/settings/page/settings-render-context.ts @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import type { SettingsStoreModel } from './use-settings-store-model' import type { SettingsInteractionController } from './use-settings-interaction-controller' -import type { SettingsNavigationModel } from './use-settings-navigation-model' +import type { SettingsNavigationModel } from '../navigation/use-settings-navigation-model' import type { SettingsTerminalModel } from './use-settings-terminal-model' import type { SettingsNavigationActions, SettingsViewModel } from './settings-view-model' diff --git a/src/renderer/src/components/settings/settings-setup-workflow-section-renderers.tsx b/src/renderer/src/components/settings/page/settings-setup-workflow-section-renderers.tsx similarity index 91% rename from src/renderer/src/components/settings/settings-setup-workflow-section-renderers.tsx rename to src/renderer/src/components/settings/page/settings-setup-workflow-section-renderers.tsx index 3debfb54a78..1b60e3a9dbd 100644 --- a/src/renderer/src/components/settings/settings-setup-workflow-section-renderers.tsx +++ b/src/renderer/src/components/settings/page/settings-setup-workflow-section-renderers.tsx @@ -1,13 +1,13 @@ -import { SessionHistorySettingsPane } from './SessionHistorySettingsPane' -import { ArtifactsSettingsPane } from './ArtifactsSettingsPane' -import { AutomationsSettingsPane } from './AutomationsSettingsPane' -import { GeneralPane } from './GeneralPane' -import { IntegrationsPane } from './IntegrationsPane' -import { MobileSettingsPane } from './MobileSettingsPane' -import { OrcaAccountSettingsPane } from './OrcaAccountSettingsPane' -import { SettingsSetupGuidePane } from './SettingsSetupGuidePane' -import { ShareSkillsSettingsPane } from './ShareSkillsSettingsPane' -import { SettingsSection } from './SettingsSection' +import { SessionHistorySettingsPane } from '../session-history/SessionHistorySettingsPane' +import { ArtifactsSettingsPane } from '../artifacts/ArtifactsSettingsPane' +import { AutomationsSettingsPane } from '../automations/AutomationsSettingsPane' +import { GeneralPane } from '../general/GeneralPane' +import { IntegrationsPane } from '../IntegrationsPane' +import { MobileSettingsPane } from '../MobileSettingsPane' +import { OrcaAccountSettingsPane } from '../OrcaAccountSettingsPane' +import { SettingsSetupGuidePane } from '../setup-guide/SettingsSetupGuidePane' +import { ShareSkillsSettingsPane } from '../ShareSkillsSettingsPane' +import { SettingsSection } from '../section-layout/SettingsSection' import { translate } from '@/i18n/i18n' import type { SettingsRenderContext } from './settings-render-context' diff --git a/src/renderer/src/components/settings/settings-view-model.ts b/src/renderer/src/components/settings/page/settings-view-model.ts similarity index 95% rename from src/renderer/src/components/settings/settings-view-model.ts rename to src/renderer/src/components/settings/page/settings-view-model.ts index 4497e780606..8c4b636b6db 100644 --- a/src/renderer/src/components/settings/settings-view-model.ts +++ b/src/renderer/src/components/settings/page/settings-view-model.ts @@ -3,8 +3,8 @@ import type { SettingsNavGroup } from '@/lib/settings-navigation-types' import { translate } from '@/i18n/i18n' import type { SettingsStoreModel } from './use-settings-store-model' import type { SettingsInteractionController } from './use-settings-interaction-controller' -import type { SettingsNavigationModel } from './use-settings-navigation-model' -import { getSettingsNavGroupDefinitionsForSearch } from './settings-navigation-foundations' +import type { SettingsNavigationModel } from '../navigation/use-settings-navigation-model' +import { getSettingsNavGroupDefinitionsForSearch } from '../navigation/settings-navigation-foundations' export function useSettingsNavigationActions( model: Pick< diff --git a/src/renderer/src/components/settings/use-settings-interaction-controller.ts b/src/renderer/src/components/settings/page/use-settings-interaction-controller.ts similarity index 94% rename from src/renderer/src/components/settings/use-settings-interaction-controller.ts rename to src/renderer/src/components/settings/page/use-settings-interaction-controller.ts index bb87f6cd2f9..574c41f164c 100644 --- a/src/renderer/src/components/settings/use-settings-interaction-controller.ts +++ b/src/renderer/src/components/settings/page/use-settings-interaction-controller.ts @@ -1,17 +1,20 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import type { SourceControlAiSettingsPatch } from '../../../../shared/source-control-ai-types' -import { useAppStore } from '../../store' +import type { SourceControlAiSettingsPatch } from '../../../../../shared/source-control-ai-types' +import { useAppStore } from '../../../store/index' import { translate } from '@/i18n/i18n' -import { mergeFontSuggestions } from './SettingsConstants' -import { listInstalledFontFamilies, setInstalledFontsUnavailable } from './installed-font-list' +import { mergeFontSuggestions } from '../appearance/fonts/font-suggestions' +import { + listInstalledFontFamilies, + setInstalledFontsUnavailable +} from '../appearance/fonts/installed-font-list' import type { SettingsStoreModel } from './use-settings-store-model' -import type { SettingsDeepLinkTargetWatch } from './settings-deep-link-target-watcher' +import type { SettingsDeepLinkTargetWatch } from '../navigation/settings-deep-link-target-watcher' import { cancelPendingSettingsDeepLinkTargetWatch, cancelPendingSettingsSubsectionScrollFrame, readSourceControlAiSettings, SETTINGS_TARGET_HIGHLIGHT_MS -} from './settings-navigation-foundations' +} from '../navigation/settings-navigation-foundations' export type SettingsInteractionModel = Pick< SettingsStoreModel, diff --git a/src/renderer/src/components/settings/use-settings-page-effects.ts b/src/renderer/src/components/settings/page/use-settings-page-effects.ts similarity index 94% rename from src/renderer/src/components/settings/use-settings-page-effects.ts rename to src/renderer/src/components/settings/page/use-settings-page-effects.ts index e66ba97541b..5d9289a7e44 100644 --- a/src/renderer/src/components/settings/use-settings-page-effects.ts +++ b/src/renderer/src/components/settings/page/use-settings-page-effects.ts @@ -1,9 +1,9 @@ import { useEffect } from 'react' import { toast } from 'sonner' -import { useAppStore } from '../../store' -import { keybindingMatchesAction } from '../../../../shared/keybindings' -import { resolveAppearanceAccordionDeepLink } from './appearance-usage-percentage-search' -import { registerWindowCloseGuard } from '../window-close-request-coordinator' +import { useAppStore } from '../../../store/index' +import { keybindingMatchesAction } from '../../../../../shared/keybindings/matching' +import { resolveAppearanceAccordionDeepLink } from '../appearance/appearance-usage-percentage-search' +import { registerWindowCloseGuard } from '../../window-close-request-coordinator' import { isIntentionalAppRestartInProgress } from '@/lib/updater-beforeunload' import { getShortcutPlatform } from '@/lib/shortcut-platform' import { hasVisibleOverlay } from '@/lib/visible-overlay' @@ -11,14 +11,14 @@ import { translate } from '@/i18n/i18n' import { getSettingsTargetHostSelection, resolveSettingsTargetRepoId -} from './settings-project-list' +} from '../navigation/settings-project-list' import type { SettingsStoreModel } from './use-settings-store-model' import type { SettingsInteractionController } from './use-settings-interaction-controller' import { getSettingsSectionId, SHORTCUTS_ESCAPE_CONFIRM_TOAST_ID, SHORTCUTS_ESCAPE_CONFIRM_WINDOW_MS -} from './settings-navigation-foundations' +} from '../navigation/settings-navigation-foundations' export function useSettingsPageEffects( model: SettingsStoreModel, diff --git a/src/renderer/src/components/settings/use-settings-store-model.ts b/src/renderer/src/components/settings/page/use-settings-store-model.ts similarity index 93% rename from src/renderer/src/components/settings/use-settings-store-model.ts rename to src/renderer/src/components/settings/page/use-settings-store-model.ts index 63bdc4c6ed7..150c8f4d1fd 100644 --- a/src/renderer/src/components/settings/use-settings-store-model.ts +++ b/src/renderer/src/components/settings/page/use-settings-store-model.ts @@ -1,13 +1,13 @@ import { useCallback, useMemo, useState } from 'react' -import type { OrcaHooks } from '../../../../shared/orca-yaml-hook-types' -import type { ProjectHostSetup } from '../../../../shared/project-types' -import { DEFAULT_APP_FONT_FAMILY } from '../../../../shared/constants' -import { useAppStore } from '../../store' +import type { OrcaHooks } from '../../../../../shared/orca-yaml-hook-types' +import type { ProjectHostSetup } from '../../../../../shared/project-types' +import { DEFAULT_APP_FONT_FAMILY } from '../../../../../shared/constants' +import { useAppStore } from '../../../store/index' import { useProjectHostSetupProjection } from '@/store/selectors' import { useSystemPrefersDark } from '@/components/terminal-pane/use-system-prefers-dark' import { isMacUserAgent, isWindowsUserAgent } from '@/components/terminal-pane/pane-helpers' import { useConfirmationDialog } from '@/components/confirmation-dialog-context' -import { isWebClientLocation } from '@/hooks/useSettingsNavigationMetadata' +import { isWebClientLocation } from '@/lib/web-client-location' import { COMPUTER_USE_SKILL_NAME, LINEAR_AGENT_SKILL_NAMES, @@ -21,18 +21,21 @@ import { import { useActiveProjectSkillRuntime } from '@/hooks/useActiveProjectSkillRuntime' import { useLinearProviderConnected } from '@/hooks/useLinearProviderConnected' import { useSkillFreshness } from '@/hooks/useSkillFreshness' -import { getFallbackTerminalFonts, mergeFontSuggestions } from './SettingsConstants' -import { useTerminalConfigImport } from './useTerminalConfigImport' -import { useWarpThemeImport } from './useWarpThemeImport' +import { + getFallbackTerminalFonts, + mergeFontSuggestions +} from '../appearance/fonts/font-suggestions' +import { useTerminalConfigImport } from '../terminal/configuration/useTerminalConfigImport' +import { useWarpThemeImport } from '../terminal/themes/useWarpThemeImport' import { getInitialMountedSectionIds } from './settings-load-performance' import { buildRepoIdToHostSelection, buildRepoIdToRepresentative, buildSettingsProjectList, removeSettingsProjectFromAllHosts -} from './settings-project-list' -import { resolveSettingsHostScope } from './settings-host-scope' -import { useSettingsHostNavigation } from './use-settings-host-navigation' +} from '../navigation/settings-project-list' +import { resolveSettingsHostScope } from '../settings-host-scope' +import { useSettingsHostNavigation } from '../use-settings-host-navigation' import { defaultScopeHost } from '@/lib/default-creation-host' import { blockRemovalForUnsavedFiles, diff --git a/src/renderer/src/components/settings/use-settings-terminal-model.ts b/src/renderer/src/components/settings/page/use-settings-terminal-model.ts similarity index 93% rename from src/renderer/src/components/settings/use-settings-terminal-model.ts rename to src/renderer/src/components/settings/page/use-settings-terminal-model.ts index a7cbbe92146..726eaa68614 100644 --- a/src/renderer/src/components/settings/use-settings-terminal-model.ts +++ b/src/renderer/src/components/settings/page/use-settings-terminal-model.ts @@ -1,15 +1,18 @@ import { useMemo } from 'react' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../shared/repo-types' import { isWindowsTerminalCapabilityHost, useLocalWindowsTerminalCapabilities, useWindowsTerminalCapabilities } from '@/lib/windows-terminal-capabilities' import { useWindowsTerminalCapabilityOwnerKey } from '@/hooks/useWindowsTerminalCapabilityOwnerKey' -import { getRepoHostIdentity } from '../../store/slices/repo-host-identity' -import { getSettingsEntryHostSelection, getSettingsProjectHostRepo } from './settings-project-list' +import { getRepoHostIdentity } from '../../../../../shared/repo-host-identity' +import { + getSettingsEntryHostSelection, + getSettingsProjectHostRepo +} from '../navigation/settings-project-list' import type { SettingsStoreModel } from './use-settings-store-model' -import type { SettingsNavigationModel } from './use-settings-navigation-model' +import type { SettingsNavigationModel } from '../navigation/use-settings-navigation-model' import { runtimeTargetEnvironmentId } from '@/runtime/runtime-client-target' export function useSettingsTerminalModel( diff --git a/src/renderer/src/components/settings/plugins-search.ts b/src/renderer/src/components/settings/plugins/plugins-search.ts similarity index 95% rename from src/renderer/src/components/settings/plugins-search.ts rename to src/renderer/src/components/settings/plugins/plugins-search.ts index 7d1e568cdf3..22a29da8f16 100644 --- a/src/renderer/src/components/settings/plugins-search.ts +++ b/src/renderer/src/components/settings/plugins/plugins-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' export const getPluginsPaneSearchEntries = createLocalizedCatalog((): SettingsSearchEntry[] => [ { diff --git a/src/renderer/src/components/settings/PrivacyDiagnosticBundleControls.tsx b/src/renderer/src/components/settings/privacy/PrivacyDiagnosticBundleControls.tsx similarity index 98% rename from src/renderer/src/components/settings/PrivacyDiagnosticBundleControls.tsx rename to src/renderer/src/components/settings/privacy/PrivacyDiagnosticBundleControls.tsx index d231cd2213b..fd948e4a8a8 100644 --- a/src/renderer/src/components/settings/PrivacyDiagnosticBundleControls.tsx +++ b/src/renderer/src/components/settings/privacy/PrivacyDiagnosticBundleControls.tsx @@ -2,8 +2,8 @@ import { Check, Clipboard, Eye, FileText, Loader2, Trash2, UploadCloud, X } from import type { DiagnosticsBundlePayload, DiagnosticsStatusPayload -} from '../../../../preload/api-types' -import { Button } from '../ui/button' +} from '../../../../../preload/api/telemetry-api' +import { Button } from '../../ui/button' import { translate } from '@/i18n/i18n' export function PrivacyDiagnosticBundleControls({ diff --git a/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx b/src/renderer/src/components/settings/privacy/PrivacyDiagnosticsSection.tsx similarity index 98% rename from src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx rename to src/renderer/src/components/settings/privacy/PrivacyDiagnosticsSection.tsx index 9174f474c6a..38c4e7ee90c 100644 --- a/src/renderer/src/components/settings/PrivacyDiagnosticsSection.tsx +++ b/src/renderer/src/components/settings/privacy/PrivacyDiagnosticsSection.tsx @@ -4,9 +4,9 @@ import { FileText } from 'lucide-react' import type { DiagnosticsBundlePayload, DiagnosticsStatusPayload -} from '../../../../preload/api-types' -import { Label } from '../ui/label' -import { Separator } from '../ui/separator' +} from '../../../../../preload/api/telemetry-api' +import { Label } from '../../ui/label' +import { Separator } from '../../ui/separator' import { getDiagnosticBundleDescription, PrivacyDiagnosticBundleControls diff --git a/src/renderer/src/components/settings/PrivacyPane.tsx b/src/renderer/src/components/settings/privacy/PrivacyPane.tsx similarity index 93% rename from src/renderer/src/components/settings/PrivacyPane.tsx rename to src/renderer/src/components/settings/privacy/PrivacyPane.tsx index 415cf23af50..fab75e9e03d 100644 --- a/src/renderer/src/components/settings/PrivacyPane.tsx +++ b/src/renderer/src/components/settings/privacy/PrivacyPane.tsx @@ -1,12 +1,12 @@ import { useEffect, useState } from 'react' import { ShieldCheck } from 'lucide-react' import { useMountedRef } from '@/hooks/useMountedRef' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TelemetryConsentState } from '../../../../shared/telemetry-consent-types' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' -import { PRIVACY_URL, getConsentState, setOptIn as telemetrySetOptIn } from '../../lib/telemetry' -import { useAppStore } from '../../store' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { TelemetryConsentState } from '../../../../../shared/telemetry-consent-types' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' +import { PRIVACY_URL, getConsentState, setOptIn as telemetrySetOptIn } from '../../../lib/telemetry' +import { useAppStore } from '../../../store/index' import { PrivacyDiagnosticsSection } from './PrivacyDiagnosticsSection' import { translate } from '@/i18n/i18n' import { openAppHttpLink } from '@/lib/app-http-link-open' diff --git a/src/renderer/src/components/settings/diagnostics-bundle-error-copy.ts b/src/renderer/src/components/settings/privacy/diagnostics-bundle-error-copy.ts similarity index 96% rename from src/renderer/src/components/settings/diagnostics-bundle-error-copy.ts rename to src/renderer/src/components/settings/privacy/diagnostics-bundle-error-copy.ts index b6e6c058db8..41e58ec4331 100644 --- a/src/renderer/src/components/settings/diagnostics-bundle-error-copy.ts +++ b/src/renderer/src/components/settings/privacy/diagnostics-bundle-error-copy.ts @@ -3,7 +3,7 @@ import { displayIpcErrorMessage } from '@/lib/ipc-error' import { DIAGNOSTICS_BUNDLE_FAILURE_COPY as EN, type DiagnosticsBundleFailureCode -} from '../../../../shared/diagnostics-bundle-failure-copy' +} from '../../../../../shared/diagnostics-bundle-failure-copy' const COPY: Record string> = { creatingDisabled: () => diff --git a/src/renderer/src/components/settings/privacy-search.ts b/src/renderer/src/components/settings/privacy/privacy-search.ts similarity index 98% rename from src/renderer/src/components/settings/privacy-search.ts rename to src/renderer/src/components/settings/privacy/privacy-search.ts index 9104dcd7224..4230a4f2ffb 100644 --- a/src/renderer/src/components/settings/privacy-search.ts +++ b/src/renderer/src/components/settings/privacy/privacy-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getPrivacyPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/QuickCommandsList.test.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsList.test.tsx similarity index 98% rename from src/renderer/src/components/settings/QuickCommandsList.test.tsx rename to src/renderer/src/components/settings/quick-commands/QuickCommandsList.test.tsx index da9413b9fe6..f73666d6ba2 100644 --- a/src/renderer/src/components/settings/QuickCommandsList.test.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsList.test.tsx @@ -7,7 +7,7 @@ import type * as I18nModule from '@/i18n/i18n' import type { TerminalCommandQuickCommand, TerminalQuickCommand -} from '../../../../shared/terminal-quick-command-types' +} from '../../../../../shared/terminal-quick-command-types' import { QuickCommandsList } from './QuickCommandsList' vi.mock('@/i18n/i18n', async (importOriginal) => { diff --git a/src/renderer/src/components/settings/QuickCommandsList.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsList.tsx similarity index 96% rename from src/renderer/src/components/settings/QuickCommandsList.tsx rename to src/renderer/src/components/settings/quick-commands/QuickCommandsList.tsx index 78af9df084d..8adf2fe9d6c 100644 --- a/src/renderer/src/components/settings/QuickCommandsList.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsList.tsx @@ -1,21 +1,21 @@ import { Check, Copy, Pencil, TerminalSquare, Trash2 } from 'lucide-react' -import type { Repo } from '../../../../shared/repo-types' +import type { Repo } from '../../../../../shared/repo-types' import type { TerminalQuickCommand, TerminalQuickCommandScope -} from '../../../../shared/terminal-quick-command-types' +} from '../../../../../shared/terminal-quick-command-types' import { getTerminalQuickCommandBody, getTerminalQuickCommandScope, isTerminalAgentQuickCommand -} from '../../../../shared/terminal-quick-commands' +} from '../../../../../shared/terminal-quick-commands' import { AgentIcon, getAgentLabel } from '@/lib/agent-catalog' import { useClipboardTextCopyFeedback } from '@/hooks/use-clipboard-text-copy-feedback' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import { Badge } from '../ui/badge' -import { Button } from '../ui/button' -import { RepoBadgeMark } from '../repo/RepoBadgeLabel' +import { Badge } from '../../ui/badge' +import { Button } from '../../ui/button' +import { RepoBadgeMark } from '../../repo/RepoBadgeLabel' import { getQuickCommandRepoLabel } from './QuickCommandsScopeFilter' function getScopeLabel( diff --git a/src/renderer/src/components/settings/QuickCommandsPane.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx similarity index 96% rename from src/renderer/src/components/settings/QuickCommandsPane.tsx rename to src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx index 653bf5fc1a2..6d08068510f 100644 --- a/src/renderer/src/components/settings/QuickCommandsPane.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsPane.tsx @@ -1,17 +1,17 @@ import { useCallback, useEffect, useMemo, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TerminalQuickCommand } from '../../../../shared/terminal-quick-command-types' -import { getTerminalQuickCommandScope } from '../../../../shared/terminal-quick-commands' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import type { TerminalQuickCommand } from '../../../../../shared/terminal-quick-command-types' +import { getTerminalQuickCommandScope } from '../../../../../shared/terminal-quick-commands' import { createTerminalQuickCommandDraft, TerminalQuickCommandDialog } from '@/components/terminal-quick-commands/TerminalQuickCommandDialog' import { searchTerminalQuickCommands } from '@/lib/terminal-quick-command-search' -import { useAppStore } from '../../store' +import { useAppStore } from '../../../store/index' import { getTerminalQuickCommandHostPromptMaxLength } from '@/lib/terminal-quick-command-host-prompt-limit' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' import { useConfirmationDialog } from '@/components/confirmation-dialog-context' -import { getSettingOwnershipSummary } from './setting-ownership' +import { getSettingOwnershipSummary } from '../page/setting-ownership' import { translate } from '@/i18n/i18n' import { QuickCommandsList } from './QuickCommandsList' import { QuickCommandsToolbar } from './QuickCommandsToolbar' @@ -21,7 +21,7 @@ import { LOCAL_EXECUTION_HOST_ID, parseExecutionHostId, type ExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../../shared/execution-host' import { getTerminalQuickCommandHostOptions, shouldShowTerminalQuickCommandHostOwnership diff --git a/src/renderer/src/components/settings/QuickCommandsScopeFilter.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsScopeFilter.tsx similarity index 94% rename from src/renderer/src/components/settings/QuickCommandsScopeFilter.tsx rename to src/renderer/src/components/settings/quick-commands/QuickCommandsScopeFilter.tsx index c878d34b015..78de2a9263a 100644 --- a/src/renderer/src/components/settings/QuickCommandsScopeFilter.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsScopeFilter.tsx @@ -1,10 +1,10 @@ import { Check, ChevronsUpDown } from 'lucide-react' import type { Dispatch, SetStateAction } from 'react' -import type { Repo } from '../../../../shared/repo-types' -import { Button } from '../ui/button' -import { Command, CommandItem, CommandList } from '../ui/command' -import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' -import RepoBadgeLabel from '../repo/RepoBadgeLabel' +import type { Repo } from '../../../../../shared/repo-types' +import { Button } from '../../ui/button' +import { Command, CommandItem, CommandList } from '../../ui/command' +import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover' +import RepoBadgeLabel from '../../repo/RepoBadgeLabel' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/QuickCommandsToolbar.tsx b/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx similarity index 92% rename from src/renderer/src/components/settings/QuickCommandsToolbar.tsx rename to src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx index 202e148b1e3..223aa6d6e71 100644 --- a/src/renderer/src/components/settings/QuickCommandsToolbar.tsx +++ b/src/renderer/src/components/settings/quick-commands/QuickCommandsToolbar.tsx @@ -1,10 +1,10 @@ import type { Dispatch, SetStateAction } from 'react' import { Plus, Search } from 'lucide-react' -import type { Repo } from '../../../../shared/repo-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' +import type { Repo } from '../../../../../shared/repo-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' import { translate } from '@/i18n/i18n' import { QuickCommandsScopeFilter } from './QuickCommandsScopeFilter' diff --git a/src/renderer/src/components/settings/quick-commands-search.ts b/src/renderer/src/components/settings/quick-commands/quick-commands-search.ts similarity index 96% rename from src/renderer/src/components/settings/quick-commands-search.ts rename to src/renderer/src/components/settings/quick-commands/quick-commands-search.ts index 5aaa4b4bf29..9f85a4f7d81 100644 --- a/src/renderer/src/components/settings/quick-commands-search.ts +++ b/src/renderer/src/components/settings/quick-commands/quick-commands-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getQuickCommandsPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/repository/RepositoryFormatterSection.tsx b/src/renderer/src/components/settings/repository/RepositoryFormatterSection.tsx index bfbcc251f3d..2a45670e4c5 100644 --- a/src/renderer/src/components/settings/repository/RepositoryFormatterSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryFormatterSection.tsx @@ -9,8 +9,8 @@ import { Button } from '../../ui/button' import { Input } from '../../ui/input' import { Label } from '../../ui/label' import { Textarea } from '../../ui/textarea' -import { SearchableSetting } from '../SearchableSetting' -import { SettingsSubsectionHeader } from '../SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' export function getRepositoryFormatterSearchEntry() { return { diff --git a/src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.tsx b/src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.tsx index 4f8e2e6eb7c..b1e466864d3 100644 --- a/src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryGitHubAccountSection.tsx @@ -5,12 +5,12 @@ import type { Repo } from '../../../../../shared/repo-types' import type { GhAccountBindingInventory } from '../../../../../shared/github/auth-types' import { Button } from '../../ui/button' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' -import { SearchableSetting } from '../SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { useAppStore } from '@/store/index' import { runtimeTargetForOwnerEnvironment } from '@/runtime/runtime-client-target' import { getRepoExecutionHostId, parseExecutionHostId } from '../../../../../shared/execution-host' import { translate } from '@/i18n/i18n' -import { searchKeywords } from '../settings-search-keywords' +import { searchKeywords } from '../search/settings-search-keywords' import { isGhAccountBindingEnforced, listRepositoryGhBindableAccounts, diff --git a/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx b/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx index b6f1f1ec708..bfcae1dc582 100644 --- a/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryJiraProjectSection.tsx @@ -6,7 +6,7 @@ import { taskSourceRuntimeTarget } from '@/lib/task-source-runtime-target' import { useAppStore } from '@/store/index' import { useJiraProjectInventory } from '../../use-jira-project-inventory' import { JiraProjectPicker } from '../../jira-project-picker' -import { SearchableSetting } from '../SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' export function RepositoryJiraProjectSection({ diff --git a/src/renderer/src/components/settings/repository/RepositoryPane.tsx b/src/renderer/src/components/settings/repository/RepositoryPane.tsx index 1e55a1f61f6..a68d3007b48 100644 --- a/src/renderer/src/components/settings/repository/RepositoryPane.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryPane.tsx @@ -13,10 +13,10 @@ import { McpConfigSection } from '../McpConfigSection' import { WorktreeSymlinksSection } from '../WorktreeSymlinksSection' import { SparsePresetSettingsSection } from '../SparsePresetSettingsSection' import { RepositorySourceControlAiSection } from './source-control/RepositorySourceControlAiSection' -import { SearchableSetting } from '../SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { RepositoryRemoveProjectButton } from './RepositoryRemoveProjectButton' -import type { SettingsProjectRemovalScope } from '../settings-project-list' -import { matchesSettingsSearch } from '../settings-search' +import type { SettingsProjectRemovalScope } from '../navigation/settings-project-list' +import { matchesSettingsSearch } from '../search/settings-search' import { useAppStore } from '@/store/index' import { getRepositoryIconSectionId } from './repository-settings-targets' import { RepositoryIconPicker } from './identity/RepositoryIconPicker' diff --git a/src/renderer/src/components/settings/repository/RepositoryRemoveProjectButton.tsx b/src/renderer/src/components/settings/repository/RepositoryRemoveProjectButton.tsx index 5e76bf3df0a..7d923998c8f 100644 --- a/src/renderer/src/components/settings/repository/RepositoryRemoveProjectButton.tsx +++ b/src/renderer/src/components/settings/repository/RepositoryRemoveProjectButton.tsx @@ -1,10 +1,10 @@ import { useState } from 'react' import { Trash2 } from 'lucide-react' import type { Repo } from '../../../../../shared/repo-types' -import type { SettingsProjectRemovalScope } from '../settings-project-list' +import type { SettingsProjectRemovalScope } from '../navigation/settings-project-list' import { Button } from '../../ui/button' import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' -import { SearchableSetting } from '../SearchableSetting' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' function getRemoveProjectDescription(scope: SettingsProjectRemovalScope): string { diff --git a/src/renderer/src/components/settings/repository/execution/RepositoryHookPolicySettings.tsx b/src/renderer/src/components/settings/repository/execution/RepositoryHookPolicySettings.tsx index 8cb888d800c..f1953732f07 100644 --- a/src/renderer/src/components/settings/repository/execution/RepositoryHookPolicySettings.tsx +++ b/src/renderer/src/components/settings/repository/execution/RepositoryHookPolicySettings.tsx @@ -7,8 +7,8 @@ import type { } 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 '../../search/settings-search' +import { SettingsSwitch } from '../../form-controls/SettingsFormControls' import { RepositoryHooksYamlStatus } from './RepositoryHooksYamlStatus' type PolicyOption = { policy: Policy; label: string; description: string } diff --git a/src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.tsx b/src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.tsx index f519311cd8a..4c41136c707 100644 --- a/src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.tsx +++ b/src/renderer/src/components/settings/repository/execution/RepositoryHooksSection.tsx @@ -12,7 +12,7 @@ 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 { SearchableSetting } from '../../section-layout/SearchableSetting' import { getRepositoryLocalCommandsSectionId } from '../repository-settings-targets' import { getLocalHookFields, diff --git a/src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.tsx b/src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.tsx index d7032bb0c9d..a8d77dbc4e1 100644 --- a/src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.tsx +++ b/src/renderer/src/components/settings/repository/execution/RepositoryHostSetupsSection.tsx @@ -15,10 +15,10 @@ 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 { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsBadge } from '../../form-controls/SettingsFormControls' +import { matchesSettingsSearch } from '../../search/settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' import { buildSetupHostOptions, getSetupStateLabel } from './repository-host-setup-options' import { RepositoryHostSetupActions } from './RepositoryHostSetupActions' diff --git a/src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx b/src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx index ae6889fb0df..da15e46ca51 100644 --- a/src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx +++ b/src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx @@ -1,9 +1,9 @@ import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import type { Project, ProjectUpdateArgs } from '../../../../../../shared/project-types' import type { Repo } from '../../../../../../shared/repo-types' -import { SearchableSetting } from '../../SearchableSetting' -import type { SettingsSearchEntry } from '../../settings-search' -import { matchesSettingsSearch } from '../../settings-search' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import type { SettingsSearchEntry } from '../../search/settings-search' +import { matchesSettingsSearch } from '../../search/settings-search' import { ProjectWindowsRuntimeSetting } from '../../ProjectWindowsRuntimeSetting' import type { ProjectRuntimeSessionSummary } from './repository-runtime-session-summary' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/repository/execution/RepositoryWorktreeDefaultsSection.tsx b/src/renderer/src/components/settings/repository/execution/RepositoryWorktreeDefaultsSection.tsx index e592f380b1b..f095569d8e3 100644 --- a/src/renderer/src/components/settings/repository/execution/RepositoryWorktreeDefaultsSection.tsx +++ b/src/renderer/src/components/settings/repository/execution/RepositoryWorktreeDefaultsSection.tsx @@ -5,7 +5,7 @@ import { Label } from '../../../ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../ui/select' import { BaseRefPicker } from '../../BaseRefPicker' import { RepoSettingsDraftInput } from '../RepositorySettingsDraftInput' -import { SearchableSetting } from '../../SearchableSetting' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' import { getRepoExecutionHostId } from '../../../../../../shared/execution-host' import { diff --git a/src/renderer/src/components/settings/repository/execution/repository-git-hooks-search-entries.ts b/src/renderer/src/components/settings/repository/execution/repository-git-hooks-search-entries.ts index 89a9f2cad59..d9bd8d173a3 100644 --- a/src/renderer/src/components/settings/repository/execution/repository-git-hooks-search-entries.ts +++ b/src/renderer/src/components/settings/repository/execution/repository-git-hooks-search-entries.ts @@ -1,7 +1,7 @@ import type { Repo } from '../../../../../../shared/repo-types' -import type { SettingsSearchEntry } from '../../settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from '../../settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' export function getRepositoryGitHooksSearchEntries(repo: Repo): SettingsSearchEntry[] { return [ diff --git a/src/renderer/src/components/settings/repository/execution/repository-git-worktree-search-entries.ts b/src/renderer/src/components/settings/repository/execution/repository-git-worktree-search-entries.ts index 5dc70be13ec..21a6cf9cb37 100644 --- a/src/renderer/src/components/settings/repository/execution/repository-git-worktree-search-entries.ts +++ b/src/renderer/src/components/settings/repository/execution/repository-git-worktree-search-entries.ts @@ -1,7 +1,7 @@ import type { Repo } from '../../../../../../shared/repo-types' -import type { SettingsSearchEntry } from '../../settings-search' +import type { SettingsSearchEntry } from '../../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from '../../settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' export function getRepositoryGitWorktreeSearchEntries(repo: Repo): SettingsSearchEntry[] { return [ diff --git a/src/renderer/src/components/settings/repository/execution/repository-hook-defaults.ts b/src/renderer/src/components/settings/repository/execution/repository-hook-defaults.ts new file mode 100644 index 00000000000..b76c67ea556 --- /dev/null +++ b/src/renderer/src/components/settings/repository/execution/repository-hook-defaults.ts @@ -0,0 +1,3 @@ +import { getDefaultRepoHookSettings } from '../../../../../../shared/constants' + +export const DEFAULT_REPO_HOOK_SETTINGS = getDefaultRepoHookSettings() diff --git a/src/renderer/src/components/settings/repository/execution/repository-hook-settings-draft.ts b/src/renderer/src/components/settings/repository/execution/repository-hook-settings-draft.ts index 868beaab524..def2139ccb1 100644 --- a/src/renderer/src/components/settings/repository/execution/repository-hook-settings-draft.ts +++ b/src/renderer/src/components/settings/repository/execution/repository-hook-settings-draft.ts @@ -4,7 +4,7 @@ import type { RepoHookSettings } from '../../../../../../shared/orca-yaml-hook-types' import type { Repo } from '../../../../../../shared/repo-types' -import { DEFAULT_REPO_HOOK_SETTINGS } from '../../SettingsConstants' +import { DEFAULT_REPO_HOOK_SETTINGS } from './repository-hook-defaults' import { translate } from '@/i18n/i18n' export type LocalHookName = 'setup' | 'archive' diff --git a/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx index f4ac8f15502..79ebd688972 100644 --- a/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx +++ b/src/renderer/src/components/settings/repository/identity/RepositoryForkSyncSection.tsx @@ -5,14 +5,14 @@ import type { ForkSyncMode, GitForkSyncResult } from '../../../../../../shared/g 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 { SearchableSetting } from '../../section-layout/SearchableSetting' +import { SettingsSegmentedControl } from '../../form-controls/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 { translate } from '@/i18n/i18n' -import { searchKeywords } from '../../settings-search-keywords' +import { searchKeywords } from '../../search/settings-search-keywords' type RepositoryForkSyncSectionProps = { repo: Repo diff --git a/src/renderer/src/components/settings/repository/identity/repository-identity-search.ts b/src/renderer/src/components/settings/repository/identity/repository-identity-search.ts index 887f008358a..1ccdda6c7c6 100644 --- a/src/renderer/src/components/settings/repository/identity/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 { normalizeSettingsSearchQuery } from '../../search/settings-search' export function matchesRepositoryIdentitySearch(query: string, repo: Repo): boolean { const normalizedQuery = normalizeSettingsSearchQuery(query) diff --git a/src/renderer/src/components/settings/repository/repository-git-author-search-entries.ts b/src/renderer/src/components/settings/repository/repository-git-author-search-entries.ts index 75ea29b64a0..435cfe670a6 100644 --- a/src/renderer/src/components/settings/repository/repository-git-author-search-entries.ts +++ b/src/renderer/src/components/settings/repository/repository-git-author-search-entries.ts @@ -1,7 +1,7 @@ import type { Repo } from '../../../../../shared/repo-types' -import type { SettingsSearchEntry } from '../settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from '../settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' export function getRepositoryGitAuthorSearchEntries(repo: Repo): SettingsSearchEntry[] { return [ diff --git a/src/renderer/src/components/settings/repository/repository-search.ts b/src/renderer/src/components/settings/repository/repository-search.ts index 311a182fdcb..9c9d241f126 100644 --- a/src/renderer/src/components/settings/repository/repository-search.ts +++ b/src/renderer/src/components/settings/repository/repository-search.ts @@ -4,9 +4,9 @@ import { getRepoExecutionHostId, LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' -import type { SettingsSearchEntry } from '../settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from '../settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { getRepositoryGitAuthorSearchEntries } from './repository-git-author-search-entries' import { getRepositoryGitHooksSearchEntries } from './execution/repository-git-hooks-search-entries' import { getRepositoryGitWorktreeSearchEntries } from './execution/repository-git-worktree-search-entries' diff --git a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.tsx b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.tsx index ecf5e188168..091e111c7cc 100644 --- a/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.tsx +++ b/src/renderer/src/components/settings/repository/source-control/RepositorySourceControlAiSection.tsx @@ -12,7 +12,7 @@ import { RepositorySourceControlAiEnablement } from './RepositorySourceControlAi import { RepositorySourceControlAiHostedReviewDefaults } from './RepositorySourceControlAiHostedReviewDefaults' import { normalizeRepoAiDraft } from './repository-source-control-ai-draft' import { useRepositorySourceControlAiGlobalUx } from './repository-source-control-ai-global-ux' -import { getSettingOwnershipSummary } from '../../setting-ownership' +import { getSettingOwnershipSummary } from '../../page/setting-ownership' import { translate } from '@/i18n/i18n' type RepositorySourceControlAiSectionProps = { diff --git a/src/renderer/src/components/settings/runtime-environments-search.ts b/src/renderer/src/components/settings/runtime-environments-search.ts index 1c863626c87..1a644855d7d 100644 --- a/src/renderer/src/components/settings/runtime-environments-search.ts +++ b/src/renderer/src/components/settings/runtime-environments-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { getMachineNameSearchKeywords } from './machine-name-search' diff --git a/src/renderer/src/components/settings/setting-labels.ts b/src/renderer/src/components/settings/search/setting-labels.ts similarity index 94% rename from src/renderer/src/components/settings/setting-labels.ts rename to src/renderer/src/components/settings/search/setting-labels.ts index 3cc776b846c..02eab0aefd5 100644 --- a/src/renderer/src/components/settings/setting-labels.ts +++ b/src/renderer/src/components/settings/search/setting-labels.ts @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' export const SETTING_LABELS: Partial> = { terminalFontSize: 'Font Size', diff --git a/src/renderer/src/components/settings/settings-search-keywords.ts b/src/renderer/src/components/settings/search/settings-search-keywords.ts similarity index 100% rename from src/renderer/src/components/settings/settings-search-keywords.ts rename to src/renderer/src/components/settings/search/settings-search-keywords.ts diff --git a/src/renderer/src/components/settings/settings-search.test.ts b/src/renderer/src/components/settings/search/settings-search.test.ts similarity index 100% rename from src/renderer/src/components/settings/settings-search.test.ts rename to src/renderer/src/components/settings/search/settings-search.test.ts diff --git a/src/renderer/src/components/settings/settings-search.ts b/src/renderer/src/components/settings/search/settings-search.ts similarity index 99% rename from src/renderer/src/components/settings/settings-search.ts rename to src/renderer/src/components/settings/search/settings-search.ts index 1e00e007ac8..7dc272351e2 100644 --- a/src/renderer/src/components/settings/settings-search.ts +++ b/src/renderer/src/components/settings/search/settings-search.ts @@ -1,4 +1,4 @@ -import { isClipboardTextByteLengthOverLimit } from '../../../../shared/clipboard-text' +import { isClipboardTextByteLengthOverLimit } from '../../../../../shared/clipboard-text' export type SettingsSearchEntry = { title: string diff --git a/src/renderer/src/components/settings/SearchableSetting.tsx b/src/renderer/src/components/settings/section-layout/SearchableSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/SearchableSetting.tsx rename to src/renderer/src/components/settings/section-layout/SearchableSetting.tsx index 79446d8f787..c55d3c270b2 100644 --- a/src/renderer/src/components/settings/SearchableSetting.tsx +++ b/src/renderer/src/components/settings/section-layout/SearchableSetting.tsx @@ -1,7 +1,7 @@ import type React from 'react' import { cn } from '@/lib/utils' -import { useAppStore } from '../../store' -import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search' +import { useAppStore } from '../../../store/index' +import { matchesSettingsSearch, type SettingsSearchEntry } from '../search/settings-search' type SearchableSettingProps = SettingsSearchEntry & { children: React.ReactNode diff --git a/src/renderer/src/components/settings/SettingsSection.tsx b/src/renderer/src/components/settings/section-layout/SettingsSection.tsx similarity index 94% rename from src/renderer/src/components/settings/SettingsSection.tsx rename to src/renderer/src/components/settings/section-layout/SettingsSection.tsx index b10f7b2d90e..381b785ab09 100644 --- a/src/renderer/src/components/settings/SettingsSection.tsx +++ b/src/renderer/src/components/settings/section-layout/SettingsSection.tsx @@ -1,9 +1,9 @@ import type React from 'react' import { createContext, useContext } from 'react' import { cn } from '@/lib/utils' -import { useAppStore } from '../../store' -import type { SettingsSearchEntry } from './settings-search' -import { matchesSettingsSearch } from './settings-search' +import { useAppStore } from '../../../store/index' +import type { SettingsSearchEntry } from '../search/settings-search' +import { matchesSettingsSearch } from '../search/settings-search' // Share active section through context to avoid threading it through every section call. const ActiveSettingsSectionContext = createContext(null) diff --git a/src/renderer/src/components/settings/SettingsSectionStack.tsx b/src/renderer/src/components/settings/section-layout/SettingsSectionStack.tsx similarity index 93% rename from src/renderer/src/components/settings/SettingsSectionStack.tsx rename to src/renderer/src/components/settings/section-layout/SettingsSectionStack.tsx index f1e02418792..678de7c1942 100644 --- a/src/renderer/src/components/settings/SettingsSectionStack.tsx +++ b/src/renderer/src/components/settings/section-layout/SettingsSectionStack.tsx @@ -1,5 +1,5 @@ import type { ReactElement } from 'react' -import { Separator } from '../ui/separator' +import { Separator } from '../../ui/separator' // Key by section identity, not filtered index, so query edits cannot remount surviving sections and lose drafts or repeat loads. export function SettingsSectionStack({ diff --git a/src/renderer/src/components/settings/SessionHistoryComputerRow.tsx b/src/renderer/src/components/settings/session-history/SessionHistoryComputerRow.tsx similarity index 97% rename from src/renderer/src/components/settings/SessionHistoryComputerRow.tsx rename to src/renderer/src/components/settings/session-history/SessionHistoryComputerRow.tsx index 24f8c518646..90b68b5f868 100644 --- a/src/renderer/src/components/settings/SessionHistoryComputerRow.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistoryComputerRow.tsx @@ -2,7 +2,7 @@ import { Laptop, Server } from 'lucide-react' import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import { SettingsSwitch } from './SettingsFormControls' +import { SettingsSwitch } from '../form-controls/SettingsFormControls' const NO_DETAILS: readonly string[] = [] diff --git a/src/renderer/src/components/settings/SessionHistoryServerRow.tsx b/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx similarity index 96% rename from src/renderer/src/components/settings/SessionHistoryServerRow.tsx rename to src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx index d121d04b0f8..dde205f882b 100644 --- a/src/renderer/src/components/settings/SessionHistoryServerRow.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistoryServerRow.tsx @@ -1,14 +1,14 @@ import { useEffect, useState } from 'react' -import type { PublicKnownRuntimeEnvironment } from '../../../../shared/runtime-environments' -import { toRuntimeExecutionHostId } from '../../../../shared/execution-host' +import type { PublicKnownRuntimeEnvironment } from '../../../../../shared/runtime-environments' +import { toRuntimeExecutionHostId } from '../../../../../shared/execution-host' import { useMountedRef } from '@/hooks/useMountedRef' import { translate } from '@/i18n/i18n' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { getRuntimeServerConnectionState, isRuntimeServerTransportConnected, type RuntimeHostDetails -} from './runtime-environment-host-details' +} from '../runtime-environment-host-details' import { SessionHistoryComputerRow } from './SessionHistoryComputerRow' import type { SessionSearchComputerState } from './session-search-computer-rollup' import { diff --git a/src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.test.tsx similarity index 98% rename from src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx rename to src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.test.tsx index 6e17380de79..adf554a698c 100644 --- a/src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.test.tsx @@ -3,9 +3,9 @@ import '@testing-library/jest-dom/vitest' import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { toast } from 'sonner' -import { getDefaultSettings } from '../../../../shared/constants' -import { unavailableSessionSearchStatus } from '../../../../shared/ai-vault-search-client' -import type { AiVaultSearchStatus } from '../../../../shared/ai-vault-search-types' +import { getDefaultSettings } from '../../../../../shared/constants' +import { unavailableSessionSearchStatus } from '../../../../../shared/ai-vault-search-client' +import type { AiVaultSearchStatus } from '../../../../../shared/ai-vault-search-types' import { ConfirmationDialogContext } from '@/components/confirmation-dialog-context' import { SessionHistorySettingsPane } from './SessionHistorySettingsPane' @@ -27,7 +27,7 @@ const mocks = vi.hoisted(() => { markFeatureTipsSeen: vi.fn() } }) -vi.mock('./use-runtime-environment-catalog', () => ({ +vi.mock('../use-runtime-environment-catalog', () => ({ useRuntimeEnvironmentCatalog: () => ({ environments: mocks.environments, isLoading: false, @@ -37,7 +37,7 @@ vi.mock('./use-runtime-environment-catalog', () => ({ loadEnvironments: vi.fn() }) })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ openSettingsPage: vi.fn(), diff --git a/src/renderer/src/components/settings/SessionHistorySettingsPane.tsx b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx similarity index 96% rename from src/renderer/src/components/settings/SessionHistorySettingsPane.tsx rename to src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx index 86410c768f6..22ed790b765 100644 --- a/src/renderer/src/components/settings/SessionHistorySettingsPane.tsx +++ b/src/renderer/src/components/settings/session-history/SessionHistorySettingsPane.tsx @@ -1,20 +1,20 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { AiVaultSearchSettingsSchema, resolveAiVaultSearchSettings -} from '../../../../shared/ai-vault-search-settings' +} from '../../../../../shared/ai-vault-search-settings' import { getLocalExecutionHostLabel, LOCAL_EXECUTION_HOST_ID, toRuntimeExecutionHostId -} from '../../../../shared/execution-host' +} from '../../../../../shared/execution-host' import { Button } from '@/components/ui/button' import { Label } from '@/components/ui/label' import { isWebClientLocation } from '@/lib/web-client-location' import { translate } from '@/i18n/i18n' -import { useAppStore } from '@/store' -import { SettingsRow } from './SettingsFormControls' +import { useAppStore } from '@/store/index' +import { SettingsRow } from '../form-controls/SettingsFormControls' import { SessionSearchAdvancedSection } from './SessionSearchAdvancedSection' import { SessionHistoryComputerRow } from './SessionHistoryComputerRow' import { SessionHistoryServerRow } from './SessionHistoryServerRow' @@ -32,7 +32,7 @@ import { sessionSearchStatusMessage } from './session-history-status-copy' import { useSessionSearchStatus } from './use-session-search-status' -import { useRuntimeEnvironmentCatalog } from './use-runtime-environment-catalog' +import { useRuntimeEnvironmentCatalog } from '../use-runtime-environment-catalog' export function SessionHistorySettingsPane({ settings, diff --git a/src/renderer/src/components/settings/SessionSearchAdvancedSection.tsx b/src/renderer/src/components/settings/session-history/SessionSearchAdvancedSection.tsx similarity index 98% rename from src/renderer/src/components/settings/SessionSearchAdvancedSection.tsx rename to src/renderer/src/components/settings/session-history/SessionSearchAdvancedSection.tsx index e4982d6d409..7185a5b9942 100644 --- a/src/renderer/src/components/settings/SessionSearchAdvancedSection.tsx +++ b/src/renderer/src/components/settings/session-history/SessionSearchAdvancedSection.tsx @@ -7,7 +7,7 @@ import { useConfirmationDialog } from '@/components/confirmation-dialog-context' import { useMountedRef } from '@/hooks/useMountedRef' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' -import { SettingsRow } from './SettingsFormControls' +import { SettingsRow } from '../form-controls/SettingsFormControls' /** Shared by the Clear row and its confirm dialog so both promise the same thing. */ export function sessionSearchClearDescription(enabled: boolean): string { diff --git a/src/renderer/src/components/settings/SessionSearchComputerList.tsx b/src/renderer/src/components/settings/session-history/SessionSearchComputerList.tsx similarity index 100% rename from src/renderer/src/components/settings/SessionSearchComputerList.tsx rename to src/renderer/src/components/settings/session-history/SessionSearchComputerList.tsx diff --git a/src/renderer/src/components/settings/session-history-status-copy.ts b/src/renderer/src/components/settings/session-history/session-history-status-copy.ts similarity index 97% rename from src/renderer/src/components/settings/session-history-status-copy.ts rename to src/renderer/src/components/settings/session-history/session-history-status-copy.ts index 26c828f7314..0f1adcb703e 100644 --- a/src/renderer/src/components/settings/session-history-status-copy.ts +++ b/src/renderer/src/components/settings/session-history/session-history-status-copy.ts @@ -1,4 +1,4 @@ -import type { AiVaultSearchStatus } from '../../../../shared/ai-vault-search-types' +import type { AiVaultSearchStatus } from '../../../../../shared/ai-vault-search-types' import { translate } from '@/i18n/i18n' import { formatMessageCount, formatSessionCount } from './session-search-count-format' diff --git a/src/renderer/src/components/settings/session-search-computer-rollup.ts b/src/renderer/src/components/settings/session-history/session-search-computer-rollup.ts similarity index 100% rename from src/renderer/src/components/settings/session-search-computer-rollup.ts rename to src/renderer/src/components/settings/session-history/session-search-computer-rollup.ts diff --git a/src/renderer/src/components/settings/session-search-count-format.ts b/src/renderer/src/components/settings/session-history/session-search-count-format.ts similarity index 100% rename from src/renderer/src/components/settings/session-search-count-format.ts rename to src/renderer/src/components/settings/session-history/session-search-count-format.ts diff --git a/src/renderer/src/components/settings/use-session-search-status.test.tsx b/src/renderer/src/components/settings/session-history/use-session-search-status.test.tsx similarity index 97% rename from src/renderer/src/components/settings/use-session-search-status.test.tsx rename to src/renderer/src/components/settings/session-history/use-session-search-status.test.tsx index e376a578732..a3877489f31 100644 --- a/src/renderer/src/components/settings/use-session-search-status.test.tsx +++ b/src/renderer/src/components/settings/session-history/use-session-search-status.test.tsx @@ -2,9 +2,9 @@ import '@testing-library/jest-dom/vitest' import { act, cleanup, renderHook } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { unavailableSessionSearchStatus } from '../../../../shared/ai-vault-search-client' -import type { AiVaultSearchStatus } from '../../../../shared/ai-vault-search-types' -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { unavailableSessionSearchStatus } from '../../../../../shared/ai-vault-search-client' +import type { AiVaultSearchStatus } from '../../../../../shared/ai-vault-search-types' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' import { sessionSearchStatusDetails, sessionSearchStatusMessage diff --git a/src/renderer/src/components/settings/use-session-search-status.ts b/src/renderer/src/components/settings/session-history/use-session-search-status.ts similarity index 93% rename from src/renderer/src/components/settings/use-session-search-status.ts rename to src/renderer/src/components/settings/session-history/use-session-search-status.ts index 2de827a6f26..92537d72b77 100644 --- a/src/renderer/src/components/settings/use-session-search-status.ts +++ b/src/renderer/src/components/settings/session-history/use-session-search-status.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react' -import type { AiVaultSearchStatus } from '../../../../shared/ai-vault-search-types' -import type { ExecutionHostId } from '../../../../shared/execution-host' +import type { AiVaultSearchStatus } from '../../../../../shared/ai-vault-search-types' +import type { ExecutionHostId } from '../../../../../shared/execution-host' import { useWindowStreamVisible } from '@/hooks/use-window-stream-visibility' import { installWindowVisibilityInterval } from '@/lib/window-visibility-interval' import { isHostTooOldError, sessionSearchPollIntervalMs } from './session-history-status-copy' diff --git a/src/renderer/src/components/settings/settings-form-option-filter.ts b/src/renderer/src/components/settings/settings-form-option-filter.ts deleted file mode 100644 index fca602dfbe8..00000000000 --- a/src/renderer/src/components/settings/settings-form-option-filter.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { isClipboardTextByteLengthOverLimit } from '../../../../shared/clipboard-text' -import type { TerminalThemeOption } from '@/lib/terminal-theme' - -export const SETTINGS_FORM_OPTION_QUERY_MAX_BYTES = 2 * 1024 -export const FONT_SUGGESTION_RENDER_LIMIT = 320 - -export type RenderedFontSuggestion = { - font: string - sourceIndex: number -} - -export function isSettingsFormOptionQueryTooLarge( - query: string, - maxBytes = SETTINGS_FORM_OPTION_QUERY_MAX_BYTES -): boolean { - return isClipboardTextByteLengthOverLimit(query, maxBytes) -} - -function normalizeSettingsFormOptionQuery(query: string): string | null { - if (isSettingsFormOptionQueryTooLarge(query)) { - return null - } - const trimmed = query.trim() - return trimmed.toLowerCase() -} - -export function filterTerminalThemeOptions( - themeOptions: readonly TerminalThemeOption[], - query: string -): TerminalThemeOption[] { - const normalizedQuery = normalizeSettingsFormOptionQuery(query) - if (normalizedQuery === null) { - return [] - } - if (!normalizedQuery) { - return [...themeOptions] - } - return themeOptions.filter((theme) => - `${theme.label} ${theme.sourceLabel ?? ''} `.toLowerCase().includes(normalizedQuery) - ) -} - -/** Keeps options whose label, keywords or group heading contain every query term; drops empty groups. */ -export function filterSearchableSelectGroups< - TOption extends { label: string; keywords?: readonly string[] }, - TGroup extends { heading?: string; options: readonly TOption[] } ->(groups: readonly TGroup[], query: string): TGroup[] { - const normalizedQuery = normalizeSettingsFormOptionQuery(query) - if (normalizedQuery === null) { - return [] - } - const terms = normalizedQuery.split(/\s+/).filter(Boolean) - if (terms.length === 0) { - return groups.filter((group) => group.options.length > 0) - } - return groups.flatMap((group) => { - const options = group.options.filter((option) => { - const text = - `${option.label} ${option.keywords?.join(' ') ?? ''} ${group.heading ?? ''}`.toLowerCase() - return terms.every((term) => text.includes(term)) - }) - return options.length > 0 ? [{ ...group, options }] : [] - }) -} - -export function filterFontSuggestions( - suggestions: readonly string[], - query: string, - defaultOptionLabel = '' -): string[] { - const normalizedQuery = normalizeSettingsFormOptionQuery(query) - if (normalizedQuery === null) { - return [] - } - if (!normalizedQuery) { - return [...suggestions] - } - - const startsWith: string[] = [] - const includes: string[] = [] - for (const font of suggestions) { - const normalizedFont = (font || defaultOptionLabel).toLowerCase() - if (normalizedFont.startsWith(normalizedQuery)) { - startsWith.push(font) - } else if (normalizedFont.includes(normalizedQuery)) { - includes.push(font) - } - } - return [...startsWith, ...includes] -} - -export function getRenderedFontSuggestions( - suggestions: readonly string[], - highlightedIndex: number, - limit = FONT_SUGGESTION_RENDER_LIMIT -): RenderedFontSuggestion[] { - const cappedLength = Math.min(suggestions.length, limit) - if (cappedLength <= 0) { - return [] - } - - const sourceIndexes = Array.from({ length: cappedLength }, (_value, index) => index) - if (highlightedIndex >= cappedLength && highlightedIndex < suggestions.length) { - sourceIndexes[cappedLength - 1] = highlightedIndex - } - return sourceIndexes.map((sourceIndex) => ({ font: suggestions[sourceIndex] ?? '', sourceIndex })) -} diff --git a/src/renderer/src/components/settings/SettingsSetupGuidePane.tsx b/src/renderer/src/components/settings/setup-guide/SettingsSetupGuidePane.tsx similarity index 89% rename from src/renderer/src/components/settings/SettingsSetupGuidePane.tsx rename to src/renderer/src/components/settings/setup-guide/SettingsSetupGuidePane.tsx index 81c05221df7..48fe100a44c 100644 --- a/src/renderer/src/components/settings/SettingsSetupGuidePane.tsx +++ b/src/renderer/src/components/settings/setup-guide/SettingsSetupGuidePane.tsx @@ -2,9 +2,9 @@ import { useEffect, useMemo, useState } from 'react' import { getFeatureWallSetupSteps, getFirstIncompleteFeatureWallSetupStepId -} from '../../../../shared/feature-wall-setup-steps' -import type { FeatureWallSetupStepId } from '../../../../shared/feature-wall-setup-steps' -import { FeatureWallSetupChecklist } from '../feature-wall/FeatureWallSetupChecklist' +} from '../../../../../shared/feature-wall-setup-steps' +import type { FeatureWallSetupStepId } from '../../../../../shared/feature-wall-setup-steps' +import { FeatureWallSetupChecklist } from '../../feature-wall/FeatureWallSetupChecklist' import { useSettingsSetupGuideFullProgress } from './settings-setup-guide-progress' export function SettingsSetupGuidePane(): React.JSX.Element { diff --git a/src/renderer/src/components/settings/SetupStepBadge.tsx b/src/renderer/src/components/settings/setup-guide/SetupStepBadge.tsx similarity index 100% rename from src/renderer/src/components/settings/SetupStepBadge.tsx rename to src/renderer/src/components/settings/setup-guide/SetupStepBadge.tsx diff --git a/src/renderer/src/components/settings/settings-setup-guide-progress.ts b/src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts similarity index 86% rename from src/renderer/src/components/settings/settings-setup-guide-progress.ts rename to src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts index 6fa3887876b..c13ce6ba04e 100644 --- a/src/renderer/src/components/settings/settings-setup-guide-progress.ts +++ b/src/renderer/src/components/settings/setup-guide/settings-setup-guide-progress.ts @@ -3,9 +3,9 @@ import { FEATURE_WALL_SETUP_STEPS, getFirstIncompleteFeatureWallSetupStepId, type FeatureWallSetupStepId -} from '../../../../shared/feature-wall-setup-steps' -import type { FeatureWallSetupProgress } from '../feature-wall/feature-wall-setup-progress' -import { useSetupGuideProgress } from '../setup-guide/use-setup-guide-progress' +} from '../../../../../shared/feature-wall-setup-steps' +import type { FeatureWallSetupProgress } from '../../feature-wall/feature-wall-setup-progress' +import { useSetupGuideProgress } from '../../setup-guide/use-setup-guide-progress' export type SettingsSetupGuideProgress = { ready: boolean diff --git a/src/renderer/src/components/settings/share-skills-settings-search.ts b/src/renderer/src/components/settings/share-skills-settings-search.ts index 8eb7f224563..d98ae5eed63 100644 --- a/src/renderer/src/components/settings/share-skills-settings-search.ts +++ b/src/renderer/src/components/settings/share-skills-settings-search.ts @@ -1,6 +1,6 @@ import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' export const getShareSkillsSettingsSearchEntries = createLocalizedCatalog(() => [ { diff --git a/src/renderer/src/components/settings/KeybindingFileDiagnostics.tsx b/src/renderer/src/components/settings/shortcuts/KeybindingFileDiagnostics.tsx similarity index 89% rename from src/renderer/src/components/settings/KeybindingFileDiagnostics.tsx rename to src/renderer/src/components/settings/shortcuts/KeybindingFileDiagnostics.tsx index 50dce85368a..ff9719984e1 100644 --- a/src/renderer/src/components/settings/KeybindingFileDiagnostics.tsx +++ b/src/renderer/src/components/settings/shortcuts/KeybindingFileDiagnostics.tsx @@ -1,5 +1,5 @@ import React from 'react' -import type { KeybindingFileDiagnostic } from '../../../../shared/keybindings' +import type { KeybindingFileDiagnostic } from '../../../../../shared/keybindings/types' import { keybindingDiagnosticText } from './keybinding-diagnostic-text' export function KeybindingFileDiagnostics({ diff --git a/src/renderer/src/components/settings/KeybindingsFileActions.tsx b/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx similarity index 94% rename from src/renderer/src/components/settings/KeybindingsFileActions.tsx rename to src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx index 5aa7af0aed2..de71d32ae49 100644 --- a/src/renderer/src/components/settings/KeybindingsFileActions.tsx +++ b/src/renderer/src/components/settings/shortcuts/KeybindingsFileActions.tsx @@ -1,19 +1,19 @@ -import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host' +import { LOCAL_EXECUTION_HOST_ID } from '../../../../../shared/execution-host' import React from 'react' import { ChevronDown, Code2, ExternalLink, FileText, FolderOpen, RefreshCw } from 'lucide-react' import { toast } from 'sonner' -import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../shared/constants' -import { useAppStore } from '../../store' -import { revealFloatingWorkspacePanel } from '../../lib/floating-workspace-panel-reveal' -import { detectLanguage } from '../../lib/language-detect' -import { Button } from '../ui/button' +import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../../../shared/constants' +import { useAppStore } from '../../../store/index' +import { revealFloatingWorkspacePanel } from '../../../lib/floating-workspace-panel-reveal' +import { detectLanguage } from '../../../../../shared/editor-language/editor-language-detect' +import { Button } from '../../ui/button' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger -} from '../ui/dropdown-menu' +} from '../../ui/dropdown-menu' import { translate } from '@/i18n/i18n' function openFailureMessage(reason: string): string { diff --git a/src/renderer/src/components/settings/ShortcutBindingSubRow.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutBindingSubRow.tsx similarity index 98% rename from src/renderer/src/components/settings/ShortcutBindingSubRow.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutBindingSubRow.tsx index 09632ea6680..65b30107672 100644 --- a/src/renderer/src/components/settings/ShortcutBindingSubRow.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutBindingSubRow.tsx @@ -1,5 +1,5 @@ import React from 'react' -import type { KeybindingActionId, KeybindingInput } from '../../../../shared/keybindings' +import type { KeybindingActionId, KeybindingInput } from '../../../../../shared/keybindings/types' import { ShortcutRecorderButton } from './ShortcutRecorderButton' import { ShortcutRemoveButton } from './ShortcutRemoveButton' diff --git a/src/renderer/src/components/settings/ShortcutCommandBlock.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutCommandBlock.tsx similarity index 95% rename from src/renderer/src/components/settings/ShortcutCommandBlock.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutCommandBlock.tsx index 5dfff97e6df..7e09ae88b08 100644 --- a/src/renderer/src/components/settings/ShortcutCommandBlock.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutCommandBlock.tsx @@ -1,17 +1,17 @@ import React from 'react' import { Ban, Plus, RotateCcw, Terminal } from 'lucide-react' -import { - isDigitIndexActionId, - type KeybindingActionId, - type KeybindingDefinition, - type KeybindingInput -} from '../../../../shared/keybindings' -import { cn } from '../../lib/utils' -import { Badge } from '../ui/badge' -import { Button } from '../ui/button' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { TruncatedSidebarLabel } from '../sidebar/truncated-sidebar-label' -import { SearchableSetting } from './SearchableSetting' +import { isDigitIndexActionId } from '../../../../../shared/keybindings/definitions' +import type { + KeybindingActionId, + KeybindingDefinition, + KeybindingInput +} from '../../../../../shared/keybindings/types' +import { cn } from '../../../lib/utils' +import { Badge } from '../../ui/badge' +import { Button } from '../../ui/button' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' +import { TruncatedSidebarLabel } from '../../sidebar/truncated-sidebar-label' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { ShortcutBindingSubRow } from './ShortcutBindingSubRow' import { ShortcutRecorderButton } from './ShortcutRecorderButton' import { ShortcutRemoveButton } from './ShortcutRemoveButton' diff --git a/src/renderer/src/components/settings/ShortcutFilterRail.test.ts b/src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.test.ts similarity index 100% rename from src/renderer/src/components/settings/ShortcutFilterRail.test.ts rename to src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.test.ts diff --git a/src/renderer/src/components/settings/ShortcutFilterRail.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.tsx similarity index 95% rename from src/renderer/src/components/settings/ShortcutFilterRail.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.tsx index 2ee24bede47..6370616cbbe 100644 --- a/src/renderer/src/components/settings/ShortcutFilterRail.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.tsx @@ -1,12 +1,13 @@ import React from 'react' import { Search, X } from 'lucide-react' -import { isClipboardTextByteLengthOverLimit } from '../../../../shared/clipboard-text' -import { formatKeybindingList, type KeybindingDefinition } from '../../../../shared/keybindings' -import { cn } from '../../lib/utils' -import { Button } from '../ui/button' -import { Input } from '../ui/input' +import { isClipboardTextByteLengthOverLimit } from '../../../../../shared/clipboard-text' +import { formatKeybindingList } from '../../../../../shared/keybindings/formatting' +import type { KeybindingDefinition } from '../../../../../shared/keybindings/types' +import { cn } from '../../../lib/utils' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' import type { ShortcutTerminalStatus } from './shortcut-terminal-status' -import { matchesSettingsSearch, type SettingsSearchEntry } from './settings-search' +import { matchesSettingsSearch, type SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' export type ShortcutFilter = 'all' | 'modified' | 'unassigned' | 'conflicts' diff --git a/src/renderer/src/components/settings/ShortcutRecorderButton.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutRecorderButton.tsx similarity index 93% rename from src/renderer/src/components/settings/ShortcutRecorderButton.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutRecorderButton.tsx index 5d3833d763d..13282463180 100644 --- a/src/renderer/src/components/settings/ShortcutRecorderButton.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutRecorderButton.tsx @@ -1,18 +1,15 @@ import React, { useEffect, useRef } from 'react' -import { - formatKeybinding, - isDoubleTapBinding, - type KeybindingActionId, - type KeybindingInput -} from '../../../../shared/keybindings' +import { formatKeybinding } from '../../../../../shared/keybindings/formatting' +import { isDoubleTapBinding } from '../../../../../shared/keybindings/normalization' +import type { KeybindingActionId, KeybindingInput } from '../../../../../shared/keybindings/types' import { ModifierDoubleTapDetector, modifierFromKeyEvent, toModifierDoubleTapEvent -} from '../../../../shared/modifier-double-tap-detector' -import { cn } from '../../lib/utils' -import { ShortcutKeyCombo } from '../ShortcutKeyCombo' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' +} from '../../../../../shared/modifier-double-tap-detector' +import { cn } from '../../../lib/utils' +import { ShortcutKeyCombo } from '../../ShortcutKeyCombo' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' import { translate } from '@/i18n/i18n' type ShortcutRecorderButtonProps = { diff --git a/src/renderer/src/components/settings/ShortcutRemoveButton.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutRemoveButton.tsx similarity index 86% rename from src/renderer/src/components/settings/ShortcutRemoveButton.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutRemoveButton.tsx index 1ba8f818bc2..7251fd0a9b6 100644 --- a/src/renderer/src/components/settings/ShortcutRemoveButton.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutRemoveButton.tsx @@ -1,8 +1,8 @@ import React from 'react' import { X } from 'lucide-react' -import type { KeybindingActionId } from '../../../../shared/keybindings' -import { Button } from '../ui/button' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' +import type { KeybindingActionId } from '../../../../../shared/keybindings/types' +import { Button } from '../../ui/button' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' import { translate } from '@/i18n/i18n' // Let parent rows own hover reveal because header/subrows use different hover groups. diff --git a/src/renderer/src/components/settings/ShortcutRowsList.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutRowsList.tsx similarity index 97% rename from src/renderer/src/components/settings/ShortcutRowsList.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutRowsList.tsx index 3d12ddeb6af..d928168b8e2 100644 --- a/src/renderer/src/components/settings/ShortcutRowsList.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutRowsList.tsx @@ -1,6 +1,6 @@ import React from 'react' -import type { KeybindingActionId, KeybindingInput } from '../../../../shared/keybindings' -import { cn } from '../../lib/utils' +import type { KeybindingActionId, KeybindingInput } from '../../../../../shared/keybindings/types' +import { cn } from '../../../lib/utils' import { ShortcutCommandBlock } from './ShortcutCommandBlock' import type { ShortcutRowsByGroup } from './ShortcutFilterRail' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/ShortcutTerminalPolicyControl.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutTerminalPolicyControl.tsx similarity index 89% rename from src/renderer/src/components/settings/ShortcutTerminalPolicyControl.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutTerminalPolicyControl.tsx index 61bf22cabb8..c7260e4ec6b 100644 --- a/src/renderer/src/components/settings/ShortcutTerminalPolicyControl.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutTerminalPolicyControl.tsx @@ -1,8 +1,8 @@ import React from 'react' -import type { TerminalShortcutPolicy } from '../../../../shared/keybindings' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow } from './SettingsFormControls' +import type { TerminalShortcutPolicy } from '../../../../../shared/keybindings/types' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsRow } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' export function ShortcutTerminalPolicyControl({ diff --git a/src/renderer/src/components/settings/ShortcutsPane.provenance.test.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutsPane.provenance.test.tsx similarity index 98% rename from src/renderer/src/components/settings/ShortcutsPane.provenance.test.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutsPane.provenance.test.tsx index 22c905d5d82..e99b6bd2bee 100644 --- a/src/renderer/src/components/settings/ShortcutsPane.provenance.test.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutsPane.provenance.test.tsx @@ -2,7 +2,7 @@ import React from 'react' import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, expect, it, vi } from 'vitest' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import type { ShortcutRowsList } from './ShortcutRowsList' import { ShortcutsPane } from './ShortcutsPane' diff --git a/src/renderer/src/components/settings/ShortcutsPane.tsx b/src/renderer/src/components/settings/shortcuts/ShortcutsPane.tsx similarity index 95% rename from src/renderer/src/components/settings/ShortcutsPane.tsx rename to src/renderer/src/components/settings/shortcuts/ShortcutsPane.tsx index 9587e835aa5..84f9cb57a60 100644 --- a/src/renderer/src/components/settings/ShortcutsPane.tsx +++ b/src/renderer/src/components/settings/shortcuts/ShortcutsPane.tsx @@ -3,19 +3,21 @@ import { useTranslation } from 'react-i18next' import { useShallow } from 'zustand/react/shallow' import { findKeybindingConflictsForDefinitions, - formatKeybindingList, - getEffectiveKeybindingsForDefinition, - getKeybindingDefinition, - keybindingFromInputForAction, - normalizeKeybindingListForAction, - type KeybindingActionId, - type KeybindingDefinition, - type KeybindingInput -} from '../../../../shared/keybindings' + formatKeybindingList +} from '../../../../../shared/keybindings/formatting' +import { getEffectiveKeybindingsForDefinition } from '../../../../../shared/keybindings/effective' +import { getKeybindingDefinition } from '../../../../../shared/keybindings/definitions' +import { keybindingFromInputForAction } from '../../../../../shared/keybindings/input' +import { normalizeKeybindingListForAction } from '../../../../../shared/keybindings/normalization' +import type { + KeybindingActionId, + KeybindingDefinition, + KeybindingInput +} from '../../../../../shared/keybindings/types' import { EMPTY_DISABLED_TUI_AGENTS } from './shortcut-groups' -import { useAppStore } from '../../store' +import { useAppStore } from '../../../store/index' import { KeybindingsFileActions } from './KeybindingsFileActions' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' import { hasCommonBindingOverride, removeBindingOverride, @@ -25,7 +27,7 @@ import { ShortcutFilterRail, type ShortcutFilter } from './ShortcutFilterRail' import { ShortcutRowsList } from './ShortcutRowsList' import { ShortcutTerminalPolicyControl } from './ShortcutTerminalPolicyControl' import { getTerminalShortcutPolicySearchEntry } from './shortcuts-search' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from '../search/settings-search' import { clearRecordingActionForShortcutMutation } from './shortcut-recording-state' import { adjustRecordingIndexAfterRemove, diff --git a/src/renderer/src/components/settings/keybinding-diagnostic-text.test.ts b/src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.test.ts similarity index 93% rename from src/renderer/src/components/settings/keybinding-diagnostic-text.test.ts rename to src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.test.ts index c118678eb0b..5a3aa32c0c2 100644 --- a/src/renderer/src/components/settings/keybinding-diagnostic-text.test.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.test.ts @@ -1,7 +1,8 @@ import { afterEach, describe, expect, it } from 'vitest' import { i18n } from '@/i18n/i18n' import es from '@/i18n/locales/es.json' -import { keybindingFileDiagnostic, normalizeKeybinding } from '../../../../shared/keybindings' +import { keybindingFileDiagnostic } from '../../../../../shared/keybindings/keybinding-diagnostic-copy' +import { normalizeKeybinding } from '../../../../../shared/keybindings/normalization' import { keybindingDiagnosticText, keybindingValidationErrorText diff --git a/src/renderer/src/components/settings/keybinding-diagnostic-text.ts b/src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.ts similarity index 95% rename from src/renderer/src/components/settings/keybinding-diagnostic-text.ts rename to src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.ts index 13bb7269cba..5987ce03d6c 100644 --- a/src/renderer/src/components/settings/keybinding-diagnostic-text.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-diagnostic-text.ts @@ -3,11 +3,13 @@ import { KEYBINDING_DIAGNOSTIC_COPY as DIAGNOSTIC_EN, KEYBINDING_REASON_COPY as REASON_EN, type KeybindingDiagnosticCode, - type KeybindingFileDiagnostic, - type KeybindingReasonCode, + type KeybindingReasonCode +} from '../../../../../shared/keybindings/keybinding-diagnostic-copy' +import type { KeybindingFileDiagnostic } from '../../../../../shared/keybindings/types' +import { getKeybindingDefinition, isKeybindingActionId -} from '../../../../shared/keybindings' +} from '../../../../../shared/keybindings/definitions' import { localizedKeybindingTitle } from './keybinding-title-copy' const REASON_COPY: Record string> = { diff --git a/src/renderer/src/components/settings/keybinding-override-edits.ts b/src/renderer/src/components/settings/shortcuts/keybinding-override-edits.ts similarity index 94% rename from src/renderer/src/components/settings/keybinding-override-edits.ts rename to src/renderer/src/components/settings/shortcuts/keybinding-override-edits.ts index fe0c4087275..4c3e165e0c8 100644 --- a/src/renderer/src/components/settings/keybinding-override-edits.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-override-edits.ts @@ -2,7 +2,7 @@ import type { KeybindingActionId, KeybindingFileSnapshot, KeybindingOverrides -} from '../../../../shared/keybindings' +} from '../../../../../shared/keybindings/types' export function sameBindings(a: readonly string[], b: readonly string[]): boolean { return a.length === b.length && a.every((binding, index) => binding === b[index]) diff --git a/src/renderer/src/components/settings/keybinding-title-copy.test.ts b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.test.ts similarity index 88% rename from src/renderer/src/components/settings/keybinding-title-copy.test.ts rename to src/renderer/src/components/settings/shortcuts/keybinding-title-copy.test.ts index d6c37a874fd..ae7fe38db06 100644 --- a/src/renderer/src/components/settings/keybinding-title-copy.test.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.test.ts @@ -1,10 +1,12 @@ import { afterEach, describe, expect, it } from 'vitest' import { agentTabActionId, - getKeybindingDefinition, - type KeybindingActionId, - type KeybindingDefinition -} from '../../../../shared/keybindings' + getKeybindingDefinition +} from '../../../../../shared/keybindings/definitions' +import type { + KeybindingActionId, + KeybindingDefinition +} from '../../../../../shared/keybindings/types' import { i18n } from '@/i18n/i18n' import { localizeKeybindingDefinition } from './keybinding-title-copy' diff --git a/src/renderer/src/components/settings/keybinding-title-copy.ts b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts similarity index 96% rename from src/renderer/src/components/settings/keybinding-title-copy.ts rename to src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts index fe4274e41fd..6c533e83f94 100644 --- a/src/renderer/src/components/settings/keybinding-title-copy.ts +++ b/src/renderer/src/components/settings/shortcuts/keybinding-title-copy.ts @@ -1,13 +1,16 @@ +import { agentTabActionId } from '../../../../../shared/keybindings/definitions' +import type { + AgentTabActionId, + KeybindingActionId, + KeybindingDefinition, + PluginKeybindingActionId +} from '../../../../../shared/keybindings/types' import { - agentTabActionId, - type AgentTabActionId, - type KeybindingActionId, - type KeybindingDefinition, - type PluginKeybindingActionId -} from '../../../../shared/keybindings' -import { ALL_TUI_AGENTS, TUI_AGENT_DISPLAY_NAMES } from '../../../../shared/tui-agent-display-names' + ALL_TUI_AGENTS, + TUI_AGENT_DISPLAY_NAMES +} from '../../../../../shared/tui-agent-display-names' import { translate } from '@/i18n/i18n' -import { uniqueKeywords } from './settings-search-keywords' +import { uniqueKeywords } from '../search/settings-search-keywords' type StaticKeybindingActionId = Exclude< KeybindingActionId, diff --git a/src/renderer/src/components/settings/shortcut-binding-list-mutations.ts b/src/renderer/src/components/settings/shortcuts/shortcut-binding-list-mutations.ts similarity index 100% rename from src/renderer/src/components/settings/shortcut-binding-list-mutations.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-binding-list-mutations.ts diff --git a/src/renderer/src/components/settings/shortcut-definition-catalog.ts b/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts similarity index 90% rename from src/renderer/src/components/settings/shortcut-definition-catalog.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts index a690a4f3515..813a3d16c32 100644 --- a/src/renderer/src/components/settings/shortcut-definition-catalog.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-definition-catalog.ts @@ -1,15 +1,17 @@ import { findKeybindingConflictsForDefinitions, - formatKeybindingList, - type KeybindingActionId, - type KeybindingDefinition, - type KeybindingOverrides -} from '../../../../shared/keybindings' + formatKeybindingList +} from '../../../../../shared/keybindings/formatting' +import type { + KeybindingActionId, + KeybindingDefinition, + KeybindingOverrides +} from '../../../../../shared/keybindings/types' import { findMacSystemHotkeyConflicts, type MacCapturedDigitChord -} from '../../../../shared/macos-symbolic-hotkeys' -import type { TuiAgent } from '../../../../shared/tui-agent' +} from '../../../../../shared/macos-symbolic-hotkeys' +import type { TuiAgent } from '../../../../../shared/tui-agent' import type { ActivePluginCommand } from '@/store/plugin-panels' import { buildPluginCommandKeybindingDefinitions } from '@/lib/plugin-command-keybindings' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/shortcut-groups.test.ts b/src/renderer/src/components/settings/shortcuts/shortcut-groups.test.ts similarity index 100% rename from src/renderer/src/components/settings/shortcut-groups.test.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-groups.test.ts diff --git a/src/renderer/src/components/settings/shortcut-groups.ts b/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts similarity index 79% rename from src/renderer/src/components/settings/shortcut-groups.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-groups.ts index 80fec453781..68098110e57 100644 --- a/src/renderer/src/components/settings/shortcut-groups.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-groups.ts @@ -1,11 +1,13 @@ import { KEYBINDING_DEFINITIONS, - agentTabActionId, - type KeybindingActionId, - type KeybindingDefinition -} from '../../../../shared/keybindings' -import { normalizeDisabledTuiAgents } from '../../../../shared/tui-agent-selection' -import type { TuiAgent } from '../../../../shared/tui-agent' + agentTabActionId +} from '../../../../../shared/keybindings/definitions' +import type { + KeybindingActionId, + KeybindingDefinition +} from '../../../../../shared/keybindings/types' +import { normalizeDisabledTuiAgents } from '../../../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../../../shared/tui-agent' import { localizeKeybindingDefinition } from './keybinding-title-copy' export type ShortcutGroup = { diff --git a/src/renderer/src/components/settings/shortcut-recording-state.ts b/src/renderer/src/components/settings/shortcuts/shortcut-recording-state.ts similarity index 74% rename from src/renderer/src/components/settings/shortcut-recording-state.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-recording-state.ts index de08df3393d..67f198aa7ec 100644 --- a/src/renderer/src/components/settings/shortcut-recording-state.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-recording-state.ts @@ -1,4 +1,4 @@ -import type { KeybindingActionId } from '../../../../shared/keybindings' +import type { KeybindingActionId } from '../../../../../shared/keybindings/types' export function clearRecordingActionForShortcutMutation( recordingActionId: KeybindingActionId | null, diff --git a/src/renderer/src/components/settings/shortcut-row-visibility.test.ts b/src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.test.ts similarity index 92% rename from src/renderer/src/components/settings/shortcut-row-visibility.test.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.test.ts index 68639fbb327..0eb5a337f70 100644 --- a/src/renderer/src/components/settings/shortcut-row-visibility.test.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { getKeybindingDefinition } from '../../../../shared/keybindings' +import { getKeybindingDefinition } from '../../../../../shared/keybindings/definitions' import { buildShortcutRowVisibility } from './shortcut-row-visibility' diff --git a/src/renderer/src/components/settings/shortcut-row-visibility.ts b/src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.ts similarity index 93% rename from src/renderer/src/components/settings/shortcut-row-visibility.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.ts index 423e8d9f0e5..7ba81239894 100644 --- a/src/renderer/src/components/settings/shortcut-row-visibility.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-row-visibility.ts @@ -1,9 +1,9 @@ -import { - getEffectiveKeybindingsForDefinition, - type KeybindingActionId, - type KeybindingOverrides, - type TerminalShortcutPolicy -} from '../../../../shared/keybindings' +import { getEffectiveKeybindingsForDefinition } from '../../../../../shared/keybindings/effective' +import type { + KeybindingActionId, + KeybindingOverrides, + TerminalShortcutPolicy +} from '../../../../../shared/keybindings/types' import { hasOwnBindingOverride } from './keybinding-override-edits' import type { ShortcutGroup } from './shortcut-groups' import { getShortcutTerminalStatus } from './shortcut-terminal-status' diff --git a/src/renderer/src/components/settings/shortcut-terminal-status.ts b/src/renderer/src/components/settings/shortcuts/shortcut-terminal-status.ts similarity index 90% rename from src/renderer/src/components/settings/shortcut-terminal-status.ts rename to src/renderer/src/components/settings/shortcuts/shortcut-terminal-status.ts index 6952dc5b5bb..2c3845de06a 100644 --- a/src/renderer/src/components/settings/shortcut-terminal-status.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcut-terminal-status.ts @@ -1,10 +1,12 @@ import { isKeybindingAllowedInTerminal, isKeybindingPotentialTerminalConflict, - keybindingIsActiveInContext, - type KeybindingDefinition, - type TerminalShortcutPolicy -} from '../../../../shared/keybindings' + keybindingIsActiveInContext +} from '../../../../../shared/keybindings/effective' +import type { + KeybindingDefinition, + TerminalShortcutPolicy +} from '../../../../../shared/keybindings/types' import { translate } from '@/i18n/i18n' export type ShortcutTerminalStatus = { diff --git a/src/renderer/src/components/settings/shortcuts-search.ts b/src/renderer/src/components/settings/shortcuts/shortcuts-search.ts similarity index 92% rename from src/renderer/src/components/settings/shortcuts-search.ts rename to src/renderer/src/components/settings/shortcuts/shortcuts-search.ts index 34fe93174de..84cf979136e 100644 --- a/src/renderer/src/components/settings/shortcuts-search.ts +++ b/src/renderer/src/components/settings/shortcuts/shortcuts-search.ts @@ -1,7 +1,7 @@ -import { KEYBINDING_DEFINITIONS } from '../../../../shared/keybindings' -import type { SettingsSearchEntry } from './settings-search' +import { KEYBINDING_DEFINITIONS } from '../../../../../shared/keybindings/definitions' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { localizeKeybindingDefinition } from './keybinding-title-copy' diff --git a/src/renderer/src/components/settings/use-mac-captured-digit-chords.test.ts b/src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.test.ts similarity index 97% rename from src/renderer/src/components/settings/use-mac-captured-digit-chords.test.ts rename to src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.test.ts index 3cd4de14bd6..823286c89c8 100644 --- a/src/renderer/src/components/settings/use-mac-captured-digit-chords.test.ts +++ b/src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.test.ts @@ -1,11 +1,12 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, renderHook, waitFor } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' import type { MacCapturedDigitRowChord, MacDigitRowCode -} from '../../../../shared/macos-symbolic-hotkeys' +} from '../../../../../shared/macos-symbolic-hotkeys' import type { LayoutMapLike } from '@/lib/keyboard-layout/detect-option-as-alt' import { useMacCapturedDigitChords } from './use-mac-captured-digit-chords' diff --git a/src/renderer/src/components/settings/use-mac-captured-digit-chords.ts b/src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.ts similarity index 98% rename from src/renderer/src/components/settings/use-mac-captured-digit-chords.ts rename to src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.ts index e6ec2690d98..791aa842d77 100644 --- a/src/renderer/src/components/settings/use-mac-captured-digit-chords.ts +++ b/src/renderer/src/components/settings/shortcuts/use-mac-captured-digit-chords.ts @@ -3,7 +3,7 @@ import { resolveCapturedDigitChordsForLayout, type MacCapturedDigitChord, type MacCapturedDigitRowChord -} from '../../../../shared/macos-symbolic-hotkeys' +} from '../../../../../shared/macos-symbolic-hotkeys' import type { LayoutMapLike } from '@/lib/keyboard-layout/detect-option-as-alt' import { normalizeLayoutBaseCharacter } from '@/lib/keyboard-layout/layout-base-character' diff --git a/src/renderer/src/components/settings/source-control-ai-settings-persistence.test.tsx b/src/renderer/src/components/settings/source-control-ai-settings-persistence.test.tsx index 3f8e66706d6..ad483121782 100644 --- a/src/renderer/src/components/settings/source-control-ai-settings-persistence.test.tsx +++ b/src/renderer/src/components/settings/source-control-ai-settings-persistence.test.tsx @@ -3,9 +3,9 @@ import type { ComponentProps } from 'react' import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { useAppStore } from '../../store' -import { ChatNamingSetting } from './ChatNamingSetting' +import { ChatNamingSetting } from './chat/ChatNamingSetting' import { CommitMessageAiPane } from './CommitMessageAiPane' -import { useSettingsInteractionController } from './use-settings-interaction-controller' +import { useSettingsInteractionController } from './page/use-settings-interaction-controller' import { persist, pickerLocaleFixture, diff --git a/src/renderer/src/components/settings/source-control-ai-settings-picker-retention.test.tsx b/src/renderer/src/components/settings/source-control-ai-settings-picker-retention.test.tsx index 9994a75ee10..c6770b6258b 100644 --- a/src/renderer/src/components/settings/source-control-ai-settings-picker-retention.test.tsx +++ b/src/renderer/src/components/settings/source-control-ai-settings-picker-retention.test.tsx @@ -10,7 +10,7 @@ import { type SettingsPersistenceModel } from './__fixtures__/settings-persistence-test-fixture' import { CommitMessageAiPane } from './CommitMessageAiPane' -import { useSettingsInteractionController } from './use-settings-interaction-controller' +import { useSettingsInteractionController } from './page/use-settings-interaction-controller' import { TooltipProvider } from '@/components/ui/tooltip' import { RUNTIME_CAPABILITIES } from '../../../../shared/protocol-version' import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' diff --git a/src/renderer/src/components/settings/ssh-search.ts b/src/renderer/src/components/settings/ssh-search.ts index 1f2fbb8433b..a27b9480fea 100644 --- a/src/renderer/src/components/settings/ssh-search.ts +++ b/src/renderer/src/components/settings/ssh-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getSshPaneSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/tasks-search.ts b/src/renderer/src/components/settings/tasks-search.ts index 2c1657cd594..d8617457f07 100644 --- a/src/renderer/src/components/settings/tasks-search.ts +++ b/src/renderer/src/components/settings/tasks-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getTasksPaneSearchKeywords = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/TerminalAdvancedSection.test.tsx b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.test.tsx similarity index 93% rename from src/renderer/src/components/settings/TerminalAdvancedSection.test.tsx rename to src/renderer/src/components/settings/terminal/TerminalAdvancedSection.test.tsx index facfa0e8e7f..0dd58dbe62e 100644 --- a/src/renderer/src/components/settings/TerminalAdvancedSection.test.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.test.tsx @@ -1,11 +1,12 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { TERMINAL_DEFAULT_WORD_SEPARATOR } from '../../../../shared/terminal-word-separator' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { TERMINAL_DEFAULT_WORD_SEPARATOR } from '../../../../../shared/terminal-word-separator' import { TerminalAdvancedSection } from './TerminalAdvancedSection' vi.mock('@/i18n/i18n', () => ({ diff --git a/src/renderer/src/components/settings/TerminalAdvancedSection.tsx b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx similarity index 93% rename from src/renderer/src/components/settings/TerminalAdvancedSection.tsx rename to src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx index 1ad9f7e8372..79e10c97fa2 100644 --- a/src/renderer/src/components/settings/TerminalAdvancedSection.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalAdvancedSection.tsx @@ -1,26 +1,27 @@ -import { TerminalLimitSetting } from './TerminalLimitSetting' -import type { SettingsHostScope } from './settings-host-scope' +import { TerminalLimitSetting } from './session-management/TerminalLimitSetting' +import type { SettingsHostScope } from '../settings-host-scope' import { useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { TERMINAL_DEFAULT_WORD_SEPARATOR } from '../../../../shared/terminal-word-separator' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { TERMINAL_DEFAULT_WORD_SEPARATOR } from '../../../../../shared/terminal-word-separator' import { DESKTOP_TERMINAL_SCROLLBACK_ROWS_MAX, DESKTOP_TERMINAL_SCROLLBACK_ROWS_MIN, - normalizeDesktopTerminalScrollbackRows -} from '../../../../shared/terminal-scrollback-policy' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group' + normalizeDesktopTerminalScrollbackRows, + DESKTOP_TERMINAL_SCROLLBACK_ROW_PRESETS as SCROLLBACK_PRESETS_ROWS +} from '../../../../../shared/terminal-scrollback-policy' +import { Button } from '../../ui/button' +import { Input } from '../../ui/input' +import { ToggleGroup, ToggleGroupItem } from '../../ui/toggle-group' import { SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader -} from './SettingsFormControls' -import { SCROLLBACK_PRESETS_ROWS } from './SettingsConstants' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' -import { getTerminalWindowsPowershellImplementationSearchEntry } from './terminal-windows-search' -import { TerminalMacKeyboardSection } from './TerminalMacKeyboardSection' +} from '../form-controls/SettingsFormControls' + +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { matchesSettingsSearch } from '../search/settings-search' +import { getTerminalWindowsPowershellImplementationSearchEntry } from './platform/terminal-windows-search' +import { TerminalMacKeyboardSection } from './platform/TerminalMacKeyboardSection' import { translate } from '@/i18n/i18n' import { openAppHttpLinkFromAnchor } from '@/lib/app-http-link-open' diff --git a/src/renderer/src/components/settings/TerminalInteractionSection.tsx b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx similarity index 94% rename from src/renderer/src/components/settings/TerminalInteractionSection.tsx rename to src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx index e81acf48108..a763c4fe532 100644 --- a/src/renderer/src/components/settings/TerminalInteractionSection.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalInteractionSection.tsx @@ -1,14 +1,14 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { RotateCcw } from 'lucide-react' -import { Button } from '../ui/button' -import { Label } from '../ui/label' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' import { ScrollSpeedSlider } from './TerminalScrollSpeedSlider' -import { SettingsSubsectionHeader, SettingsSwitchRow } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' -import { matchesSettingsSearch } from './settings-search' -import { getTerminalRightClickToPasteSearchEntry } from './terminal-windows-search' -import { OSC52_CLIPBOARD_SETTING_ID } from '../terminal-pane/osc52-clipboard-setting-anchor' -import { isMacPlatform } from '../terminal-pane/terminal-link-open-hints' +import { SettingsSubsectionHeader, SettingsSwitchRow } from '../form-controls/SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { matchesSettingsSearch } from '../search/settings-search' +import { getTerminalRightClickToPasteSearchEntry } from './platform/terminal-windows-search' +import { OSC52_CLIPBOARD_SETTING_ID } from '../../terminal-pane/osc52-clipboard-setting-anchor' +import { isMacPlatform } from '../../terminal-pane/terminal-link-open-hints' import { translate } from '@/i18n/i18n' import { DEFAULT_TERMINAL_FAST_SCROLL_SENSITIVITY, @@ -19,7 +19,7 @@ import { import { TERMINAL_TUI_MOUSE_WHEEL_MULTIPLIER, normalizeTerminalTuiMouseWheelMultiplier -} from '@/lib/pane-manager/pane-terminal-mouse-wheel' +} from '@/lib/pane-manager/pane-terminal-tui-wheel-reports' type TerminalInteractionSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/TerminalPane.pwsh.test.ts b/src/renderer/src/components/settings/terminal/TerminalPane.pwsh.test.ts similarity index 92% rename from src/renderer/src/components/settings/TerminalPane.pwsh.test.ts rename to src/renderer/src/components/settings/terminal/TerminalPane.pwsh.test.ts index 90be9883fb2..0d19faeec99 100644 --- a/src/renderer/src/components/settings/TerminalPane.pwsh.test.ts +++ b/src/renderer/src/components/settings/terminal/TerminalPane.pwsh.test.ts @@ -29,7 +29,7 @@ vi.mock('react', async () => { } }) -vi.mock('../../store', () => ({ +vi.mock('../../../store/index', () => ({ useAppStore: (selector: (state: { settingsSearchQuery: string }) => unknown) => selector({ settingsSearchQuery: '' }) })) @@ -47,31 +47,31 @@ vi.mock('@/components/terminal-pane/pane-helpers', () => ({ isWindowsUserAgent: () => true })) -vi.mock('../ui/button', () => ({ +vi.mock('../../ui/button', () => ({ Button: function Button() { return null } })) -vi.mock('../ui/input', () => ({ +vi.mock('../../ui/input', () => ({ Input: function Input() { return null } })) -vi.mock('../ui/label', () => ({ +vi.mock('../../ui/label', () => ({ Label: function Label() { return null } })) -vi.mock('../ui/separator', () => ({ +vi.mock('../../ui/separator', () => ({ Separator: function Separator() { return null } })) -vi.mock('../ui/toggle-group', () => ({ +vi.mock('../../ui/toggle-group', () => ({ ToggleGroup: function ToggleGroup() { return null }, @@ -80,7 +80,7 @@ vi.mock('../ui/toggle-group', () => ({ } })) -vi.mock('./SettingsFormControls', () => ({ +vi.mock('../form-controls/SettingsFormControls', () => ({ SettingsRow: function SettingsRow({ description, control, @@ -95,9 +95,6 @@ vi.mock('./SettingsFormControls', () => ({ NumberField: function NumberField() { return null }, - FontAutocomplete: function FontAutocomplete() { - return null - }, SettingsSegmentedControl: function SettingsSegmentedControl({ options }: { @@ -118,8 +115,13 @@ vi.mock('./SettingsFormControls', () => ({ return null } })) +vi.mock('../appearance/fonts/FontAutocomplete', () => ({ + FontAutocomplete: function FontAutocomplete() { + return null + } +})) -vi.mock('./TerminalThemeSections', () => ({ +vi.mock('./themes/TerminalThemeSections', () => ({ TerminalThemeCatalogSection: function TerminalThemeCatalogSection() { return null } @@ -131,19 +133,19 @@ vi.mock('./TerminalWindowSection', () => ({ } })) -vi.mock('./TerminalConfigImportModal', () => ({ +vi.mock('./configuration/TerminalConfigImportModal', () => ({ TerminalConfigImportModal: function TerminalConfigImportModal() { return null } })) -vi.mock('./ManageSessionsSection', () => ({ +vi.mock('./session-management/ManageSessionsSection', () => ({ ManageSessionsSection: function ManageSessionsSection() { return null } })) -vi.mock('./TerminalWindowsAdministratorSection', () => ({ +vi.mock('./platform/TerminalWindowsAdministratorSection', () => ({ TerminalWindowsAdministratorSection: () => null })) @@ -153,7 +155,7 @@ vi.mock('./TerminalInteractionSection', () => ({ } })) -vi.mock('./TerminalRenderingSection', () => ({ +vi.mock('./appearance/TerminalRenderingSection', () => ({ TerminalRenderingSection: function TerminalRenderingSection() { return null } diff --git a/src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx b/src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx similarity index 90% rename from src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx rename to src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx index 5b938b7c4e5..49a76f73a75 100644 --- a/src/renderer/src/components/settings/TerminalPane.section-lifetime.test.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalPane.section-lifetime.test.tsx @@ -1,10 +1,11 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import type { ReactNode } from 'react' import { act, cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { getDefaultSettings } from '../../../../shared/constants' -import type { PtyManagementSession } from '../../../../preload/api-types' -import { notifyDaemonSessionInventoryInvalidated } from '../status-bar/daemon-session-inventory-invalidation' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { PtyManagementSession } from '../../../../../preload/api/pty-management-api' +import { notifyDaemonSessionInventoryInvalidated } from '../../status-bar/daemon-session-inventory-invalidation' import { TerminalPane } from './TerminalPane' const fake = vi.hoisted(() => ({ @@ -33,7 +34,7 @@ vi.mock('@/i18n/i18n', () => ({ i18n: { language: 'en' }, translate: (_key: string, fallback: string) => fallback })) -vi.mock('@/store', () => ({ +vi.mock('@/store/index', () => ({ useAppStore: (selector: (state: Record) => unknown) => selector({ settingsSearchQuery: fake.query, @@ -53,25 +54,25 @@ vi.mock('@/components/terminal-pane/pane-helpers', () => ({ vi.mock('@/lib/keyboard-layout/use-effective-mac-option-as-alt', () => ({ useDetectedOptionAsAlt: () => 'us' })) -vi.mock('@/components/settings/TerminalInteractionSection', () => ({ +vi.mock('@/components/settings/terminal/TerminalInteractionSection', () => ({ TerminalInteractionSection: () => null })) -vi.mock('@/components/settings/TerminalRenderingSection', () => ({ +vi.mock('@/components/settings/terminal/appearance/TerminalRenderingSection', () => ({ TerminalRenderingSection: () => null })) vi.mock('@/components/settings/TerminalSetupScriptSection', () => ({ TerminalSetupScriptSection: () => null })) -vi.mock('@/components/settings/TerminalWindowsShellSection', () => ({ +vi.mock('@/components/settings/terminal/platform/TerminalWindowsShellSection', () => ({ TerminalWindowsShellSection: () => null })) -vi.mock('@/components/settings/TerminalWindowsAdministratorSection', () => ({ +vi.mock('@/components/settings/terminal/platform/TerminalWindowsAdministratorSection', () => ({ TerminalWindowsAdministratorSection: () => null })) -vi.mock('@/components/settings/SearchableSetting', () => ({ +vi.mock('@/components/settings/section-layout/SearchableSetting', () => ({ SearchableSetting: ({ children }: { children: ReactNode }) => <>{children} })) -vi.mock('@/components/settings/ManageSessionsTable', () => ({ +vi.mock('@/components/settings/terminal/session-management/ManageSessionsTable', () => ({ ManageSessionsTable: ({ onRefresh, onRequestKill @@ -85,7 +86,7 @@ vi.mock('@/components/settings/ManageSessionsTable', () => ({ ) })) -vi.mock('@/components/settings/ManageSessionKillDialog', () => ({ +vi.mock('@/components/settings/terminal/session-management/ManageSessionKillDialog', () => ({ ManageSessionKillDialog: ({ session }: { session: PtyManagementSession | null }) => session ? Pending action for {session.sessionId} : null })) diff --git a/src/renderer/src/components/settings/TerminalPane.tsx b/src/renderer/src/components/settings/terminal/TerminalPane.tsx similarity index 91% rename from src/renderer/src/components/settings/TerminalPane.tsx rename to src/renderer/src/components/settings/terminal/TerminalPane.tsx index e4c31bd9c55..41fdc58ddc6 100644 --- a/src/renderer/src/components/settings/TerminalPane.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalPane.tsx @@ -1,38 +1,41 @@ -import type { SettingsHostScope } from './settings-host-scope' +import type { SettingsHostScope } from '../settings-host-scope' import { useState } from 'react' import { ChevronDown } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Textarea } from '../ui/textarea' -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { Textarea } from '../../ui/textarea' +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../ui/collapsible' import { cn } from '@/lib/utils' -import { SettingsSectionStack } from './SettingsSectionStack' -import { matchesSettingsSearch } from './settings-search' -import { useAppStore } from '../../store' +import { SettingsSectionStack } from '../section-layout/SettingsSectionStack' +import { matchesSettingsSearch } from '../search/settings-search' +import { useAppStore } from '../../../store/index' import { isMacUserAgent, isWindowsUserAgent } from '@/components/terminal-pane/pane-helpers' +import { getManageSessionsSearchEntries } from './terminal-window-setup-search' import { - getManageSessionsSearchEntries, getTerminalAdvancedSearchEntries, getTerminalMacOptionSearchEntries, - getTerminalMacYenSearchEntries, - getTerminalPaneInteractionSearchEntries, - getTerminalRenderingSearchEntries -} from './terminal-search' + getTerminalMacYenSearchEntries +} from './platform/terminal-advanced-platform-search' +import { getTerminalPaneInteractionSearchEntries } from './appearance/terminal-pane-appearance-search' +import { getTerminalRenderingSearchEntries } from './appearance/terminal-typography-search' import { getTerminalRightClickToPasteSearchEntry, getTerminalWindowsPowershellImplementationSearchEntry, getTerminalWindowsShellSearchEntry, getTerminalWindowsAdministratorSearchEntry -} from './terminal-windows-search' -import { ManageSessionsSection } from './ManageSessionsSection' +} from './platform/terminal-windows-search' +import { ManageSessionsSection } from './session-management/ManageSessionsSection' import { TerminalAdvancedSection } from './TerminalAdvancedSection' import { TerminalInteractionSection } from './TerminalInteractionSection' -import { TerminalRenderingSection } from './TerminalRenderingSection' -import { TerminalWindowsShellSection } from './TerminalWindowsShellSection' -import { TerminalWindowsAdministratorSection } from './TerminalWindowsAdministratorSection' -import { TerminalCustomShellInput } from './TerminalCustomShellInput' -import { SettingsSegmentedControl, SettingsSubsectionHeader } from './SettingsFormControls' +import { TerminalRenderingSection } from './appearance/TerminalRenderingSection' +import { TerminalWindowsShellSection } from './platform/TerminalWindowsShellSection' +import { TerminalWindowsAdministratorSection } from './platform/TerminalWindowsAdministratorSection' +import { TerminalCustomShellInput } from './platform/TerminalCustomShellInput' +import { + SettingsSegmentedControl, + SettingsSubsectionHeader +} from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' type TerminalPaneProps = { hostScope?: SettingsHostScope diff --git a/src/renderer/src/components/settings/TerminalScrollSpeedSlider.tsx b/src/renderer/src/components/settings/terminal/TerminalScrollSpeedSlider.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalScrollSpeedSlider.tsx rename to src/renderer/src/components/settings/terminal/TerminalScrollSpeedSlider.tsx index 6d8851a8c36..0ff23d3d663 100644 --- a/src/renderer/src/components/settings/TerminalScrollSpeedSlider.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalScrollSpeedSlider.tsx @@ -1,5 +1,5 @@ -import { Slider } from '../ui/slider' -import { Label } from '../ui/label' +import { Slider } from '../../ui/slider' +import { Label } from '../../ui/label' type ScrollSpeedSliderProps = { label: string diff --git a/src/renderer/src/components/settings/TerminalWindowSection.tsx b/src/renderer/src/components/settings/terminal/TerminalWindowSection.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalWindowSection.tsx rename to src/renderer/src/components/settings/terminal/TerminalWindowSection.tsx index 6c572f0b8c1..2de2e249f38 100644 --- a/src/renderer/src/components/settings/TerminalWindowSection.tsx +++ b/src/renderer/src/components/settings/terminal/TerminalWindowSection.tsx @@ -1,18 +1,18 @@ import { useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' import { TERMINAL_COLOR_OVERRIDES_SETTING, terminalColorOverridesForSlot, type TerminalThemeSlot -} from '../../../../shared/terminal-color-overrides' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Switch } from '../ui/switch' -import { ColorField, NumberField } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../../../../shared/terminal-color-overrides' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' +import { Switch } from '../../ui/switch' +import { ColorField, NumberField } from '../form-controls/SettingsFormControls' +import { SearchableSetting } from '../section-layout/SearchableSetting' import { clampNumber } from '@/lib/terminal-theme' import { isWebClientLocation } from '@/lib/web-client-location' -import { WindowMaterialSetting } from './WindowMaterialSetting' +import { WindowMaterialSetting } from '../appearance/WindowMaterialSetting' import { translate } from '@/i18n/i18n' import { COLOR_OVERRIDE_GROUPS } from './terminal-window-color-groups' diff --git a/src/renderer/src/components/settings/TerminalAdvancedTypographyControls.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalAdvancedTypographyControls.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx index c9f9ed199f3..29ba225b148 100644 --- a/src/renderer/src/components/settings/TerminalAdvancedTypographyControls.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalAdvancedTypographyControls.tsx @@ -1,4 +1,4 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { DEFAULT_TERMINAL_FONT_WEIGHT, DEFAULT_TERMINAL_FONT_WEIGHT_BOLD, @@ -7,13 +7,17 @@ import { TERMINAL_FONT_WEIGHT_STEP, normalizeTerminalFontWeight, normalizeTerminalFontWeightBold -} from '../../../../shared/terminal-fonts' +} from '../../../../../../shared/terminal-fonts' import { fontFamilyHasKnownLigatures, resolveTerminalLigaturesEnabled -} from '../../../../shared/terminal-ligatures' -import { NumberField, SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../../../../../shared/terminal-ligatures' +import { + NumberField, + SettingsRow, + SettingsSegmentedControl +} from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { clampNumber } from '@/lib/terminal-theme' import { translate } from '@/i18n/i18n' import { getTerminalAdvancedTypographySearchEntries } from './terminal-typography-search' diff --git a/src/renderer/src/components/settings/TerminalAppearanceSection.config-import.test.ts b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.config-import.test.ts similarity index 96% rename from src/renderer/src/components/settings/TerminalAppearanceSection.config-import.test.ts rename to src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.config-import.test.ts index 8ef157e63f8..99512b36362 100644 --- a/src/renderer/src/components/settings/TerminalAppearanceSection.config-import.test.ts +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.config-import.test.ts @@ -30,7 +30,7 @@ vi.mock('react', async () => { } }) -vi.mock('../../store', () => ({ +vi.mock('../../../../store/index', () => ({ useAppStore: (selector: (state: { settingsSearchQuery: string }) => unknown) => selector({ settingsSearchQuery: mockSettingsSearchQuery }) })) @@ -48,31 +48,31 @@ vi.mock('@/components/terminal-pane/pane-helpers', () => ({ isWindowsUserAgent: () => false })) -vi.mock('../ui/button', () => ({ +vi.mock('../../../ui/button', () => ({ Button: function Button() { return null } })) -vi.mock('../ui/input', () => ({ +vi.mock('../../../ui/input', () => ({ Input: function Input() { return null } })) -vi.mock('../ui/label', () => ({ +vi.mock('../../../ui/label', () => ({ Label: function Label() { return null } })) -vi.mock('../ui/separator', () => ({ +vi.mock('../../../ui/separator', () => ({ Separator: function Separator() { return null } })) -vi.mock('../ui/toggle-group', () => ({ +vi.mock('../../../ui/toggle-group', () => ({ ToggleGroup: function ToggleGroup() { return null }, @@ -81,16 +81,13 @@ vi.mock('../ui/toggle-group', () => ({ } })) -vi.mock('./SettingsFormControls', () => ({ +vi.mock('../../form-controls/SettingsFormControls', () => ({ SettingsRow: function SettingsRow({ children }: { children?: unknown }) { return children }, NumberField: function NumberField() { return null }, - FontAutocomplete: function FontAutocomplete() { - return null - }, SettingsSegmentedControl: function SettingsSegmentedControl({ options }: { @@ -105,26 +102,31 @@ vi.mock('./SettingsFormControls', () => ({ return null } })) +vi.mock('../../appearance/fonts/FontAutocomplete', () => ({ + FontAutocomplete: function FontAutocomplete() { + return null + } +})) -vi.mock('./TerminalThemeSections', () => ({ +vi.mock('../themes/TerminalThemeSections', () => ({ TerminalThemeCatalogSection: function TerminalThemeCatalogSection() { return null } })) -vi.mock('./TerminalWindowSection', () => ({ +vi.mock('../TerminalWindowSection', () => ({ TerminalWindowSection: function TerminalWindowSection() { return null } })) -vi.mock('./TerminalConfigImportModal', () => ({ +vi.mock('../configuration/TerminalConfigImportModal', () => ({ TerminalConfigImportModal: function TerminalConfigImportModal() { return null } })) -vi.mock('./WarpThemeImportModal', () => ({ +vi.mock('../themes/WarpThemeImportModal', () => ({ WarpThemeImportModal: function WarpThemeImportModal() { return null } diff --git a/src/renderer/src/components/settings/TerminalAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx similarity index 87% rename from src/renderer/src/components/settings/TerminalAppearanceSection.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx index 94edb87212c..d02f0986afc 100644 --- a/src/renderer/src/components/settings/TerminalAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalAppearanceSection.tsx @@ -1,43 +1,46 @@ import { Cat } from 'lucide-react' import { useState, type ReactNode } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import type { TerminalThemeSlot } from '../../../../shared/terminal-color-overrides' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import type { TerminalThemeSlot } from '../../../../../../shared/terminal-color-overrides' import { matchesSettingsSearch, normalizeSettingsSearchQuery, scoreSettingsSearch, type SettingsSearchEntry -} from './settings-search' -import { useAppStore } from '../../store' +} from '../../search/settings-search' +import { useAppStore } from '../../../../store/index' import { getTerminalAdvancedTypographySearchEntries, getTerminalCursorSearchEntries, + getTerminalTypographySearchEntries +} from './terminal-typography-search' +import { getTerminalDarkThemeSearchEntries, - getTerminalConfigImportSearchEntries, getTerminalLightThemeSearchEntries, - getTerminalPaneAppearanceSearchEntries, getTerminalThemeTargetSearchEntries, getTerminalWarpImportSearchEntries, - getTerminalYamlImportSearchEntries, - getTerminalTypographySearchEntries, - getTerminalWindowSearchEntries -} from './terminal-search' -import { Button } from '../ui/button' -import { SettingsRow, SettingsSubsectionHeader, FontAutocomplete } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' + getTerminalYamlImportSearchEntries +} from '../themes/terminal-theme-search' +import { getTerminalConfigImportSearchEntries } from '../platform/terminal-advanced-platform-search' +import { getTerminalPaneAppearanceSearchEntries } from './terminal-pane-appearance-search' +import { getTerminalWindowSearchEntries } from '../terminal-window-setup-search' +import { Button } from '../../../ui/button' +import { SettingsRow, SettingsSubsectionHeader } from '../../form-controls/SettingsFormControls' +import { FontAutocomplete } from '../../appearance/fonts/FontAutocomplete' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { TerminalFontSizeSetting } from './TerminalFontSizeSetting' import { TerminalAdvancedTypographyControls } from './TerminalAdvancedTypographyControls' -import { TerminalThemeCatalogSection } from './TerminalThemeSections' -import { TerminalWindowSection } from './TerminalWindowSection' +import { TerminalThemeCatalogSection } from '../themes/TerminalThemeSections' +import { TerminalWindowSection } from '../TerminalWindowSection' import { TerminalCursorAppearanceSection } from './TerminalCursorAppearanceSection' import { TerminalPaneAppearanceSection } from './TerminalPaneAppearanceSection' -import { AppearanceAdvancedDisclosure } from './AppearanceAdvancedDisclosure' -import { TerminalConfigImportModal } from './TerminalConfigImportModal' -import type { UseTerminalConfigImportReturn } from './useTerminalConfigImport' -import { WarpThemeImportModal } from './WarpThemeImportModal' -import type { UseWarpThemeImportReturn } from './useWarpThemeImport' +import { AppearanceAdvancedDisclosure } from '../../appearance/AppearanceAdvancedDisclosure' +import { TerminalConfigImportModal } from '../configuration/TerminalConfigImportModal' +import type { UseTerminalConfigImportReturn } from '../configuration/useTerminalConfigImport' +import { WarpThemeImportModal } from '../themes/WarpThemeImportModal' +import type { UseWarpThemeImportReturn } from '../themes/useWarpThemeImport' import { isWebClientLocation } from '@/lib/web-client-location' -import ghosttyIcon from '../../../../../resources/ghostty.svg' +import ghosttyIcon from '../../../../../../../resources/ghostty.svg' import { translate } from '@/i18n/i18n' type TerminalAppearanceSectionProps = { diff --git a/src/renderer/src/components/settings/TerminalContrastSetting.test.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.test.tsx similarity index 92% rename from src/renderer/src/components/settings/TerminalContrastSetting.test.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.test.tsx index 41739d8bb2d..6a62b064a27 100644 --- a/src/renderer/src/components/settings/TerminalContrastSetting.test.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.test.tsx @@ -1,11 +1,14 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { useState } from 'react' import { cleanup, fireEvent, render, screen } from '@testing-library/react' import { afterEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { TerminalContrastSetting } from './TerminalContrastSetting' -vi.mock('./SearchableSetting', () => ({ SearchableSetting: ({ children }) => children })) +vi.mock('../../section-layout/SearchableSetting', () => ({ + SearchableSetting: ({ children }) => children +})) afterEach(cleanup) function mount(initial: number | undefined = undefined): ReturnType { diff --git a/src/renderer/src/components/settings/TerminalContrastSetting.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx similarity index 90% rename from src/renderer/src/components/settings/TerminalContrastSetting.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx index 76919de9476..efabb80235b 100644 --- a/src/renderer/src/components/settings/TerminalContrastSetting.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalContrastSetting.tsx @@ -1,14 +1,18 @@ import { useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Slider } from '../ui/slider' -import { NumberField, SettingsRow, SettingsSegmentedControl } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { Slider } from '../../../ui/slider' +import { + NumberField, + SettingsRow, + SettingsSegmentedControl +} from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { LIGHT_BG_MIN_CONTRAST } from '../../../../../../shared/terminal-contrast-correction' import { - LIGHT_BG_MIN_CONTRAST, MIN_TERMINAL_CONTRAST_RATIO, MAX_TERMINAL_CONTRAST_RATIO, normalizeTerminalMinimumContrastRatio -} from '../../../../shared/terminal-contrast-correction' +} from '../../../../../../shared/terminal-minimum-contrast-settings' import { translate } from '@/i18n/i18n' type ContrastMode = 'auto' | 'off' | 'custom' diff --git a/src/renderer/src/components/settings/TerminalCursorAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalCursorAppearanceSection.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx index e5b3cd972ef..7b1f608f1b0 100644 --- a/src/renderer/src/components/settings/TerminalCursorAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalCursorAppearanceSection.tsx @@ -1,12 +1,12 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { NumberField, SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader, SettingsSwitchRow -} from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { clampNumber } from '@/lib/terminal-theme' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/TerminalFontSizeSetting.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx similarity index 89% rename from src/renderer/src/components/settings/TerminalFontSizeSetting.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx index 284f5bd31d4..8efc8d2cece 100644 --- a/src/renderer/src/components/settings/TerminalFontSizeSetting.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalFontSizeSetting.tsx @@ -1,9 +1,9 @@ import { Minus, Plus } from 'lucide-react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { SettingsRow } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { Button } from '../../../ui/button' +import { Input } from '../../../ui/input' +import { SettingsRow } from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' export function TerminalFontSizeSetting({ diff --git a/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx similarity index 91% rename from src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx index 84b7ed02ffc..c12108a2fe6 100644 --- a/src/renderer/src/components/settings/TerminalPaneAppearanceSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalPaneAppearanceSection.tsx @@ -1,7 +1,7 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../../../../shared/constants' -import { NumberField, SettingsSubsectionHeader } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { DEFAULT_TERMINAL_INACTIVE_PANE_OPACITY } from '../../../../../../shared/constants' +import { NumberField, SettingsSubsectionHeader } from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { clampNumber, resolvePaneStyleOptions } from '@/lib/terminal-theme' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/TerminalRenderingSection.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalRenderingSection.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx index d4b01448251..f8a476d838f 100644 --- a/src/renderer/src/components/settings/TerminalRenderingSection.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalRenderingSection.tsx @@ -1,14 +1,14 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader, SettingsSwitchRow -} from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { TerminalContrastSetting } from './TerminalContrastSetting' import { translate } from '@/i18n/i18n' -import { resolveTerminalInlineImagesEnabled } from '../../../../shared/terminal-inline-images-settings' +import { resolveTerminalInlineImagesEnabled } from '../../../../../../shared/terminal-inline-images-settings' type TerminalRenderingSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/TerminalSettingsPreview.lifecycle.test.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.lifecycle.test.tsx similarity index 96% rename from src/renderer/src/components/settings/TerminalSettingsPreview.lifecycle.test.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.lifecycle.test.tsx index 3e37cc3f129..355a857ed58 100644 --- a/src/renderer/src/components/settings/TerminalSettingsPreview.lifecycle.test.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.lifecycle.test.tsx @@ -1,7 +1,7 @@ import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { Mock } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' type Cleanup = () => void @@ -135,11 +135,11 @@ vi.mock('@/lib/terminal-theme', () => ({ }) })) -vi.mock('../../../../shared/terminal-fonts', () => ({ +vi.mock('../../../../../../shared/terminal-fonts', () => ({ resolveTerminalFontWeights: () => ({ fontWeight: 500, fontWeightBold: 700 }) })) -vi.mock('../../../../shared/terminal-ligatures', () => ({ +vi.mock('../../../../../../shared/terminal-ligatures', () => ({ resolveTerminalLigaturesEnabled: () => mockLigaturesAddon.enabled })) diff --git a/src/renderer/src/components/settings/TerminalSettingsPreview.tsx b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx similarity index 96% rename from src/renderer/src/components/settings/TerminalSettingsPreview.tsx rename to src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx index 50f83742417..ae681475696 100644 --- a/src/renderer/src/components/settings/TerminalSettingsPreview.tsx +++ b/src/renderer/src/components/settings/terminal/appearance/TerminalSettingsPreview.tsx @@ -8,13 +8,13 @@ import { buildDefaultTerminalOptions } from '@/lib/pane-manager/pane-terminal-op import { buildFontFamily } from '@/lib/monospace-font-family' import { composeActiveTerminalTheme } from '@/components/terminal-pane/terminal-appearance' import { clampNumber, resolveEffectiveTerminalAppearance } from '@/lib/terminal-theme' -import { resolveTerminalMinimumContrastRatio } from '../../../../shared/terminal-contrast-correction' -import { resolveTerminalFontWeights } from '../../../../shared/terminal-fonts' -import { resolveTerminalLigaturesEnabled } from '../../../../shared/terminal-ligatures' -import { normalizeTerminalLineHeight } from '../../../../shared/terminal-line-height-settings' +import { resolveTerminalMinimumContrastRatio } from '../../../../../../shared/terminal-contrast-correction' +import { resolveTerminalFontWeights } from '../../../../../../shared/terminal-fonts' +import { resolveTerminalLigaturesEnabled } from '../../../../../../shared/terminal-ligatures' +import { normalizeTerminalLineHeight } from '../../../../../../shared/terminal-line-height-settings' import { PREVIEW_BUFFER } from './terminal-preview-content' -import { SettingsSwitch } from './SettingsFormControls' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { SettingsSwitch } from '../../form-controls/SettingsFormControls' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { translate } from '@/i18n/i18n' // Pin 36 columns for the 32-character sample plus margin; large fonts clip instead of wrapping. diff --git a/src/renderer/src/components/settings/terminal-pane-appearance-search.ts b/src/renderer/src/components/settings/terminal/appearance/terminal-pane-appearance-search.ts similarity index 96% rename from src/renderer/src/components/settings/terminal-pane-appearance-search.ts rename to src/renderer/src/components/settings/terminal/appearance/terminal-pane-appearance-search.ts index 11e790d6ad1..0ad784be537 100644 --- a/src/renderer/src/components/settings/terminal-pane-appearance-search.ts +++ b/src/renderer/src/components/settings/terminal/appearance/terminal-pane-appearance-search.ts @@ -1,6 +1,6 @@ -import { getTerminalClipboardSearchEntries } from './terminal-clipboard-search' +import { getTerminalClipboardSearchEntries } from '../terminal-clipboard-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getTerminalPaneAppearanceSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/terminal-preview-content.ts b/src/renderer/src/components/settings/terminal/appearance/terminal-preview-content.ts similarity index 100% rename from src/renderer/src/components/settings/terminal-preview-content.ts rename to src/renderer/src/components/settings/terminal/appearance/terminal-preview-content.ts diff --git a/src/renderer/src/components/settings/terminal-typography-search.ts b/src/renderer/src/components/settings/terminal/appearance/terminal-typography-search.ts similarity index 99% rename from src/renderer/src/components/settings/terminal-typography-search.ts rename to src/renderer/src/components/settings/terminal/appearance/terminal-typography-search.ts index 6a4c378fb83..3b3fe012548 100644 --- a/src/renderer/src/components/settings/terminal-typography-search.ts +++ b/src/renderer/src/components/settings/terminal/appearance/terminal-typography-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' const getTerminalTypographySearchEntryCatalog = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/TerminalConfigImportModal.tsx b/src/renderer/src/components/settings/terminal/configuration/TerminalConfigImportModal.tsx similarity index 96% rename from src/renderer/src/components/settings/TerminalConfigImportModal.tsx rename to src/renderer/src/components/settings/terminal/configuration/TerminalConfigImportModal.tsx index 27bc953d45e..d825077dc8d 100644 --- a/src/renderer/src/components/settings/TerminalConfigImportModal.tsx +++ b/src/renderer/src/components/settings/terminal/configuration/TerminalConfigImportModal.tsx @@ -2,8 +2,8 @@ import { FileUp } from 'lucide-react' import type { TerminalConfigImportFormat, TerminalConfigImportPreview -} from '../../../../shared/terminal-config-import-preview' -import { Button } from '../ui/button' +} from '../../../../../../shared/terminal-config-import-preview' +import { Button } from '../../../ui/button' import { Dialog, DialogContent, @@ -11,9 +11,9 @@ import { DialogFooter, DialogHeader, DialogTitle -} from '../ui/dialog' -import { SETTING_LABELS } from './setting-labels' -import { normalizeTerminalCustomThemes } from '../../../../shared/terminal-custom-themes' +} from '../../../ui/dialog' +import { SETTING_LABELS } from '../../search/setting-labels' +import { normalizeTerminalCustomThemes } from '../../../../../../shared/terminal-custom-themes' import { translate } from '@/i18n/i18n' type TerminalConfigImportModalProps = { diff --git a/src/renderer/src/components/settings/useTerminalConfigImport.ts b/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts similarity index 95% rename from src/renderer/src/components/settings/useTerminalConfigImport.ts rename to src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts index 5832b409610..47f796f74f0 100644 --- a/src/renderer/src/components/settings/useTerminalConfigImport.ts +++ b/src/renderer/src/components/settings/terminal/configuration/useTerminalConfigImport.ts @@ -1,12 +1,12 @@ import { useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { useMountedRef } from '../../hooks/useMountedRef' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { useMountedRef } from '../../../../hooks/useMountedRef' import { terminalConfigImportSettingsUpdate, type TerminalConfigImportFormat, type TerminalConfigImportPreview, type TerminalConfigImportSource -} from '../../../../shared/terminal-config-import-preview' +} from '../../../../../../shared/terminal-config-import-preview' import { getSystemPrefersDark } from '@/lib/terminal-theme' export type UseTerminalConfigImportReturn = { diff --git a/src/renderer/src/components/settings/TerminalCustomShellInput.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalCustomShellInput.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalCustomShellInput.tsx rename to src/renderer/src/components/settings/terminal/platform/TerminalCustomShellInput.tsx index 899f4625cc2..c0ff50de17a 100644 --- a/src/renderer/src/components/settings/TerminalCustomShellInput.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalCustomShellInput.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import type React from 'react' -import { Input } from '../ui/input' +import { Input } from '../../../ui/input' type TerminalCustomShellInputProps = Omit< React.ComponentProps, diff --git a/src/renderer/src/components/settings/TerminalMacKeyboardSection.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalMacKeyboardSection.tsx rename to src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx index bade2bc7741..566806eb54b 100644 --- a/src/renderer/src/components/settings/TerminalMacKeyboardSection.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalMacKeyboardSection.tsx @@ -1,8 +1,12 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { useDetectedOptionAsAlt } from '@/lib/keyboard-layout/use-effective-mac-option-as-alt' import { translate } from '@/i18n/i18n' -import { SearchableSetting } from './SearchableSetting' -import { SettingsRow, SettingsSegmentedControl, SettingsSwitchRow } from './SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { + SettingsRow, + SettingsSegmentedControl, + SettingsSwitchRow +} from '../../form-controls/SettingsFormControls' type TerminalMacKeyboardSectionProps = { settings: GlobalSettings diff --git a/src/renderer/src/components/settings/TerminalWindowsAdministratorSection.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsAdministratorSection.tsx similarity index 96% rename from src/renderer/src/components/settings/TerminalWindowsAdministratorSection.tsx rename to src/renderer/src/components/settings/terminal/platform/TerminalWindowsAdministratorSection.tsx index a3e7b15a4be..8bf4cb0a70f 100644 --- a/src/renderer/src/components/settings/TerminalWindowsAdministratorSection.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsAdministratorSection.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from 'react' -import { Badge } from '../ui/badge' -import { Button } from '../ui/button' +import { Badge } from '../../../ui/badge' +import { Button } from '../../../ui/button' import { Dialog, DialogClose, @@ -10,12 +10,12 @@ import { DialogHeader, DialogTitle, DialogTrigger -} from '../ui/dialog' -import { SettingsRow } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../../ui/dialog' +import { SettingsRow } from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { getTerminalWindowsAdministratorSearchEntry } from './terminal-windows-search' -import { MANAGE_SESSIONS_SECTION_ID } from './TerminalTccAttributionNotice' -import { useAppStore } from '../../store' +import { MANAGE_SESSIONS_SECTION_ID } from '../session-management/open-terminal-manage-sessions' +import { useAppStore } from '../../../../store/index' import { translate } from '@/i18n/i18n' import { isWebClientLocation } from '@/lib/web-client-location' import { openAppHttpLink } from '@/lib/app-http-link-open' diff --git a/src/renderer/src/components/settings/TerminalWindowsShellSection.tsx b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx similarity index 93% rename from src/renderer/src/components/settings/TerminalWindowsShellSection.tsx rename to src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx index bcb12bf856a..6679d19f87c 100644 --- a/src/renderer/src/components/settings/TerminalWindowsShellSection.tsx +++ b/src/renderer/src/components/settings/terminal/platform/TerminalWindowsShellSection.tsx @@ -1,13 +1,13 @@ -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { WINDOWS_GIT_BASH_SHELL } from '../../../../shared/windows-terminal-shell' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { WINDOWS_GIT_BASH_SHELL } from '../../../../../../shared/windows-terminal-shell' import { SettingsRow, SettingsSegmentedControl, SettingsSubsectionHeader -} from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' +} from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' import { translate } from '@/i18n/i18n' -import { ShellIcon } from '../tab-bar/shell-icons' +import { ShellIcon } from '../../../tab-bar/shell-icons' type TerminalWindowsShellSectionProps = { updateSettings: (updates: Partial) => void diff --git a/src/renderer/src/components/settings/terminal-advanced-platform-search.ts b/src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts similarity index 98% rename from src/renderer/src/components/settings/terminal-advanced-platform-search.ts rename to src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts index e4904024500..d6747a8e3ee 100644 --- a/src/renderer/src/components/settings/terminal-advanced-platform-search.ts +++ b/src/renderer/src/components/settings/terminal/platform/terminal-advanced-platform-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export function getTerminalLimitSearchKeywords(): string[] { diff --git a/src/renderer/src/components/settings/terminal-windows-search.ts b/src/renderer/src/components/settings/terminal/platform/terminal-windows-search.ts similarity index 98% rename from src/renderer/src/components/settings/terminal-windows-search.ts rename to src/renderer/src/components/settings/terminal/platform/terminal-windows-search.ts index 3772e99a053..fb849e934c2 100644 --- a/src/renderer/src/components/settings/terminal-windows-search.ts +++ b/src/renderer/src/components/settings/terminal/platform/terminal-windows-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getTerminalWindowsAdministratorSearchEntry = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/ManageSessionKillDialog.tsx b/src/renderer/src/components/settings/terminal/session-management/ManageSessionKillDialog.tsx similarity index 94% rename from src/renderer/src/components/settings/ManageSessionKillDialog.tsx rename to src/renderer/src/components/settings/terminal/session-management/ManageSessionKillDialog.tsx index 48edca22a86..8603a1e9e37 100644 --- a/src/renderer/src/components/settings/ManageSessionKillDialog.tsx +++ b/src/renderer/src/components/settings/terminal/session-management/ManageSessionKillDialog.tsx @@ -1,6 +1,6 @@ import { LoaderCircle } from 'lucide-react' -import type { PtyManagementSession } from '../../../../preload/api-types' -import { Button } from '../ui/button' +import type { PtyManagementSession } from '../../../../../../preload/api/pty-management-api' +import { Button } from '../../../ui/button' import { Dialog, DialogContent, @@ -8,7 +8,7 @@ import { DialogFooter, DialogHeader, DialogTitle -} from '../ui/dialog' +} from '../../../ui/dialog' import { translate } from '@/i18n/i18n' type ManageSessionKillDialogProps = { diff --git a/src/renderer/src/components/settings/ManageSessionsSection.tsx b/src/renderer/src/components/settings/terminal/session-management/ManageSessionsSection.tsx similarity index 92% rename from src/renderer/src/components/settings/ManageSessionsSection.tsx rename to src/renderer/src/components/settings/terminal/session-management/ManageSessionsSection.tsx index 6eb8e208a3b..12c75216198 100644 --- a/src/renderer/src/components/settings/ManageSessionsSection.tsx +++ b/src/renderer/src/components/settings/terminal/session-management/ManageSessionsSection.tsx @@ -1,22 +1,20 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'sonner' -import type { PtyManagementSession } from '../../../../preload/api-types' -import { SearchableSetting } from './SearchableSetting' -import { getManageSessionsSearchEntries } from './terminal-search' -import { useAppStore } from '../../store' +import type { PtyManagementSession } from '../../../../../../preload/api/pty-management-api' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { getManageSessionsSearchEntries } from '../terminal-window-setup-search' +import { useAppStore } from '../../../../store/index' import { activateAndRevealWorktree } from '@/lib/worktree-activation' import { activateTabAndFocusPane } from '@/lib/activate-tab-and-focus-pane' -import { useDaemonActions, DaemonActionDialog } from '../shared/useDaemonActions' +import { useDaemonActions, DaemonActionDialog } from '../../../shared/useDaemonActions' import { ManageSessionKillDialog } from './ManageSessionKillDialog' import { ManageSessionsTable } from './ManageSessionsTable' import { notifyDaemonSessionInventoryInvalidated, subscribeDaemonSessionInventoryInvalidated -} from '../status-bar/daemon-session-inventory-invalidation' -import { - MANAGE_SESSIONS_SECTION_ID, - TerminalTccAttributionNotice -} from './TerminalTccAttributionNotice' +} from '../../../status-bar/daemon-session-inventory-invalidation' +import { MANAGE_SESSIONS_SECTION_ID } from './open-terminal-manage-sessions' +import { TerminalTccAttributionNotice } from '../../developer-permissions/TerminalTccAttributionNotice' import { translate } from '@/i18n/i18n' type ConfirmKind = 'killOne' diff --git a/src/renderer/src/components/settings/ManageSessionsTable.tsx b/src/renderer/src/components/settings/terminal/session-management/ManageSessionsTable.tsx similarity index 97% rename from src/renderer/src/components/settings/ManageSessionsTable.tsx rename to src/renderer/src/components/settings/terminal/session-management/ManageSessionsTable.tsx index ed44276abb3..f32cca42ea4 100644 --- a/src/renderer/src/components/settings/ManageSessionsTable.tsx +++ b/src/renderer/src/components/settings/terminal/session-management/ManageSessionsTable.tsx @@ -1,7 +1,7 @@ -import type { PtyManagementSession } from '../../../../preload/api-types' +import type { PtyManagementSession } from '../../../../../../preload/api/pty-management-api' import { LoaderCircle, RefreshCw, RotateCw, Trash2, X } from 'lucide-react' -import { Button } from '../ui/button' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' +import { Button } from '../../../ui/button' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' import { formatState, formatWorkspace } from './manage-sessions-format' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/TerminalLimitSetting.test.tsx b/src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.test.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalLimitSetting.test.tsx rename to src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.test.tsx index 40821e17bd9..353c63e4395 100644 --- a/src/renderer/src/components/settings/TerminalLimitSetting.test.tsx +++ b/src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.test.tsx @@ -1,18 +1,19 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { TerminalLimitSetting } from './TerminalLimitSetting' import { readTerminalLimit, saveTerminalLimit } from './terminal-limit-transport' import type * as TerminalLimitTransport from './terminal-limit-transport' -import type { SettingsHostScope } from './settings-host-scope' -import type { TerminalLimitStatus } from '../../../../shared/terminal-limit-policy' -import { useAppStore } from '@/store' +import type { SettingsHostScope } from '../../settings-host-scope' +import type { TerminalLimitStatus } from '../../../../../../shared/terminal-limit-policy' +import { useAppStore } from '@/store/index' import { i18n } from '@/i18n/i18n' import ptCatalog from '@/i18n/locales/pt.json' -import { getTerminalAdvancedSearchEntries } from './terminal-advanced-platform-search' -import { matchesSettingsSearch } from './settings-search' -import type { RuntimeStatus } from '../../../../shared/runtime-types' +import { getTerminalAdvancedSearchEntries } from '../platform/terminal-advanced-platform-search' +import { matchesSettingsSearch } from '../../search/settings-search' +import type { RuntimeStatus } from '../../../../../../shared/runtime-session-contracts' import { callHostRoute } from '@/runtime/host-route-call' import { advanceRuntimeEnvironmentConnectionGeneration } from '@/store/slices/runtime-status-connection-generation' @@ -23,7 +24,7 @@ vi.mock('./terminal-limit-transport', () => ({ })) const search = vi.hoisted(() => ({ query: '' })) vi.mock('sonner', () => ({ toast: { warning: vi.fn(), dismiss: vi.fn() } })) -vi.mock('@/store', async () => { +vi.mock('@/store/index', async () => { const { useStore } = await import('zustand') const { createRuntimeStatusTestStore } = await import('@/store/slices/runtime-status.test-fixture') diff --git a/src/renderer/src/components/settings/TerminalLimitSetting.tsx b/src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.tsx similarity index 94% rename from src/renderer/src/components/settings/TerminalLimitSetting.tsx rename to src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.tsx index 7351f702df9..c46edbe797f 100644 --- a/src/renderer/src/components/settings/TerminalLimitSetting.tsx +++ b/src/renderer/src/components/settings/terminal/session-management/TerminalLimitSetting.tsx @@ -2,14 +2,14 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { terminalLimitInputMaximum, type TerminalLimitStatus -} from '../../../../shared/terminal-limit-policy' -import { Input } from '../ui/input' -import { Button } from '../ui/button' -import { SettingsRow } from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' -import type { SettingsHostScope } from './settings-host-scope' +} from '../../../../../../shared/terminal-limit-policy' +import { Input } from '../../../ui/input' +import { Button } from '../../../ui/button' +import { SettingsRow } from '../../form-controls/SettingsFormControls' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import type { SettingsHostScope } from '../../settings-host-scope' import { readTerminalLimit, saveTerminalLimit } from './terminal-limit-transport' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { getRuntimeEnvironmentConnectionGeneration } from '@/store/slices/runtime-status-connection-generation' import { captureHostIdentityFence, @@ -18,8 +18,8 @@ import { } from '@/store/host-catalog-fencing' import type { HostRoute } from '@/runtime/runtime-client-target' import { getIntlLocale, translate } from '@/i18n/i18n' -import { runtimeHostContactForEntry } from '../../../../shared/runtime-host-contact' -import { getTerminalLimitSearchKeywords } from './terminal-advanced-platform-search' +import { runtimeHostContactForEntry } from '../../../../../../shared/runtime-host-contact' +import { getTerminalLimitSearchKeywords } from '../platform/terminal-advanced-platform-search' export function TerminalLimitSetting({ scope }: { scope: SettingsHostScope }): React.JSX.Element { const environmentId = scope.target.kind === 'environment' ? scope.target.environmentId : null diff --git a/src/renderer/src/components/settings/manage-sessions-format.ts b/src/renderer/src/components/settings/terminal/session-management/manage-sessions-format.ts similarity index 84% rename from src/renderer/src/components/settings/manage-sessions-format.ts rename to src/renderer/src/components/settings/terminal/session-management/manage-sessions-format.ts index f7e50dbbddc..064a0cd4013 100644 --- a/src/renderer/src/components/settings/manage-sessions-format.ts +++ b/src/renderer/src/components/settings/terminal/session-management/manage-sessions-format.ts @@ -1,5 +1,5 @@ -import type { PtyManagementSession } from '../../../../preload/api-types' -import { splitWorktreeIdForFilesystem } from '../../../../shared/worktree/id' +import type { PtyManagementSession } from '../../../../../../preload/api/pty-management-api' +import { splitWorktreeIdForFilesystem } from '../../../../../../shared/worktree/id' export function shortCwd(cwd: string): string { if (!cwd) { diff --git a/src/renderer/src/components/settings/open-terminal-manage-sessions.ts b/src/renderer/src/components/settings/terminal/session-management/open-terminal-manage-sessions.ts similarity index 88% rename from src/renderer/src/components/settings/open-terminal-manage-sessions.ts rename to src/renderer/src/components/settings/terminal/session-management/open-terminal-manage-sessions.ts index 2767b08f564..a6467369d23 100644 --- a/src/renderer/src/components/settings/open-terminal-manage-sessions.ts +++ b/src/renderer/src/components/settings/terminal/session-management/open-terminal-manage-sessions.ts @@ -1,4 +1,4 @@ -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' export const MANAGE_SESSIONS_SECTION_ID = 'terminal-manage-sessions' diff --git a/src/renderer/src/components/settings/terminal-limit-transport.ts b/src/renderer/src/components/settings/terminal/session-management/terminal-limit-transport.ts similarity index 85% rename from src/renderer/src/components/settings/terminal-limit-transport.ts rename to src/renderer/src/components/settings/terminal/session-management/terminal-limit-transport.ts index 56f0bf041ef..e8bc7ecd991 100644 --- a/src/renderer/src/components/settings/terminal-limit-transport.ts +++ b/src/renderer/src/components/settings/terminal/session-management/terminal-limit-transport.ts @@ -1,9 +1,9 @@ -import type { RuntimeStatus } from '../../../../shared/runtime-types' +import type { RuntimeStatus } from '../../../../../../shared/runtime-session-contracts' import { TERMINAL_LIMIT_RUNTIME_CAPABILITY, type TerminalLimitStatus, type TerminalLimitUpdate -} from '../../../../shared/terminal-limit-policy' +} from '../../../../../../shared/terminal-limit-policy' import { callHostRoute } from '@/runtime/host-route-call' import type { HostRoute } from '@/runtime/runtime-client-target' diff --git a/src/renderer/src/components/settings/terminal-clipboard-search.ts b/src/renderer/src/components/settings/terminal/terminal-clipboard-search.ts similarity index 98% rename from src/renderer/src/components/settings/terminal-clipboard-search.ts rename to src/renderer/src/components/settings/terminal/terminal-clipboard-search.ts index 56410cff54c..839d893a573 100644 --- a/src/renderer/src/components/settings/terminal-clipboard-search.ts +++ b/src/renderer/src/components/settings/terminal/terminal-clipboard-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getTerminalClipboardSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/terminal-search.ts b/src/renderer/src/components/settings/terminal/terminal-search.ts similarity index 81% rename from src/renderer/src/components/settings/terminal-search.ts rename to src/renderer/src/components/settings/terminal/terminal-search.ts index 31a53b2f933..630053a3f46 100644 --- a/src/renderer/src/components/settings/terminal-search.ts +++ b/src/renderer/src/components/settings/terminal/terminal-search.ts @@ -1,67 +1,39 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { getTerminalAdvancedSearchEntries, getTerminalConfigImportSearchEntries, getTerminalMacOptionSearchEntries, getTerminalMacYenSearchEntries -} from './terminal-advanced-platform-search' +} from './platform/terminal-advanced-platform-search' import { getTerminalPaneAppearanceSearchEntries, getTerminalPaneInteractionSearchEntries -} from './terminal-pane-appearance-search' +} from './appearance/terminal-pane-appearance-search' import { getTerminalDarkThemeSearchEntries, getTerminalLightThemeSearchEntries, getTerminalThemeTargetSearchEntries, getTerminalWarpImportSearchEntries, getTerminalYamlImportSearchEntries -} from './terminal-theme-search' +} from './themes/terminal-theme-search' import { getTerminalCursorSearchEntries, getTerminalRenderingSearchEntries, getTerminalTypographySearchEntries -} from './terminal-typography-search' +} from './appearance/terminal-typography-search' import { getTerminalRightClickToPasteSearchEntry, getTerminalWindowsPowershellImplementationSearchEntry, getTerminalWindowsShellSearchEntry, getTerminalWindowsAdministratorSearchEntry -} from './terminal-windows-search' +} from './platform/terminal-windows-search' import { getManageSessionsSearchEntries, getTerminalWindowSearchEntries } from './terminal-window-setup-search' import { createLocalizedCatalog } from '@/i18n/localized-catalog' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' - -export { - getTerminalAdvancedTypographySearchEntries, - getTerminalTypographySearchEntries, - getTerminalRenderingSearchEntries, - getTerminalCursorSearchEntries -} from './terminal-typography-search' -export { - getTerminalPaneAppearanceSearchEntries, - getTerminalPaneInteractionSearchEntries -} from './terminal-pane-appearance-search' -export { - getTerminalDarkThemeSearchEntries, - getTerminalLightThemeSearchEntries, - getTerminalThemeTargetSearchEntries, - getTerminalWarpImportSearchEntries, - getTerminalYamlImportSearchEntries -} from './terminal-theme-search' -export { - getTerminalAdvancedSearchEntries, - getTerminalMacOptionSearchEntries, - getTerminalMacYenSearchEntries, - getTerminalConfigImportSearchEntries -} from './terminal-advanced-platform-search' -export { - getManageSessionsSearchEntries, - getTerminalWindowSearchEntries -} from './terminal-window-setup-search' +import { translateSearchKeyword } from '../search/settings-search-keywords' type TerminalAppearanceSearchOptions = { showDesktopThemeImports?: boolean diff --git a/src/renderer/src/components/settings/terminal-window-color-groups.tsx b/src/renderer/src/components/settings/terminal/terminal-window-color-groups.tsx similarity index 99% rename from src/renderer/src/components/settings/terminal-window-color-groups.tsx rename to src/renderer/src/components/settings/terminal/terminal-window-color-groups.tsx index f4c63ac1072..0bb2435252e 100644 --- a/src/renderer/src/components/settings/terminal-window-color-groups.tsx +++ b/src/renderer/src/components/settings/terminal/terminal-window-color-groups.tsx @@ -1,4 +1,4 @@ -import type { TerminalColorOverrides } from '../../../../shared/terminal-color-overrides' +import type { TerminalColorOverrides } from '../../../../../shared/terminal-color-overrides' import { translate } from '@/i18n/i18n' export const COLOR_OVERRIDE_GROUPS: { diff --git a/src/renderer/src/components/settings/terminal-window-setup-search.ts b/src/renderer/src/components/settings/terminal/terminal-window-setup-search.ts similarity index 98% rename from src/renderer/src/components/settings/terminal-window-setup-search.ts rename to src/renderer/src/components/settings/terminal/terminal-window-setup-search.ts index 1ae8910ea9e..0d7a5cb1605 100644 --- a/src/renderer/src/components/settings/terminal-window-setup-search.ts +++ b/src/renderer/src/components/settings/terminal/terminal-window-setup-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getManageSessionsSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/TerminalThemePicker.tsx b/src/renderer/src/components/settings/terminal/themes/TerminalThemePicker.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalThemePicker.tsx rename to src/renderer/src/components/settings/terminal/themes/TerminalThemePicker.tsx index 090cfd15d9d..f07f22910fc 100644 --- a/src/renderer/src/components/settings/TerminalThemePicker.tsx +++ b/src/renderer/src/components/settings/terminal/themes/TerminalThemePicker.tsx @@ -1,21 +1,21 @@ import type React from 'react' import { useEffect, useRef, useState } from 'react' import { Trash2 } from 'lucide-react' -import { ScrollArea } from '../ui/scroll-area' -import { Button } from '../ui/button' -import { Input } from '../ui/input' -import { Label } from '../ui/label' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { MAX_THEME_RESULTS } from './SettingsConstants' -import { - filterTerminalThemeOptions, - isSettingsFormOptionQueryTooLarge -} from './settings-form-option-filter' +import { ScrollArea } from '../../../ui/scroll-area' +import { Button } from '../../../ui/button' +import { Input } from '../../../ui/input' +import { Label } from '../../../ui/label' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../../ui/tooltip' + +import { filterTerminalThemeOptions } from './terminal-theme-option-filter' +import { isSettingsFormOptionQueryTooLarge } from '../../form-controls/settings-form-option-filter' import { cn } from '@/lib/utils' import { translate } from '@/i18n/i18n' import type { TerminalThemeOption } from '@/lib/terminal-theme' import { motionSafeScrollBehavior } from '@/hooks/usePrefersReducedMotion' +const MAX_THEME_RESULTS = 80 + type ThemePickerProps = { label: string description: string diff --git a/src/renderer/src/components/settings/TerminalThemeSections.lifecycle.test.ts b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.lifecycle.test.ts similarity index 98% rename from src/renderer/src/components/settings/TerminalThemeSections.lifecycle.test.ts rename to src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.lifecycle.test.ts index 260940ae930..ae0a868a36b 100644 --- a/src/renderer/src/components/settings/TerminalThemeSections.lifecycle.test.ts +++ b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.lifecycle.test.ts @@ -1,6 +1,6 @@ import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' let themeTarget: 'dark' | 'light' | undefined = 'dark' @@ -27,7 +27,7 @@ vi.mock('react', async () => { } }) -vi.mock('./TerminalSettingsPreview', () => ({ +vi.mock('../appearance/TerminalSettingsPreview', () => ({ TerminalSettingsPreview: function TerminalSettingsPreview() { return null } diff --git a/src/renderer/src/components/settings/TerminalThemeSections.tsx b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx similarity index 95% rename from src/renderer/src/components/settings/TerminalThemeSections.tsx rename to src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx index b4ab272b5c1..2fc3c73c842 100644 --- a/src/renderer/src/components/settings/TerminalThemeSections.tsx +++ b/src/renderer/src/components/settings/terminal/themes/TerminalThemeSections.tsx @@ -2,33 +2,34 @@ import { usePluginTerminalThemes } from '@/store/plugin-themes' import { withTerminalPluginPalettes } from '@/lib/terminal-plugin-palettes' import { useState, type Dispatch, type ReactNode, type SetStateAction } from 'react' import { toast } from 'sonner' -import { useAppStore } from '@/store' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { parseCustomTerminalThemeSelection } from '../../../../shared/terminal-custom-themes' +import { useAppStore } from '@/store/index' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' +import { parseCustomTerminalThemeSelection } from '../../../../../../shared/terminal-custom-themes' import { terminalCustomThemeRemoval, - type TerminalCustomThemeRemoval -} from '../../../../shared/terminal-theme-selection' + type TerminalCustomThemeRemoval, + DEFAULT_TERMINAL_THEME_DARK, + DEFAULT_TERMINAL_THEME_LIGHT +} from '../../../../../../shared/terminal-theme-selection' import { hasTerminalColorOverrides, TERMINAL_COLOR_OVERRIDES_SETTING, type TerminalThemeSlot -} from '../../../../shared/terminal-color-overrides' +} from '../../../../../../shared/terminal-color-overrides' import { ColorField, SettingsSegmentedControl, SettingsSwitchRow, - SettingsSubsectionHeader, - ThemePicker -} from './SettingsFormControls' -import { SearchableSetting } from './SearchableSetting' -import { TerminalSettingsPreview } from './TerminalSettingsPreview' + SettingsSubsectionHeader +} from '../../form-controls/SettingsFormControls' +import { ThemePicker } from './TerminalThemePicker' +import { SearchableSetting } from '../../section-layout/SearchableSetting' +import { TerminalSettingsPreview } from '../appearance/TerminalSettingsPreview' import { WarpThemeImportButton } from './WarpThemeImportButton' import { YamlThemeImportButton } from './YamlThemeImportButton' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' + import { - DEFAULT_TERMINAL_THEME_DARK, - DEFAULT_TERMINAL_THEME_LIGHT, getAvailableTerminalThemeOptions, resolveEffectiveTerminalAppearance, type TerminalThemeOption diff --git a/src/renderer/src/components/settings/WarpThemeImportButton.tsx b/src/renderer/src/components/settings/terminal/themes/WarpThemeImportButton.tsx similarity index 86% rename from src/renderer/src/components/settings/WarpThemeImportButton.tsx rename to src/renderer/src/components/settings/terminal/themes/WarpThemeImportButton.tsx index 821d63feeae..11afc8fe0b3 100644 --- a/src/renderer/src/components/settings/WarpThemeImportButton.tsx +++ b/src/renderer/src/components/settings/terminal/themes/WarpThemeImportButton.tsx @@ -1,5 +1,5 @@ -import { Button } from '../ui/button' -import { WarpIcon } from '../icons/WarpIcon' +import { Button } from '../../../ui/button' +import { WarpIcon } from '../../../icons/WarpIcon' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/WarpThemeImportModal.tsx b/src/renderer/src/components/settings/terminal/themes/WarpThemeImportModal.tsx similarity index 97% rename from src/renderer/src/components/settings/WarpThemeImportModal.tsx rename to src/renderer/src/components/settings/terminal/themes/WarpThemeImportModal.tsx index 916c90e56e6..d62045134fb 100644 --- a/src/renderer/src/components/settings/WarpThemeImportModal.tsx +++ b/src/renderer/src/components/settings/terminal/themes/WarpThemeImportModal.tsx @@ -1,6 +1,6 @@ import { FileUp, FolderOpen, Loader2 } from 'lucide-react' -import type { WarpThemeImportPreviewTheme } from '../../../../shared/terminal-custom-themes' -import { Button } from '../ui/button' +import type { WarpThemeImportPreviewTheme } from '../../../../../../shared/terminal-custom-themes' +import { Button } from '../../../ui/button' import { Dialog, DialogContent, @@ -8,9 +8,9 @@ import { DialogFooter, DialogHeader, DialogTitle -} from '../ui/dialog' -import { ScrollArea } from '../ui/scroll-area' -import { SettingsBadge } from './SettingsFormControls' +} from '../../../ui/dialog' +import { ScrollArea } from '../../../ui/scroll-area' +import { SettingsBadge } from '../../form-controls/SettingsFormControls' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' import { translate } from '@/i18n/i18n' import { cn } from '@/lib/utils' diff --git a/src/renderer/src/components/settings/YamlThemeImportButton.tsx b/src/renderer/src/components/settings/terminal/themes/YamlThemeImportButton.tsx similarity index 93% rename from src/renderer/src/components/settings/YamlThemeImportButton.tsx rename to src/renderer/src/components/settings/terminal/themes/YamlThemeImportButton.tsx index fc96b6b9d4b..261db9f7183 100644 --- a/src/renderer/src/components/settings/YamlThemeImportButton.tsx +++ b/src/renderer/src/components/settings/terminal/themes/YamlThemeImportButton.tsx @@ -1,5 +1,5 @@ import { FileUp } from 'lucide-react' -import { Button } from '../ui/button' +import { Button } from '../../../ui/button' import type { UseWarpThemeImportReturn } from './useWarpThemeImport' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/components/settings/terminal/themes/terminal-theme-option-filter.ts b/src/renderer/src/components/settings/terminal/themes/terminal-theme-option-filter.ts new file mode 100644 index 00000000000..ae039396660 --- /dev/null +++ b/src/renderer/src/components/settings/terminal/themes/terminal-theme-option-filter.ts @@ -0,0 +1,18 @@ +import type { TerminalThemeOption } from '@/lib/terminal-theme' +import { normalizeSettingsFormOptionQuery } from '../../form-controls/settings-form-option-filter' + +export function filterTerminalThemeOptions( + themeOptions: readonly TerminalThemeOption[], + query: string +): TerminalThemeOption[] { + const normalizedQuery = normalizeSettingsFormOptionQuery(query) + if (normalizedQuery === null) { + return [] + } + if (!normalizedQuery) { + return [...themeOptions] + } + return themeOptions.filter((theme) => + `${theme.label} ${theme.sourceLabel ?? ''} `.toLowerCase().includes(normalizedQuery) + ) +} diff --git a/src/renderer/src/components/settings/terminal-theme-search.ts b/src/renderer/src/components/settings/terminal/themes/terminal-theme-search.ts similarity index 98% rename from src/renderer/src/components/settings/terminal-theme-search.ts rename to src/renderer/src/components/settings/terminal/themes/terminal-theme-search.ts index 16afab956c2..30311108fb0 100644 --- a/src/renderer/src/components/settings/terminal-theme-search.ts +++ b/src/renderer/src/components/settings/terminal/themes/terminal-theme-search.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getTerminalDarkThemeSearchEntries = createLocalizedCatalog(() => [ diff --git a/src/renderer/src/components/settings/useWarpThemeImport.test.ts b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.test.ts similarity index 98% rename from src/renderer/src/components/settings/useWarpThemeImport.test.ts rename to src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.test.ts index 479ee78f85e..934b5837cbd 100644 --- a/src/renderer/src/components/settings/useWarpThemeImport.test.ts +++ b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.test.ts @@ -1,10 +1,10 @@ import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { MAX_TERMINAL_CUSTOM_THEMES, type WarpThemeImportPreview -} from '../../../../shared/terminal-custom-themes' +} from '../../../../../../shared/terminal-custom-themes' const mockStateValues: unknown[] = [] let mockStateIndex = 0 diff --git a/src/renderer/src/components/settings/useWarpThemeImport.ts b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts similarity index 96% rename from src/renderer/src/components/settings/useWarpThemeImport.ts rename to src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts index d34dcbe5154..a18f53f65a7 100644 --- a/src/renderer/src/components/settings/useWarpThemeImport.ts +++ b/src/renderer/src/components/settings/terminal/themes/useWarpThemeImport.ts @@ -1,14 +1,14 @@ import { useState } from 'react' import { toast } from 'sonner' -import type { GlobalSettings } from '../../../../shared/global-settings-types' +import type { GlobalSettings } from '../../../../../../shared/global-settings-types' import { MAX_TERMINAL_CUSTOM_THEMES, normalizeTerminalCustomThemes, type TerminalCustomTheme, type WarpThemeImportPreview, type WarpThemeImportSource -} from '../../../../shared/terminal-custom-themes' -import { useMountedRef } from '../../hooks/useMountedRef' +} from '../../../../../../shared/terminal-custom-themes' +import { useMountedRef } from '../../../../hooks/useMountedRef' import { translate } from '@/i18n/i18n' export type ThemeImportMode = 'warp' | 'yaml' diff --git a/src/renderer/src/components/settings/GeneralUpdateSettingsSection.tsx b/src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx similarity index 95% rename from src/renderer/src/components/settings/GeneralUpdateSettingsSection.tsx rename to src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx index efc000332cb..23f86a24533 100644 --- a/src/renderer/src/components/settings/GeneralUpdateSettingsSection.tsx +++ b/src/renderer/src/components/settings/updates/GeneralUpdateSettingsSection.tsx @@ -1,22 +1,22 @@ -import { getUpdateInstallBlockGuidance } from '../maintenance/update-card/update-install-block-guidance' +import { getUpdateInstallBlockGuidance } from '../../maintenance/update-card/update-install-block-guidance' import type React from 'react' import { useEffect, useRef, useState } from 'react' import { Download, Loader2, RefreshCw } from 'lucide-react' import { toast } from 'sonner' -import { useAppStore } from '../../store' -import { Button } from '../ui/button' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSubsectionHeader } from './SettingsFormControls' +import { useAppStore } from '../../../store/index' +import { Button } from '../../ui/button' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSubsectionHeader } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' import { updaterMessageText } from '@/lib/updater-message-copy' import { getUpdateCheckClickOptions, getUpdateCheckHint } from '@/lib/update-check-click-options' -import { GeneralRemoteServerUpdates } from './GeneralRemoteServerUpdates' +import { GeneralRemoteServerUpdates } from '../GeneralRemoteServerUpdates' import { ReleaseChannelSection } from './ReleaseChannelSection' import { UpdateDelaySetting } from './UpdateDelaySetting' import { formatUpdateDelayDate } from './update-delay-copy' import { useNow } from '@/hooks/use-now' -import { isDelayedUpdatePending } from '../../../../shared/update-delay' -import { getReleaseNotesUrlForVersion } from '../../../../shared/release-channel' +import { isDelayedUpdatePending } from '../../../../../shared/update-delay' +import { getReleaseNotesUrlForVersion } from '../../../../../shared/release-channel' import { openAppHttpLinkFromAnchor } from '@/lib/app-http-link-open' export function GeneralUpdateSettingsSection(): React.JSX.Element { diff --git a/src/renderer/src/components/settings/ReleaseBuildPicker.test.tsx b/src/renderer/src/components/settings/updates/ReleaseBuildPicker.test.tsx similarity index 97% rename from src/renderer/src/components/settings/ReleaseBuildPicker.test.tsx rename to src/renderer/src/components/settings/updates/ReleaseBuildPicker.test.tsx index 6c5e6c39817..8f9ccd9ba2d 100644 --- a/src/renderer/src/components/settings/ReleaseBuildPicker.test.tsx +++ b/src/renderer/src/components/settings/updates/ReleaseBuildPicker.test.tsx @@ -1,8 +1,9 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { useState } from 'react' import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, expect, it } from 'vitest' -import type { ReleaseBuild } from '../../../../shared/release-channel' +import type { ReleaseBuild } from '../../../../../shared/release-channel' import { ReleaseBuildPicker } from './ReleaseBuildPicker' afterEach(cleanup) diff --git a/src/renderer/src/components/settings/ReleaseBuildPicker.tsx b/src/renderer/src/components/settings/updates/ReleaseBuildPicker.tsx similarity index 96% rename from src/renderer/src/components/settings/ReleaseBuildPicker.tsx rename to src/renderer/src/components/settings/updates/ReleaseBuildPicker.tsx index bdcf0c54fea..cd911827dc8 100644 --- a/src/renderer/src/components/settings/ReleaseBuildPicker.tsx +++ b/src/renderer/src/components/settings/updates/ReleaseBuildPicker.tsx @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react' import { Check, ChevronDown } from 'lucide-react' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' import { Command, CommandEmpty, @@ -8,12 +8,12 @@ import { CommandInput, CommandItem, CommandList -} from '../ui/command' -import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover' +} from '../../ui/command' +import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover' import { getIntlLocale, translate } from '@/i18n/i18n' import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision' import { cn } from '@/lib/utils' -import { parseDevBuildStamp, type ReleaseBuild } from '../../../../shared/release-channel' +import { parseDevBuildStamp, type ReleaseBuild } from '../../../../../shared/release-channel' function formatBuildLabel(build: ReleaseBuild): string { if (build.name) { diff --git a/src/renderer/src/components/settings/ReleaseChannelSection.test.tsx b/src/renderer/src/components/settings/updates/ReleaseChannelSection.test.tsx similarity index 97% rename from src/renderer/src/components/settings/ReleaseChannelSection.test.tsx rename to src/renderer/src/components/settings/updates/ReleaseChannelSection.test.tsx index 4434f4e38b0..5cb12a62fb5 100644 --- a/src/renderer/src/components/settings/ReleaseChannelSection.test.tsx +++ b/src/renderer/src/components/settings/updates/ReleaseChannelSection.test.tsx @@ -1,9 +1,10 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' -import { useAppStore } from '../../store' +import { useAppStore } from '../../../store/index' import { getShortcutPlatform } from '@/lib/shortcut-platform' -import type { ReleaseBuild } from '../../../../shared/release-channel' +import type { ReleaseBuild } from '../../../../../shared/release-channel' import { ReleaseChannelSection } from './ReleaseChannelSection' vi.mock('@/lib/shortcut-platform', () => ({ getShortcutPlatform: vi.fn(() => 'darwin') })) diff --git a/src/renderer/src/components/settings/ReleaseChannelSection.tsx b/src/renderer/src/components/settings/updates/ReleaseChannelSection.tsx similarity index 96% rename from src/renderer/src/components/settings/ReleaseChannelSection.tsx rename to src/renderer/src/components/settings/updates/ReleaseChannelSection.tsx index 06a5876ac40..abd0166d337 100644 --- a/src/renderer/src/components/settings/ReleaseChannelSection.tsx +++ b/src/renderer/src/components/settings/updates/ReleaseChannelSection.tsx @@ -2,15 +2,18 @@ import type React from 'react' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { AlertTriangle, Download, Loader2, RefreshCw } from 'lucide-react' import { toast } from 'sonner' -import { useAppStore } from '../../store' -import { Button } from '../ui/button' +import { useAppStore } from '../../../store/index' +import { Button } from '../../ui/button' import { ReleaseBuildPicker } from './ReleaseBuildPicker' -import { SettingsSegmentedControl, SettingsSubsectionHeader } from './SettingsFormControls' -import { Badge } from '../ui/badge' +import { + SettingsSegmentedControl, + SettingsSubsectionHeader +} from '../form-controls/SettingsFormControls' +import { Badge } from '../../ui/badge' import { translate } from '@/i18n/i18n' import { updaterMessageText } from '@/lib/updater-message-copy' -import { errorMessage } from '../../../../shared/error-message' -import type { UpdaterCodedMessage } from '../../../../shared/updater-failure-copy' +import { errorMessage } from '../../../../../shared/error-message' +import type { UpdaterCodedMessage } from '../../../../../shared/updater-failure-copy' import { getShortcutPlatform } from '@/lib/shortcut-platform' import { DEV_CHANNEL_PLATFORM_LABEL, @@ -23,7 +26,7 @@ import { type DedicatedRepoChannel, type ReleaseBuild, type ReleaseChannel -} from '../../../../shared/release-channel' +} from '../../../../../shared/release-channel' const CHANNEL_DESCRIPTIONS: Record = { stable: 'Shipped releases. What everyone else is running.', diff --git a/src/renderer/src/components/settings/UpdateDelaySetting.fixture.tsx b/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx similarity index 88% rename from src/renderer/src/components/settings/UpdateDelaySetting.fixture.tsx rename to src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx index fd51a8f7383..a05585e90d2 100644 --- a/src/renderer/src/components/settings/UpdateDelaySetting.fixture.tsx +++ b/src/renderer/src/components/settings/updates/UpdateDelaySetting.fixture.tsx @@ -1,6 +1,6 @@ -import { defineFixture } from '../../component-fixtures/component-fixture' -import { getDefaultSettings } from '../../../../shared/constants' -import type { UpdateStatus } from '../../../../shared/update-status-types' +import { defineFixture } from '../../../component-fixtures/component-fixture' +import { getDefaultSettings } from '../../../../../shared/constants' +import type { UpdateStatus } from '../../../../../shared/update-status-types' import { GeneralUpdateSettingsSection } from './GeneralUpdateSettingsSection' const DAY_MS = 24 * 60 * 60 * 1000 diff --git a/src/renderer/src/components/settings/UpdateDelaySetting.tsx b/src/renderer/src/components/settings/updates/UpdateDelaySetting.tsx similarity index 92% rename from src/renderer/src/components/settings/UpdateDelaySetting.tsx rename to src/renderer/src/components/settings/updates/UpdateDelaySetting.tsx index 524f2ddbcf6..5122d8a4069 100644 --- a/src/renderer/src/components/settings/UpdateDelaySetting.tsx +++ b/src/renderer/src/components/settings/updates/UpdateDelaySetting.tsx @@ -1,25 +1,25 @@ import type React from 'react' import { useId, useState } from 'react' import { CircleCheck, Clock, Info, Loader2 } from 'lucide-react' -import { useAppStore } from '../../store' +import { useAppStore } from '../../../store/index' import { useNow } from '@/hooks/use-now' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Progress } from '../ui/progress' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' -import { SearchableSetting } from './SearchableSetting' -import { SettingsSegmentedControl } from './SettingsFormControls' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' +import { Progress } from '../../ui/progress' +import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip' +import { SearchableSetting } from '../section-layout/SearchableSetting' +import { SettingsSegmentedControl } from '../form-controls/SettingsFormControls' import { translate } from '@/i18n/i18n' import { formatUiRelativeTime } from '@/i18n/relative-time-format' import { uiNumberFormat } from '@/i18n/ui-intl-formatters' import { openAppHttpLinkFromAnchor } from '@/lib/app-http-link-open' -import type { DelayedUpdate, UpdateStatus } from '../../../../shared/update-status-types' -import { getReleaseNotesUrlForVersion } from '../../../../shared/release-channel' +import type { DelayedUpdate, UpdateStatus } from '../../../../../shared/update-status-types' +import { getReleaseNotesUrlForVersion } from '../../../../../shared/release-channel' import { isDelayedUpdatePending, normalizeUpdateDelayDays, UPDATE_DELAY_DAY_OPTIONS -} from '../../../../shared/update-delay' +} from '../../../../../shared/update-delay' import { formatUpdateDelayDate, getUpdateDelayDescription, diff --git a/src/renderer/src/components/settings/update-delay-copy.ts b/src/renderer/src/components/settings/updates/update-delay-copy.ts similarity index 100% rename from src/renderer/src/components/settings/update-delay-copy.ts rename to src/renderer/src/components/settings/updates/update-delay-copy.ts diff --git a/src/renderer/src/components/settings/OpenAiTranscriptionKeyDialog.tsx b/src/renderer/src/components/settings/voice/OpenAiTranscriptionKeyDialog.tsx similarity index 95% rename from src/renderer/src/components/settings/OpenAiTranscriptionKeyDialog.tsx rename to src/renderer/src/components/settings/voice/OpenAiTranscriptionKeyDialog.tsx index 660a42434bd..ec59ca66777 100644 --- a/src/renderer/src/components/settings/OpenAiTranscriptionKeyDialog.tsx +++ b/src/renderer/src/components/settings/voice/OpenAiTranscriptionKeyDialog.tsx @@ -1,5 +1,5 @@ import { Loader2, Lock } from 'lucide-react' -import { Button } from '../ui/button' +import { Button } from '../../ui/button' import { Dialog, DialogContent, @@ -7,9 +7,9 @@ import { DialogFooter, DialogHeader, DialogTitle -} from '../ui/dialog' -import { Input } from '../ui/input' -import { Label } from '../ui/label' +} from '../../ui/dialog' +import { Input } from '../../ui/input' +import { Label } from '../../ui/label' import { translate } from '@/i18n/i18n' type OpenAiTranscriptionKeyDialogProps = { diff --git a/src/renderer/src/components/settings/OpenAiTranscriptionSettingsRow.tsx b/src/renderer/src/components/settings/voice/OpenAiTranscriptionSettingsRow.tsx similarity index 97% rename from src/renderer/src/components/settings/OpenAiTranscriptionSettingsRow.tsx rename to src/renderer/src/components/settings/voice/OpenAiTranscriptionSettingsRow.tsx index 7ea09a10f1f..dba17927a95 100644 --- a/src/renderer/src/components/settings/OpenAiTranscriptionSettingsRow.tsx +++ b/src/renderer/src/components/settings/voice/OpenAiTranscriptionSettingsRow.tsx @@ -1,6 +1,6 @@ import { CheckCircle2, Cloud, Unlink } from 'lucide-react' -import { Button } from '../ui/button' -import { Label } from '../ui/label' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' import { translate } from '@/i18n/i18n' type OpenAiTranscriptionSettingsRowProps = { diff --git a/src/renderer/src/components/settings/VoiceDictationSettingsSection.tsx b/src/renderer/src/components/settings/voice/VoiceDictationSettingsSection.tsx similarity index 94% rename from src/renderer/src/components/settings/VoiceDictationSettingsSection.tsx rename to src/renderer/src/components/settings/voice/VoiceDictationSettingsSection.tsx index c699435703c..52c087a90f8 100644 --- a/src/renderer/src/components/settings/VoiceDictationSettingsSection.tsx +++ b/src/renderer/src/components/settings/voice/VoiceDictationSettingsSection.tsx @@ -1,7 +1,7 @@ -import type { VoiceSettings } from '../../../../shared/speech-types' -import { Label } from '../ui/label' -import { Separator } from '../ui/separator' -import { Switch } from '../ui/switch' +import type { VoiceSettings } from '../../../../../shared/speech-types' +import { Label } from '../../ui/label' +import { Separator } from '../../ui/separator' +import { Switch } from '../../ui/switch' import { useShortcutLabel } from '@/hooks/useShortcutLabel' import { translate } from '@/i18n/i18n' import { VoiceMicrophoneSetting } from './VoiceMicrophoneSetting' diff --git a/src/renderer/src/components/settings/VoiceMicrophoneSetting.test.tsx b/src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.test.tsx similarity index 97% rename from src/renderer/src/components/settings/VoiceMicrophoneSetting.test.tsx rename to src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.test.tsx index 0b8cf45b3a6..17e00068011 100644 --- a/src/renderer/src/components/settings/VoiceMicrophoneSetting.test.tsx +++ b/src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.test.tsx @@ -1,11 +1,12 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { DeveloperPermissionRequestResult } from '../../../../shared/developer-permissions-types' -import { getDefaultVoiceSettings } from '../../../../shared/constants' -import type { VoiceSettings } from '../../../../shared/speech-types' +import type { DeveloperPermissionRequestResult } from '../../../../../shared/developer-permissions-types' +import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import type { VoiceSettings } from '../../../../../shared/speech-types' globalThis.IS_REACT_ACT_ENVIRONMENT = true diff --git a/src/renderer/src/components/settings/VoiceMicrophoneSetting.tsx b/src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.tsx similarity index 98% rename from src/renderer/src/components/settings/VoiceMicrophoneSetting.tsx rename to src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.tsx index 12423456836..480738cfcc7 100644 --- a/src/renderer/src/components/settings/VoiceMicrophoneSetting.tsx +++ b/src/renderer/src/components/settings/voice/VoiceMicrophoneSetting.tsx @@ -1,9 +1,9 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'sonner' -import type { VoiceSettings } from '../../../../shared/speech-types' -import { Button } from '../ui/button' -import { Label } from '../ui/label' -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select' +import type { VoiceSettings } from '../../../../../shared/speech-types' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../ui/select' import { buildVoiceMicrophoneSelectOptions, listVoiceMicrophoneDevices, diff --git a/src/renderer/src/components/settings/VoicePane.test.tsx b/src/renderer/src/components/settings/voice/VoicePane.test.tsx similarity index 95% rename from src/renderer/src/components/settings/VoicePane.test.tsx rename to src/renderer/src/components/settings/voice/VoicePane.test.tsx index 5d299765218..82b21811024 100644 --- a/src/renderer/src/components/settings/VoicePane.test.tsx +++ b/src/renderer/src/components/settings/voice/VoicePane.test.tsx @@ -1,20 +1,22 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { DeveloperPermissionRequestResult } from '../../../../shared/developer-permissions-types' -import type { SpeechModelManifest } from '../../../../shared/speech-types' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { getDefaultVoiceSettings } from '../../../../shared/constants' -import { handleVoiceDictationToggle, VoicePane } from './VoicePane' +import type { DeveloperPermissionRequestResult } from '../../../../../shared/developer-permissions-types' +import type { SpeechModelManifest } from '../../../../../shared/speech-types' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import { handleVoiceDictationToggle } from './voice-dictation-toggle' +import { VoicePane } from './VoicePane' const { useAppStoreMock, useShortcutLabelMock } = vi.hoisted(() => ({ useAppStoreMock: vi.fn(), useShortcutLabelMock: vi.fn() })) -vi.mock('@/store', () => ({ useAppStore: useAppStoreMock })) +vi.mock('@/store/index', () => ({ useAppStore: useAppStoreMock })) vi.mock('@/hooks/useShortcutLabel', () => ({ useShortcutLabel: useShortcutLabelMock diff --git a/src/renderer/src/components/settings/VoicePane.tsx b/src/renderer/src/components/settings/voice/VoicePane.tsx similarity index 94% rename from src/renderer/src/components/settings/VoicePane.tsx rename to src/renderer/src/components/settings/voice/VoicePane.tsx index bb06335d941..f76047d318d 100644 --- a/src/renderer/src/components/settings/VoicePane.tsx +++ b/src/renderer/src/components/settings/voice/VoicePane.tsx @@ -1,23 +1,21 @@ -import { UnsealedCredentialNotice } from './UnsealedCredentialNotice' -import type { SecretAtRestProtection } from '../../../../shared/secret-at-rest-protection' +import { UnsealedCredentialNotice } from '../UnsealedCredentialNotice' +import type { SecretAtRestProtection } from '../../../../../shared/secret-at-rest-protection' import { useCallback, useEffect, useRef, useState } from 'react' -import type { GlobalSettings } from '../../../../shared/global-settings-types' -import { getDefaultVoiceSettings } from '../../../../shared/constants' -import type { SpeechModelManifest, VoiceSettings } from '../../../../shared/speech-types' -import { Separator } from '../ui/separator' +import type { GlobalSettings } from '../../../../../shared/global-settings-types' +import { getDefaultVoiceSettings } from '../../../../../shared/constants' +import type { SpeechModelManifest, VoiceSettings } from '../../../../../shared/speech-types' +import { Separator } from '../../ui/separator' import { toast } from 'sonner' -import { useAppStore } from '@/store' +import { useAppStore } from '@/store/index' import { OpenAiTranscriptionKeyDialog } from './OpenAiTranscriptionKeyDialog' import { OpenAiTranscriptionSettingsRow } from './OpenAiTranscriptionSettingsRow' import { handleVoiceDictationToggle } from './voice-dictation-toggle' import { VoiceDictationSettingsSection } from './VoiceDictationSettingsSection' import { VoiceSpeechModelSection } from './VoiceSpeechModelSection' -import { matchesSettingsSearch } from './settings-search' +import { matchesSettingsSearch } from '../search/settings-search' import { getOpenaiTranscriptionSearchEntry } from './voice-pane-search' import { translate } from '@/i18n/i18n' -export { handleVoiceDictationToggle } - type VoicePaneProps = { settings: GlobalSettings updateSettings: (updates: Partial) => void diff --git a/src/renderer/src/components/settings/VoiceSpeechModelSection.test.tsx b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.test.tsx similarity index 96% rename from src/renderer/src/components/settings/VoiceSpeechModelSection.test.tsx rename to src/renderer/src/components/settings/voice/VoiceSpeechModelSection.test.tsx index a0b8c18113e..ff7aaa6f4da 100644 --- a/src/renderer/src/components/settings/VoiceSpeechModelSection.test.tsx +++ b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.test.tsx @@ -1,11 +1,12 @@ // @vitest-environment happy-dom +// @vitest-environment happy-dom import { act } from 'react' import type { ReactNode } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import type { SpeechModelManifest, SpeechModelState } from '../../../../shared/speech-types' -import { getDefaultVoiceSettings } from '../../../../shared/constants' +import type { SpeechModelManifest, SpeechModelState } from '../../../../../shared/speech-types' +import { getDefaultVoiceSettings } from '../../../../../shared/constants' const toastErrorMock = vi.hoisted(() => vi.fn()) const menuDismissMock = vi.hoisted(() => vi.fn()) @@ -21,7 +22,7 @@ vi.mock('@/i18n/i18n', () => ({ values ? fallback.replace('{{value0}}', values.value0) : fallback })) -vi.mock('../ui/dropdown-menu', () => ({ +vi.mock('../../ui/dropdown-menu', () => ({ DropdownMenu: ({ children }: { children: ReactNode }) =>
{children}
, DropdownMenuTrigger: ({ children }: { children: ReactNode }) => <>{children}, DropdownMenuContent: ({ children }: { children: ReactNode }) =>
{children}
, diff --git a/src/renderer/src/components/settings/VoiceSpeechModelSection.tsx b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.tsx similarity index 98% rename from src/renderer/src/components/settings/VoiceSpeechModelSection.tsx rename to src/renderer/src/components/settings/voice/VoiceSpeechModelSection.tsx index 23ed774f497..ef199d3b5f3 100644 --- a/src/renderer/src/components/settings/VoiceSpeechModelSection.tsx +++ b/src/renderer/src/components/settings/voice/VoiceSpeechModelSection.tsx @@ -4,15 +4,15 @@ import type { VoiceSettings, SpeechModelManifest, SpeechModelState -} from '../../../../shared/speech-types' -import { Button } from '../ui/button' -import { Label } from '../ui/label' +} from '../../../../../shared/speech-types' +import { Button } from '../../ui/button' +import { Label } from '../../ui/label' import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger -} from '../ui/dropdown-menu' +} from '../../ui/dropdown-menu' import { Cloud, Download, Trash2, Loader2, ChevronDown, Check } from 'lucide-react' import { translate } from '@/i18n/i18n' import { speechModelDescription } from './speech-model-description' diff --git a/src/renderer/src/components/settings/speech-model-description.ts b/src/renderer/src/components/settings/voice/speech-model-description.ts similarity index 97% rename from src/renderer/src/components/settings/speech-model-description.ts rename to src/renderer/src/components/settings/voice/speech-model-description.ts index d2f4b83cfe7..9d8fa7405d4 100644 --- a/src/renderer/src/components/settings/speech-model-description.ts +++ b/src/renderer/src/components/settings/voice/speech-model-description.ts @@ -1,4 +1,4 @@ -import type { SpeechModelManifest } from '../../../../shared/speech-types' +import type { SpeechModelManifest } from '../../../../../shared/speech-types' import { translate } from '@/i18n/i18n' const DESCRIPTIONS: Record string> = { diff --git a/src/renderer/src/components/settings/voice-dictation-toggle.ts b/src/renderer/src/components/settings/voice/voice-dictation-toggle.ts similarity index 91% rename from src/renderer/src/components/settings/voice-dictation-toggle.ts rename to src/renderer/src/components/settings/voice/voice-dictation-toggle.ts index 99d772fce7e..6bb4cb98395 100644 --- a/src/renderer/src/components/settings/voice-dictation-toggle.ts +++ b/src/renderer/src/components/settings/voice/voice-dictation-toggle.ts @@ -1,6 +1,6 @@ -import type { DeveloperPermissionRequestResult } from '../../../../shared/developer-permissions-types' -import type { FeatureTipId } from '../../../../shared/feature-tips' -import type { VoiceSettings } from '../../../../shared/speech-types' +import type { DeveloperPermissionRequestResult } from '../../../../../shared/developer-permissions-types' +import type { FeatureTipId } from '../../../../../shared/feature-tips' +import type { VoiceSettings } from '../../../../../shared/speech-types' type VoiceDictationToggleOptions = { voiceEnabled: boolean diff --git a/src/renderer/src/components/settings/voice-pane-search.ts b/src/renderer/src/components/settings/voice/voice-pane-search.ts similarity index 97% rename from src/renderer/src/components/settings/voice-pane-search.ts rename to src/renderer/src/components/settings/voice/voice-pane-search.ts index 7dbf56c8b57..df2ef4b6fc1 100644 --- a/src/renderer/src/components/settings/voice-pane-search.ts +++ b/src/renderer/src/components/settings/voice/voice-pane-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from '../search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from '../search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getOpenaiTranscriptionSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/settings/worker-auto-release-copy.ts b/src/renderer/src/components/settings/worker-auto-release-copy.ts index fa3600e593b..9419add7c01 100644 --- a/src/renderer/src/components/settings/worker-auto-release-copy.ts +++ b/src/renderer/src/components/settings/worker-auto-release-copy.ts @@ -1,5 +1,5 @@ import { translate } from '@/i18n/i18n' -import { searchKeywords } from './settings-search-keywords' +import { searchKeywords } from './search/settings-search-keywords' export function getWorkerAutoReleaseTitle(): string { return translate( diff --git a/src/renderer/src/components/settings/wsl-hosts-experimental-search.ts b/src/renderer/src/components/settings/wsl-hosts-experimental-search.ts index 867cecd0a76..f679d02a9db 100644 --- a/src/renderer/src/components/settings/wsl-hosts-experimental-search.ts +++ b/src/renderer/src/components/settings/wsl-hosts-experimental-search.ts @@ -1,6 +1,6 @@ -import type { SettingsSearchEntry } from './settings-search' +import type { SettingsSearchEntry } from './search/settings-search' import { translate } from '@/i18n/i18n' -import { translateSearchKeyword } from './settings-search-keywords' +import { translateSearchKeyword } from './search/settings-search-keywords' import { createLocalizedCatalog } from '@/i18n/localized-catalog' export const getWslHostsExperimentalSearchEntry = createLocalizedCatalog( diff --git a/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx b/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx index ef060f0ee57..4244c1206d0 100644 --- a/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx +++ b/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx @@ -5,7 +5,7 @@ import { StalledTerminalDaemonBanner } from './StalledTerminalDaemonBanner' import type { DaemonAsyncIoStatus } from '../../../../shared/daemon-async-io-health' const { openManageSessions } = vi.hoisted(() => ({ openManageSessions: vi.fn() })) -vi.mock('../settings/open-terminal-manage-sessions', () => ({ +vi.mock('../settings/terminal/session-management/open-terminal-manage-sessions', () => ({ openTerminalManageSessions: openManageSessions })) vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) diff --git a/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.tsx b/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.tsx index 33ae51862f3..af0809e7566 100644 --- a/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.tsx +++ b/src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { TriangleAlert } from 'lucide-react' import { Button } from '@/components/ui/button' import { translate } from '@/i18n/i18n' -import { openTerminalManageSessions } from '../settings/open-terminal-manage-sessions' +import { openTerminalManageSessions } from '../settings/terminal/session-management/open-terminal-manage-sessions' const POLL_INTERVAL_MS = 30_000 diff --git a/src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx b/src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx index 9bfc9e3af58..bbef4e15bc4 100644 --- a/src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx +++ b/src/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsx @@ -10,7 +10,7 @@ import { } from '@/components/ui/dropdown-menu' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' -import { SettingsSwitch } from '../settings/SettingsFormControls' +import { SettingsSwitch } from '../settings/form-controls/SettingsFormControls' import type { WorkspaceStatusDefinition } from '../../../../shared/worktree/types' import { getWorkspaceStatusVisualMeta } from './workspace-status' import WorkspaceStatusAppearancePopover from './WorkspaceStatusAppearancePopover' diff --git a/src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx b/src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx index 11d3570675b..ebc35fde0c9 100644 --- a/src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx +++ b/src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx @@ -2,7 +2,7 @@ import type { ComponentProps, ReactNode } from 'react' import { translate } from '@/i18n/i18n' import { useAppStore } from '@/store' import { shouldShowUsagePercentageDisplayChangeNotice } from '../../../../shared/usage-percentage-display-change-notice' -import { USAGE_PERCENTAGE_DISPLAY_SETTING_ID } from '../settings/appearance-usage-percentage-search' +import { USAGE_PERCENTAGE_DISPLAY_SETTING_ID } from '../settings/appearance/appearance-usage-percentage-search' import { StatusBarUsageChangeNoticeCard } from './StatusBarUsageChangeNoticeCard' function openUsagePercentageSettings(): void { diff --git a/src/renderer/src/components/status-bar/UsageRosterPanel.tsx b/src/renderer/src/components/status-bar/UsageRosterPanel.tsx index 203ecc60ccf..dfd0d910dfc 100644 --- a/src/renderer/src/components/status-bar/UsageRosterPanel.tsx +++ b/src/renderer/src/components/status-bar/UsageRosterPanel.tsx @@ -1,7 +1,7 @@ import React from 'react' import { ChevronRight, RefreshCw } from 'lucide-react' import { DropdownMenuItem } from '@/components/ui/dropdown-menu' -import { SettingsSegmentedControl } from '@/components/settings/SettingsFormControls' +import { SettingsSegmentedControl } from '@/components/settings/form-controls/SettingsFormControls' import { useResetCountdownClock } from '@/hooks/useResetCountdownClock' import { translate } from '@/i18n/i18n' import { formatRateLimitWindowChipLabel, formatWindowLabel } from '@/lib/window-label-formatter' diff --git a/src/renderer/src/components/status-bar/cursor-usage-headline.test.tsx b/src/renderer/src/components/status-bar/cursor-usage-headline.test.tsx index dbcf623a794..5a9313bc5a9 100644 --- a/src/renderer/src/components/status-bar/cursor-usage-headline.test.tsx +++ b/src/renderer/src/components/status-bar/cursor-usage-headline.test.tsx @@ -23,7 +23,7 @@ vi.mock('@/hooks/useResetCountdownClock', () => ({ useResetCountdownClock: () => vi.mock('@/components/ui/dropdown-menu', () => ({ DropdownMenuItem: ({ children }: React.PropsWithChildren) =>
{children}
})) -vi.mock('@/components/settings/SettingsFormControls', () => ({ +vi.mock('@/components/settings/form-controls/SettingsFormControls', () => ({ SettingsSegmentedControl: () => null })) diff --git a/src/renderer/src/components/status-bar/usage-pool-label.test.ts b/src/renderer/src/components/status-bar/usage-pool-label.test.ts index a3213d3178f..0b875045f9f 100644 --- a/src/renderer/src/components/status-bar/usage-pool-label.test.ts +++ b/src/renderer/src/components/status-bar/usage-pool-label.test.ts @@ -18,7 +18,7 @@ vi.mock('@/i18n/i18n', () => ({ vi.mock('@/lib/agent-catalog', () => ({ AgentIcon: () => null })) vi.mock('@/hooks/useResetCountdownClock', () => ({ useResetCountdownClock: () => 0 })) vi.mock('@/components/ui/dropdown-menu', () => ({ DropdownMenuItem: () => null })) -vi.mock('@/components/settings/SettingsFormControls', () => ({ +vi.mock('@/components/settings/form-controls/SettingsFormControls', () => ({ SettingsSegmentedControl: () => null })) diff --git a/src/renderer/src/components/status-bar/usage-unit-label-parity.test.tsx b/src/renderer/src/components/status-bar/usage-unit-label-parity.test.tsx index 22453299fcd..c7098335a6d 100644 --- a/src/renderer/src/components/status-bar/usage-unit-label-parity.test.tsx +++ b/src/renderer/src/components/status-bar/usage-unit-label-parity.test.tsx @@ -14,7 +14,7 @@ vi.mock('@/i18n/i18n', () => ({ vi.mock('@/lib/agent-catalog', () => ({ AgentIcon: () => null })) vi.mock('@/hooks/useResetCountdownClock', () => ({ useResetCountdownClock: () => 0 })) vi.mock('@/components/ui/dropdown-menu', () => ({ DropdownMenuItem: () => null })) -vi.mock('@/components/settings/SettingsFormControls', () => ({ +vi.mock('@/components/settings/form-controls/SettingsFormControls', () => ({ SettingsSegmentedControl: () => null })) diff --git a/src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsx b/src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsx index 3b7a666bb89..031b21d647d 100644 --- a/src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsx +++ b/src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsx @@ -7,7 +7,7 @@ import { Label } from '@/components/ui/label' import type { ProjectExecutionRuntimeResolution } from '../../../../shared/project-execution-runtime' import type { ProjectUpdateArgs } from '../../../../shared/project-types' import type { WslDriveProjectPreview } from '../../../../shared/wsl-drive-project-types' -import { SettingsRow } from '../settings/SettingsFormControls' +import { SettingsRow } from '../settings/form-controls/SettingsFormControls' import { wslDriveProjectBlockerMessage } from './wsl-drive-project-copy' type Step = diff --git a/src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.tsx b/src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.tsx index 5749b7736a3..73d037409d7 100644 --- a/src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.tsx +++ b/src/renderer/src/components/wsl-drive-project/WslDriveUncConversionRow.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button' import type { Repo } from '../../../../shared/repo-types' import type { WslDriveUncConversionResult } from '../../../../shared/wsl-drive-unc-conversion-types' import { parseWslUncPath, wslUncDrivePathToWindows } from '../../../../shared/wsl-paths' -import { SettingsRow } from '../settings/SettingsFormControls' +import { SettingsRow } from '../settings/form-controls/SettingsFormControls' import { wslDriveUncConversionMessages } from './wsl-drive-unc-conversion-copy' type Step = diff --git a/src/renderer/src/components/wsl-move/WslMoveRuntimeRow.tsx b/src/renderer/src/components/wsl-move/WslMoveRuntimeRow.tsx index a3d17d1136a..99a8c9ac565 100644 --- a/src/renderer/src/components/wsl-move/WslMoveRuntimeRow.tsx +++ b/src/renderer/src/components/wsl-move/WslMoveRuntimeRow.tsx @@ -1,7 +1,7 @@ import React from 'react' import { translate } from '@/i18n/i18n' import { Button } from '@/components/ui/button' -import { SettingsRow } from '../settings/SettingsFormControls' +import { SettingsRow } from '../settings/form-controls/SettingsFormControls' import { openWslMoveDialogFor } from './wsl-move-entry' /** The project runtime setting of a WSL project whose distro has a host: a move, not a toggle. */ diff --git a/src/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.ts b/src/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.ts index 465803d0449..af2fe358d78 100644 --- a/src/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.ts +++ b/src/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { vi } from 'vitest' import type { @@ -169,10 +170,11 @@ export function stubAuxiliaryModules(): void { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() })) } diff --git a/src/renderer/src/hooks/ipc-events-close-routing-test-harness.ts b/src/renderer/src/hooks/ipc-events-close-routing-test-harness.ts index 5b05c88e89f..cc1bae8ff9e 100644 --- a/src/renderer/src/hooks/ipc-events-close-routing-test-harness.ts +++ b/src/renderer/src/hooks/ipc-events-close-routing-test-harness.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { vi } from 'vitest' import type { TerminalSurfaceCloseTarget } from '../../../shared/terminal-surface-close-target' @@ -133,10 +134,11 @@ export async function useIpcEventsForCloseRouting({ nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() diff --git a/src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts b/src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts index ee0e8e21602..b90ff58c2b8 100644 --- a/src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts +++ b/src/renderer/src/hooks/ipc-events-terminal-create-test-harness.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { vi } from 'vitest' import { buildTerminalCreateWindow } from './ipc-events-terminal-create-window-test-fixtures' @@ -163,10 +164,11 @@ export async function setupTerminalCreateSurfacing( nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() diff --git a/src/renderer/src/hooks/ipc-events/zoom-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/zoom-ipc-bridge.ts index 8034470e629..2c0ef1459f5 100644 --- a/src/renderer/src/hooks/ipc-events/zoom-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/zoom-ipc-bridge.ts @@ -2,9 +2,9 @@ import { writeNativeChatFontSize } from '@/components/native-chat/native-chat-fo import { applyUIZoom } from '@/lib/ui-zoom' import { computeEditorFontSize, nextEditorFontZoomLevel } from '@/lib/editor-font-zoom' import { resolveEditorBaseFontSize } from '@/lib/editor-typography' -import { zoomLevelToPercent } from '@/components/settings/SettingsConstants' +import { zoomLevelToPercent, stepUIZoomLevel } from '../../../../shared/ui-zoom-level' import { dispatchZoomLevelChanged } from '@/lib/zoom-events' -import { stepUIZoomLevel } from '../../../../shared/ui-zoom-level' + import { useAppStore } from '../../store' import { focusedBrowserPageId, resolveZoomTarget } from '../resolve-zoom-target' import { dispatchBrowserPageZoom } from '@/components/browser-pane/host-guest/browser-page-zoom' diff --git a/src/renderer/src/hooks/settings-navigation-capability-sections.ts b/src/renderer/src/hooks/settings-navigation-capability-sections.ts index 20abb15950f..000a5650399 100644 --- a/src/renderer/src/hooks/settings-navigation-capability-sections.ts +++ b/src/renderer/src/hooks/settings-navigation-capability-sections.ts @@ -2,14 +2,14 @@ import { LinearIcon } from '@/components/icons/LinearIcon' import { getAccountsPaneSearchEntries } from '@/components/settings/accounts-search' import { getAgentsPaneSearchEntries } from '@/components/settings/agents-search' import { getComputerUsePaneSearchEntries } from '@/components/settings/computer-use-search' -import { getGeneralPaneSearchEntries } from '@/components/settings/general-search' +import { getGeneralPaneSearchEntries } from '@/components/settings/general/general-search' import { getIntegrationsPaneSearchEntries } from '@/components/settings/integrations-search' import { getLinearAgentSkillPaneSearchEntries } from '@/components/settings/linear-agent-skill-search' import { getMobileSettingsPaneSearchEntries } from '@/components/settings/mobile-settings-search' import { getOrcaAccountSettingsSearchEntries } from '@/components/settings/orca-account-settings-search' -import { OrcaLogoSettingsIcon } from '@/components/settings/orca-logo-settings-icon' +import { OrcaLogoSettingsIcon } from '@/components/settings/page/orca-logo-settings-icon' import { getOrchestrationPaneSearchEntries } from '@/components/settings/orchestration-search' -import { getVoicePaneSearchEntries } from '@/components/settings/voice-pane-search' +import { getVoicePaneSearchEntries } from '@/components/settings/voice/voice-pane-search' import { translate } from '@/i18n/i18n' import type { SettingsNavSection } from '@/lib/settings-navigation-types' import { diff --git a/src/renderer/src/hooks/settings-navigation-interface-sections.ts b/src/renderer/src/hooks/settings-navigation-interface-sections.ts index f53163123f9..e75f156d645 100644 --- a/src/renderer/src/hooks/settings-navigation-interface-sections.ts +++ b/src/renderer/src/hooks/settings-navigation-interface-sections.ts @@ -1,13 +1,13 @@ -import { getAppearancePaneSearchEntries } from '@/components/settings/appearance-search' -import { getChatAppearanceSearchEntries } from '@/components/settings/chat-appearance-search' -import { getChatBehaviorSearchEntries } from '@/components/settings/chat-behavior-search' -import { getChatNamingSearchEntry } from '@/components/settings/chat-naming-search' -import { getChatInlineVisualsSearchEntry } from '@/components/settings/chat-inline-visuals-search' -import { getChatLaunchSearchEntries } from '@/components/settings/chat-launch-search' -import { getChatPermissionSearchEntry } from '@/components/settings/chat-permission-search' -import { getInputPaneSearchEntries } from '@/components/settings/input-search' -import { getNotificationsPaneSearchEntries } from '@/components/settings/notifications-search' -import { getShortcutsPaneSearchEntries } from '@/components/settings/shortcuts-search' +import { getAppearancePaneSearchEntries } from '@/components/settings/appearance/appearance-search' +import { getChatAppearanceSearchEntries } from '@/components/settings/appearance/chat/chat-appearance-search' +import { getChatBehaviorSearchEntries } from '@/components/settings/chat/chat-behavior-search' +import { getChatNamingSearchEntry } from '@/components/settings/chat/chat-naming-search' +import { getChatInlineVisualsSearchEntry } from '@/components/settings/chat/chat-inline-visuals-search' +import { getChatLaunchSearchEntries } from '@/components/settings/chat/chat-launch-search' +import { getChatPermissionSearchEntry } from '@/components/settings/chat/chat-permission-search' +import { getInputPaneSearchEntries } from '@/components/settings/input/input-search' +import { getNotificationsPaneSearchEntries } from '@/components/settings/notifications/notifications-search' +import { getShortcutsPaneSearchEntries } from '@/components/settings/shortcuts/shortcuts-search' import { getStatsPaneSearchEntries } from '@/components/stats/stats-search' import { translate } from '@/i18n/i18n' import type { SettingsNavSection } from '@/lib/settings-navigation-types' diff --git a/src/renderer/src/hooks/settings-navigation-remote-sections.ts b/src/renderer/src/hooks/settings-navigation-remote-sections.ts index 9f7717c6d91..e5beefc0c3d 100644 --- a/src/renderer/src/hooks/settings-navigation-remote-sections.ts +++ b/src/renderer/src/hooks/settings-navigation-remote-sections.ts @@ -1,13 +1,13 @@ -import { getAdvancedPaneSearchEntries } from '@/components/settings/advanced-search' -import { getDeveloperPermissionsPaneSearchEntries } from '@/components/settings/developer-permissions-search' -import { getExperimentalPaneSearchEntries } from '@/components/settings/experimental-search' +import { getAdvancedPaneSearchEntries } from '@/components/settings/advanced/advanced-search' +import { getDeveloperPermissionsPaneSearchEntries } from '@/components/settings/developer-permissions/developer-permissions-search' +import { getExperimentalPaneSearchEntries } from '@/components/settings/advanced/experimental-search' import { getPluginsPaneSearchEntries, getPluginsSectionPresentation -} from '@/components/settings/plugins-search' -import { getPrivacyPaneSearchEntries } from '@/components/settings/privacy-search' +} from '@/components/settings/plugins/plugins-search' +import { getPrivacyPaneSearchEntries } from '@/components/settings/privacy/privacy-search' import { getRepositoryPaneSearchEntries } from '@/components/settings/repository/repository-search' -import { buildSettingsProjectList } from '@/components/settings/settings-project-list' +import { buildSettingsProjectList } from '@/components/settings/navigation/settings-project-list' import { getSshPaneSearchEntries } from '@/components/settings/ssh-search' import { translate } from '@/i18n/i18n' import type { SettingsNavSection } from '@/lib/settings-navigation-types' diff --git a/src/renderer/src/hooks/settings-navigation-workflow-sections.ts b/src/renderer/src/hooks/settings-navigation-workflow-sections.ts index 916ad3747e0..3eb71f93cb5 100644 --- a/src/renderer/src/hooks/settings-navigation-workflow-sections.ts +++ b/src/renderer/src/hooks/settings-navigation-workflow-sections.ts @@ -1,12 +1,12 @@ -import { getArtifactsSettingsSearchEntries } from '@/components/settings/artifacts-settings-search' -import { getAutomationsSettingsSearchEntries } from '@/components/settings/automations-settings-search' -import { getBrowserPaneCombinedSearchEntries } from '@/components/settings/browser-pane-search' +import { getArtifactsSettingsSearchEntries } from '@/components/settings/artifacts/artifacts-settings-search' +import { getAutomationsSettingsSearchEntries } from '@/components/settings/automations/automations-settings-search' +import { getBrowserPaneCombinedSearchEntries } from '@/components/settings/browser/browser-pane-search' import { getCommitMessageAiPaneSearchEntries } from '@/components/settings/commit-message-ai-search' -import { getFloatingWorkspaceSearchEntries } from '@/components/settings/floating-workspace-search' +import { getFloatingWorkspaceSearchEntries } from '@/components/settings/floating-workspaces/floating-workspace-search' import { getGitProviderApiBudgetSearchEntries } from '@/components/settings/git-provider-api-budget-search' import { getGitPaneSearchEntries } from '@/components/settings/git-search' import { getMobileEmulatorSearchEntries } from '@/components/settings/mobile-emulator-search' -import { getQuickCommandsPaneSearchEntries } from '@/components/settings/quick-commands-search' +import { getQuickCommandsPaneSearchEntries } from '@/components/settings/quick-commands/quick-commands-search' import { getShareSkillsSettingsSearchEntries } from '@/components/settings/share-skills-settings-search' import { getTasksPaneSearchEntries } from '@/components/settings/tasks-search' import { translate } from '@/i18n/i18n' diff --git a/src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts b/src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts index 3b5abc37f68..2a0a37b4217 100644 --- a/src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -90,10 +91,11 @@ describe('useIpcEvents CLI-created worktree activation', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() @@ -357,10 +359,11 @@ describe('useIpcEvents CLI-created worktree activation', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() diff --git a/src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts b/src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts index bbc71d7ab75..e658896363f 100644 --- a/src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -101,10 +102,11 @@ describe('useIpcEvents browser tab close routing', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() @@ -330,10 +332,11 @@ describe('useIpcEvents browser tab close routing', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() @@ -554,10 +557,11 @@ describe('useIpcEvents browser tab close routing', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() diff --git a/src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts b/src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts index 4a6d57bff9c..82d71456ee7 100644 --- a/src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-rate-limit-hydration.test.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' import { createEmptyRateLimitState } from '../../../shared/rate-limit-state-factory' @@ -109,10 +110,11 @@ describe('useIpcEvents rate-limit hydration', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() })) diff --git a/src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts b/src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts index 6bfc847579f..a4faf1883ae 100644 --- a/src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.ts @@ -1,3 +1,4 @@ +import type * as UIZoomLevelModule from '../../../shared/ui-zoom-level' import type * as ReactModule from 'react' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -111,10 +112,11 @@ describe('useIpcEvents updater integration', () => { nextEditorFontZoomLevel: vi.fn(() => 0), computeEditorFontSize: vi.fn(() => 13) })) - vi.doMock('@/components/settings/SettingsConstants', () => ({ + vi.doMock('../../../shared/ui-zoom-level', async (importOriginal) => ({ + ...(await importOriginal()), zoomLevelToPercent: vi.fn(() => 100), - ZOOM_MIN: -3, - ZOOM_MAX: 3 + UI_ZOOM_MIN: -3, + UI_ZOOM_MAX: 3 })) vi.doMock('@/lib/zoom-events', () => ({ dispatchZoomLevelChanged: vi.fn() diff --git a/src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts b/src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts index 721d12b9b2f..59c2b050222 100644 --- a/src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts +++ b/src/renderer/src/hooks/useMacTccAttributionSeveredNotice.ts @@ -11,7 +11,7 @@ import { usePluginLanguagePackStore, usePluginLanguagePacks } from '@/store/plug import { translate } from '@/i18n/i18n' import { track } from '@/lib/telemetry' import { resolveUiLocale } from '@/i18n/supported-languages' -import { MANAGE_SESSIONS_SECTION_ID } from '@/components/settings/TerminalTccAttributionNotice' +import { MANAGE_SESSIONS_SECTION_ID } from '@/components/settings/terminal/session-management/open-terminal-manage-sessions' import { macFolderAccessFolderName } from '@/components/shared/mac-folder-access-folder-name' import { FOLDER_ACCESS_MISMATCH_NOTICE_ID, diff --git a/src/renderer/src/hooks/useSettingsNavigationMetadata.ts b/src/renderer/src/hooks/useSettingsNavigationMetadata.ts index c83047c5e7e..13e71b34820 100644 --- a/src/renderer/src/hooks/useSettingsNavigationMetadata.ts +++ b/src/renderer/src/hooks/useSettingsNavigationMetadata.ts @@ -5,7 +5,7 @@ import { getRuntimeEnvironmentsSearchEntry, getWebRuntimeEnvironmentsSearchEntry } from '@/components/settings/runtime-environments-search' -import { getTerminalPaneSearchEntries } from '@/components/settings/terminal-search' +import { getTerminalPaneSearchEntries } from '@/components/settings/terminal/terminal-search' import { isMacUserAgent, isWindowsUserAgent } from '@/components/terminal-pane/pane-helpers' import { useLinearProviderConnected } from '@/hooks/useLinearProviderConnected' import { getClientCreationActionPolicy } from '@/lib/client-creation-action-policy' diff --git a/src/renderer/src/i18n/localized-catalog.test.ts b/src/renderer/src/i18n/localized-catalog.test.ts index a816f6ce41e..bb75ee04ac6 100644 --- a/src/renderer/src/i18n/localized-catalog.test.ts +++ b/src/renderer/src/i18n/localized-catalog.test.ts @@ -3,7 +3,7 @@ import { pluginLanguageResourceId } from '../../../shared/plugins/artifacts/plug import { getExperimentalPaneSearchEntries, getExperimentalSearchEntry -} from '../components/settings/experimental-search' +} from '../components/settings/advanced/experimental-search' import { i18n, loadRendererUiLanguage, setRendererPluginLanguagePacks, translate } from './i18n' import { createLocalizedCatalog } from './localized-catalog' diff --git a/src/renderer/src/lib/settings-navigation-types.ts b/src/renderer/src/lib/settings-navigation-types.ts index 0a2ac88ec85..dfd460e880c 100644 --- a/src/renderer/src/lib/settings-navigation-types.ts +++ b/src/renderer/src/lib/settings-navigation-types.ts @@ -1,6 +1,6 @@ import type { ComponentType } from 'react' import type { LucideProps } from 'lucide-react' -import type { SettingsSearchEntry } from '@/components/settings/settings-search' +import type { SettingsSearchEntry } from '@/components/settings/search/settings-search' import { parseExecutionHostId, type ExecutionHostId } from '../../../shared/execution-host' import type { RuntimeClientTarget } from '../../../shared/runtime-client-target' diff --git a/src/renderer/src/lib/terminal-shortcut-capture-notification.tsx b/src/renderer/src/lib/terminal-shortcut-capture-notification.tsx index fea93916c76..91b3def6458 100644 --- a/src/renderer/src/lib/terminal-shortcut-capture-notification.tsx +++ b/src/renderer/src/lib/terminal-shortcut-capture-notification.tsx @@ -10,7 +10,7 @@ import { } from '../../../shared/keybindings' import { useAppStore } from '../store' import { translate } from '@/i18n/i18n' -import { localizedKeybindingTitle } from '@/components/settings/keybinding-title-copy' +import { localizedKeybindingTitle } from '@/components/settings/shortcuts/keybinding-title-copy' const STORAGE_PREFIX = 'orca.terminalShortcutCapturedNotice.' const NOTICE_DURATION_MS = 20_000 diff --git a/src/shared/ui-zoom-level.ts b/src/shared/ui-zoom-level.ts index 59d195dfc8c..cae6206929c 100644 --- a/src/shared/ui-zoom-level.ts +++ b/src/shared/ui-zoom-level.ts @@ -19,3 +19,7 @@ export function stepUIZoomLevel(current: number, direction: UIZoomDirection): nu export function uiZoomFactorFromLevel(level: number): number { return UI_ZOOM_BASE ** level } + +export function zoomLevelToPercent(level: number): number { + return Math.round(100 * uiZoomFactorFromLevel(level)) +} diff --git a/src/shared/wsl-move/wsl-move-storage-dispositions.ts b/src/shared/wsl-move/wsl-move-storage-dispositions.ts index 30036d08efe..da088729f6c 100644 --- a/src/shared/wsl-move/wsl-move-storage-dispositions.ts +++ b/src/shared/wsl-move/wsl-move-storage-dispositions.ts @@ -73,8 +73,8 @@ export const LOCAL_STORAGE_MODULE_DISPOSITIONS: Record