refactor(settings): move WorktreeVisibilityDefaults into its own module (#24884)

global-settings-types.ts sits at the 300-line max-lines ceiling; merging main's two new
agent-state-rules settings with experimentalManagedServers put it at 301. The worktree
visibility defaults type moves next to the other visibility types and is re-exported so its
38 importers are unchanged.

Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
OrcaWin
2026-10-02 14:37:39 -07:00
committed by GitHub
co-authored by m4air
parent c0386783b1
commit 91c55c1227
2 changed files with 19 additions and 16 deletions
+4 -16
View File
@@ -37,24 +37,11 @@ import type {
TaskViewPresetId
} from './ui-chrome-types'
import type { SetupScriptLaunchMode } from './worktree/launch-types'
import type {
CustomWorktreeVisibilitySource,
ExternalWorktreeVisibility,
WorktreeVisibilitySourcePreferences
} from './repo-types'
import type { WorktreeVisibilityDefaults } from './worktree/visibility-defaults'
/** MiniMax account region used to select the quota endpoint. */
export type MiniMaxEndpoint = 'overseas' | 'cn'
export type WorktreeVisibilityDefaults = {
/** Default for worktrees outside a recognized source. */
external?: ExternalWorktreeVisibility
/** Host-owned roots applied to every repository on that host. */
customSources?: CustomWorktreeVisibilitySource[]
/** Defaults for built-in and host-owned custom sources. */
sourcePreferences?: WorktreeVisibilitySourcePreferences
}
export type GlobalSettings = {
workspaceDir: string
/** Host-owned defaults used when a repository has no explicit visibility override. */
@@ -538,6 +525,7 @@ export type OrcaWorkspaceLayout = {
nestWorkspaces: boolean
}
// Re-exported so existing importers keep one entry point; the shape lives in its
// own file because this one is at the max-lines ceiling.
// Re-exported so existing importers keep one entry point; the shapes live in their
// own files because this one is at the max-lines ceiling.
export type { GhosttyImportPreview } from './ghostty-import-preview'
export type { WorktreeVisibilityDefaults } from './worktree/visibility-defaults'
@@ -0,0 +1,15 @@
import type {
CustomWorktreeVisibilitySource,
ExternalWorktreeVisibility,
WorktreeVisibilitySourcePreferences
} from '../repo-types'
/** Host-owned worktree visibility defaults, used when a repository has no explicit override. */
export type WorktreeVisibilityDefaults = {
/** Default for worktrees outside a recognized source. */
external?: ExternalWorktreeVisibility
/** Host-owned roots applied to every repository on that host. */
customSources?: CustomWorktreeVisibilitySource[]
/** Defaults for built-in and host-owned custom sources. */
sourcePreferences?: WorktreeVisibilitySourcePreferences
}