diff --git a/src/main/persistence.test.ts b/src/main/persistence.test.ts index b211419eb..c65e83980 100644 --- a/src/main/persistence.test.ts +++ b/src/main/persistence.test.ts @@ -2258,6 +2258,23 @@ describe('Store', () => { expect(ui.dismissedUpdateVersion).toBeNull() }) + it('updateUI persists sanitized per-worktree dotfile visibility', async () => { + const store = await createStore() + store.updateUI({ + showDotfilesByWorktree: { + 'repo-1::/repo': false, + 'repo-2::/repo': true, + 'repo-3::/repo': 'bad', + constructor: false + } as never + }) + + expect(store.getUI().showDotfilesByWorktree).toEqual({ + 'repo-1::/repo': false, + 'repo-2::/repo': true + }) + }) + it('migrates missing rightSidebarOpen from the legacy default setting', async () => { writeDataFile({ schemaVersion: 1, diff --git a/src/main/persistence.ts b/src/main/persistence.ts index 35e5251ff..d682f6d1e 100644 --- a/src/main/persistence.ts +++ b/src/main/persistence.ts @@ -255,6 +255,26 @@ function normalizeGroupBy(groupBy: unknown): PersistedState['ui']['groupBy'] { return getDefaultUIState().groupBy } +function normalizeShowDotfilesByWorktree(value: unknown): Record { + if (value === null || typeof value !== 'object' || Array.isArray(value)) { + return {} + } + const out: Record = {} + for (const [worktreeId, showDotfiles] of Object.entries(value as Record)) { + if ( + !worktreeId || + worktreeId === '__proto__' || + worktreeId === 'constructor' || + worktreeId === 'prototype' || + typeof showDotfiles !== 'boolean' + ) { + continue + } + out[worktreeId] = showDotfiles + } + return out +} + function mergeFeatureInteractions( current: PersistedState['ui']['featureInteractions'], incoming: PersistedState['ui']['featureInteractions'] @@ -1827,6 +1847,9 @@ export class Store { rightSidebarOpen, rightSidebarTab: normalizeRightSidebarTab(parsed.ui?.rightSidebarTab), sortBy: migrate ? ('smart' as const) : sort, + showDotfilesByWorktree: normalizeShowDotfilesByWorktree( + parsed.ui?.showDotfilesByWorktree + ), workspaceStatuses, _workspaceStatusesDefaultOrderMigrated: true, _workspaceStatusesDefaultWorkflowMigrated: true, @@ -2892,6 +2915,9 @@ export class Store { workspaceBoardColumnWidth: clampWorkspaceBoardColumnWidth( this.state.ui?.workspaceBoardColumnWidth ), + showDotfilesByWorktree: normalizeShowDotfilesByWorktree( + this.state.ui?.showDotfilesByWorktree + ), featureTipsSeenIds: normalizeFeatureTipIds(this.state.ui?.featureTipsSeenIds), featureInteractions: normalizeFeatureInteractions(this.state.ui?.featureInteractions) } @@ -2932,6 +2958,10 @@ export class Store { workspaceBoardColumnWidth: clampWorkspaceBoardColumnWidth( updates.workspaceBoardColumnWidth ?? this.state.ui?.workspaceBoardColumnWidth ), + showDotfilesByWorktree: + updates.showDotfilesByWorktree !== undefined + ? normalizeShowDotfilesByWorktree(updates.showDotfilesByWorktree) + : normalizeShowDotfilesByWorktree(this.state.ui?.showDotfilesByWorktree), featureTipsSeenIds: updates.featureTipsSeenIds !== undefined ? normalizeFeatureTipIds(updates.featureTipsSeenIds) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 58628fe31..2d27852b9 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -449,6 +449,7 @@ function App(): React.JSX.Element { const sortBy = useAppStore((s) => s.sortBy) const showSleepingWorkspaces = useAppStore((s) => s.showSleepingWorkspaces) const hideDefaultBranchWorkspace = useAppStore((s) => s.hideDefaultBranchWorkspace) + const showDotfilesByWorktree = useAppStore((s) => s.showDotfilesByWorktree) const filterRepoIds = useAppStore((s) => s.filterRepoIds) const acknowledgedAgentsByPaneKey = useAppStore((s) => s.acknowledgedAgentsByPaneKey) const persistedUIReady = useAppStore((s) => s.persistedUIReady) @@ -1017,6 +1018,7 @@ function App(): React.JSX.Element { hideSleepingWorkspaces: !showSleepingWorkspaces, showSleepingWorkspaces, hideDefaultBranchWorkspace, + showDotfilesByWorktree, filterRepoIds, // Why: rides the same debounced save so dashboard auto-acks (which fire // on focus/visibility) and the in-memory ack cleanup paths in @@ -1038,6 +1040,7 @@ function App(): React.JSX.Element { sortBy, showSleepingWorkspaces, hideDefaultBranchWorkspace, + showDotfilesByWorktree, filterRepoIds, acknowledgedAgentsByPaneKey ]) diff --git a/src/renderer/src/components/right-sidebar/FileExplorer.test.tsx b/src/renderer/src/components/right-sidebar/FileExplorer.test.tsx index a93533190..4c81171b8 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorer.test.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorer.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable max-lines -- File Explorer toolbar and row tests share element-walking fixtures. */ import { describe, expect, it, vi } from 'vitest' import { Ellipsis, ListCollapse, Loader2, RefreshCw } from 'lucide-react' import { Button } from '@/components/ui/button' @@ -97,6 +98,19 @@ function findGitIgnoredMenuItem(node: unknown): ReactElementLike { return found } +function findDotfilesMenuItem(node: unknown): ReactElementLike { + let found: ReactElementLike | null = null + visit(node, (entry) => { + if (entry.type === DropdownMenuCheckboxItem && entry.props.children === 'Show Dotfiles') { + found = entry + } + }) + if (!found) { + throw new Error('dotfiles menu item not found') + } + return found +} + function queryGitIgnoredMenuItem(node: unknown): ReactElementLike | null { let found: ReactElementLike | null = null visit(node, (entry) => { @@ -195,6 +209,8 @@ function makeToolbar(overrides: Partial[0 showGitIgnoredFilesToggle: true, showGitIgnoredFiles: true, onToggleGitIgnoredFiles: vi.fn(), + showDotfiles: true, + onToggleDotfiles: vi.fn(), ...overrides }) } @@ -273,6 +289,17 @@ describe('FileExplorerToolbar', () => { expect(menuItem.props.checked).toBe(true) }) + it('puts the dotfile visibility toggle in the overflow menu', () => { + const onToggleDotfiles = vi.fn() + const element = makeToolbar({ onToggleDotfiles, showDotfiles: false }) + + const menuItem = findDotfilesMenuItem(element) + ;(menuItem.props.onCheckedChange as () => void)() + + expect(onToggleDotfiles).toHaveBeenCalledTimes(1) + expect(menuItem.props.checked).toBe(false) + }) + it('adds open-in launchers to the overflow menu', () => { const element = makeToolbar({ connectionId: 'ssh-1' }) diff --git a/src/renderer/src/components/right-sidebar/FileExplorer.tsx b/src/renderer/src/components/right-sidebar/FileExplorer.tsx index 2f86a4e24..38e83e2f9 100644 --- a/src/renderer/src/components/right-sidebar/FileExplorer.tsx +++ b/src/renderer/src/components/right-sidebar/FileExplorer.tsx @@ -35,6 +35,7 @@ import { import type { TreeNode } from './file-explorer-types' import { useFileExplorerSelection } from './useFileExplorerSelection' import { useFileExplorerGitIgnoredRows } from './useFileExplorerGitIgnoredRows' +import { getDotfileVisibleFileExplorerRows } from './file-explorer-entries' function FileExplorerInner(): React.JSX.Element { const activeWorktreeId = useAppStore((s) => s.activeWorktreeId) @@ -55,6 +56,10 @@ function FileExplorerInner(): React.JSX.Element { const closeFile = useAppStore((s) => s.closeFile) const openModal = useAppStore((s) => s.openModal) const rightSidebarOpen = useAppStore((s) => s.rightSidebarOpen) + const showDotfiles = useAppStore((s) => + activeWorktreeId ? (s.showDotfilesByWorktree[activeWorktreeId] ?? true) : true + ) + const toggleShowDotfilesForWorktree = useAppStore((s) => s.toggleShowDotfilesForWorktree) const worktreePath = activeWorktree?.path ?? null const visibleWorktreePath = rightSidebarOpen ? worktreePath : null @@ -80,13 +85,22 @@ function FileExplorerInner(): React.JSX.Element { refreshDir, resetAndLoad } = useFileExplorerTree(worktreePath, expanded, activeWorktreeId) + const dotfileVisibleFlatRows = useMemo( + () => getDotfileVisibleFileExplorerRows(flatRows, showDotfiles), + [flatRows, showDotfiles] + ) const { visibleFlatRows, rowsByPath, ignoredByRelativePath, showGitIgnoredFiles, toggleGitIgnoredFiles - } = useFileExplorerGitIgnoredRows(activeWorktreeId, worktreePath, flatRows, activeRepoSupportsGit) + } = useFileExplorerGitIgnoredRows( + activeWorktreeId, + worktreePath, + dotfileVisibleFlatRows, + activeRepoSupportsGit + ) const manualRefresh = useFileExplorerManualRefresh(refreshTree) const canCollapseAll = expanded.size > 0 const handleCollapseAll = useCallback(() => { @@ -95,6 +109,11 @@ function FileExplorerInner(): React.JSX.Element { } collapseAllDirs(activeWorktreeId) }, [activeWorktreeId, collapseAllDirs]) + const handleToggleDotfiles = useCallback(() => { + if (activeWorktreeId) { + toggleShowDotfilesForWorktree(activeWorktreeId) + } + }, [activeWorktreeId, toggleShowDotfilesForWorktree]) const [flashingPath, setFlashingPath] = useState(null) const [bgMenuOpen, setBgMenuOpen] = useState(false) @@ -422,6 +441,8 @@ function FileExplorerInner(): React.JSX.Element { showGitIgnoredFilesToggle={activeRepoSupportsGit} showGitIgnoredFiles={showGitIgnoredFiles} onToggleGitIgnoredFiles={toggleGitIgnoredFiles} + showDotfiles={showDotfiles} + onToggleDotfiles={handleToggleDotfiles} /> void + showDotfiles: boolean + onToggleDotfiles: () => void } export function FileExplorerToolbar({ @@ -36,7 +38,9 @@ export function FileExplorerToolbar({ onCollapseAll, showGitIgnoredFilesToggle, showGitIgnoredFiles, - onToggleGitIgnoredFiles + onToggleGitIgnoredFiles, + showDotfiles, + onToggleDotfiles }: FileExplorerToolbarProps): React.JSX.Element { return (
@@ -106,6 +110,9 @@ export function FileExplorerToolbar({ + + Show Dotfiles + {showGitIgnoredFilesToggle ? ( ) : null} - {showGitIgnoredFilesToggle ? : null} + { - it('keeps hidden files and folders visible in the explorer', () => { + it('keeps dotfiles loadable so visibility can be toggled client-side', () => { expect( shouldIncludeFileExplorerEntry({ name: '.env', @@ -38,3 +42,36 @@ describe('shouldIncludeFileExplorerEntry', () => { ).toBe(false) }) }) + +describe('isDotfileRelativePath', () => { + it('matches dotfiles and descendants of dot folders across path separators', () => { + expect(isDotfileRelativePath('.env')).toBe(true) + expect(isDotfileRelativePath('.config/settings.json')).toBe(true) + expect(isDotfileRelativePath('src/.cache/result.json')).toBe(true) + expect(isDotfileRelativePath('src\\.cache\\result.json')).toBe(true) + }) + + it('does not match ordinary paths', () => { + expect(isDotfileRelativePath('src/index.ts')).toBe(false) + expect(isDotfileRelativePath('config/settings.json')).toBe(false) + }) +}) + +describe('getDotfileVisibleFileExplorerRows', () => { + const rows = [ + { relativePath: 'src/index.ts' }, + { relativePath: '.env' }, + { relativePath: '.config/settings.json' }, + { relativePath: 'src/.cache/result.json' } + ] + + it('returns the original row array when dotfiles are visible', () => { + expect(getDotfileVisibleFileExplorerRows(rows, true)).toBe(rows) + }) + + it('filters dotfiles and descendants when dotfiles are hidden', () => { + expect(getDotfileVisibleFileExplorerRows(rows, false).map((row) => row.relativePath)).toEqual([ + 'src/index.ts' + ]) + }) +}) diff --git a/src/renderer/src/components/right-sidebar/file-explorer-entries.ts b/src/renderer/src/components/right-sidebar/file-explorer-entries.ts index 546e6a5f0..54e6339a0 100644 --- a/src/renderer/src/components/right-sidebar/file-explorer-entries.ts +++ b/src/renderer/src/components/right-sidebar/file-explorer-entries.ts @@ -3,3 +3,21 @@ import type { DirEntry } from '../../../../shared/types' export function shouldIncludeFileExplorerEntry(entry: DirEntry): boolean { return entry.name !== '.git' && entry.name !== 'node_modules' } + +function isDotfileSegment(segment: string): boolean { + return segment.length > 1 && segment !== '..' && segment.startsWith('.') +} + +export function isDotfileRelativePath(relativePath: string): boolean { + return relativePath + .split(/[\\/]+/) + .filter(Boolean) + .some(isDotfileSegment) +} + +export function getDotfileVisibleFileExplorerRows( + rows: T[], + showDotfiles: boolean +): T[] { + return showDotfiles ? rows : rows.filter((row) => !isDotfileRelativePath(row.relativePath)) +} diff --git a/src/renderer/src/store/slices/settings.test.ts b/src/renderer/src/store/slices/settings.test.ts index 26f64c66a..a4a4bfec8 100644 --- a/src/renderer/src/store/slices/settings.test.ts +++ b/src/renderer/src/store/slices/settings.test.ts @@ -202,6 +202,7 @@ describe('createSettingsSlice runtime switching', () => { markdownViewMode: { '/env-1/repo/stale.md': 'rich' }, editorViewMode: { '/env-1/repo/stale.md': 'changes' }, editorCursorLine: { '/env-1/repo/stale.md': 4 }, + showDotfilesByWorktree: { 'repo-env-1::/env-1/repo': false }, gitIgnoredPathsByWorktree: { 'repo-env-1::/env-1/repo': ['dist/'] }, prCache: { '/env-1/repo::main': { data: null, fetchedAt: Date.now() } }, linearIssueCache: { 'LIN-1': { data: { id: 'LIN-1' } as never, fetchedAt: Date.now() } } @@ -254,6 +255,7 @@ describe('createSettingsSlice runtime switching', () => { expect(store.getState().markdownViewMode).toEqual({}) expect(store.getState().editorViewMode).toEqual({}) expect(store.getState().editorCursorLine).toEqual({}) + expect(store.getState().showDotfilesByWorktree).toEqual({}) expect(store.getState().gitIgnoredPathsByWorktree).toEqual({}) expect(store.getState().ptyIdsByTabId).toEqual({}) expect(store.getState().browserTabsByWorktree).toEqual({}) diff --git a/src/renderer/src/store/slices/settings.ts b/src/renderer/src/store/slices/settings.ts index abf73d4bd..3a472c594 100644 --- a/src/renderer/src/store/slices/settings.ts +++ b/src/renderer/src/store/slices/settings.ts @@ -83,6 +83,7 @@ function runtimeScopedStateReset(): Partial { deferredSshSessionIdsByTabId: {}, cacheTimerByKey: {}, recentQuickCommandIdByGroup: {}, + showDotfilesByWorktree: {}, expandedDirs: {}, pendingExplorerReveal: null, openFiles: [], diff --git a/src/renderer/src/store/slices/ui.test.ts b/src/renderer/src/store/slices/ui.test.ts index ebe001523..c27b34ad2 100644 --- a/src/renderer/src/store/slices/ui.test.ts +++ b/src/renderer/src/store/slices/ui.test.ts @@ -441,6 +441,60 @@ describe('createUISlice hydratePersistedUI', () => { expect(store.getState().rightSidebarTab).toBe('checks') }) + it('hydrates persisted per-worktree dotfile visibility', () => { + const store = createUIStore() + + store.getState().hydratePersistedUI( + makePersistedUI({ + showDotfilesByWorktree: { + 'repo-1::/repo': false, + 'repo-2::/repo': true + } + }) + ) + + expect(store.getState().showDotfilesByWorktree).toEqual({ + 'repo-1::/repo': false, + 'repo-2::/repo': true + }) + }) + + it('drops invalid persisted per-worktree dotfile visibility entries', () => { + const store = createUIStore() + + store.getState().hydratePersistedUI( + makePersistedUI({ + showDotfilesByWorktree: { + 'repo-1::/repo': false, + 'repo-2::/repo': 'nope', + constructor: false + } as never + }) + ) + + expect(store.getState().showDotfilesByWorktree).toEqual({ 'repo-1::/repo': false }) + }) + + it('stores only per-worktree dotfile visibility opt-outs', () => { + const store = createUIStore() + + store.getState().setShowDotfilesForWorktree('repo-1::/repo', false) + expect(store.getState().showDotfilesByWorktree).toEqual({ 'repo-1::/repo': false }) + + store.getState().setShowDotfilesForWorktree('repo-1::/repo', true) + expect(store.getState().showDotfilesByWorktree).toEqual({}) + }) + + it('toggles per-worktree dotfile visibility independently', () => { + const store = createUIStore() + + store.getState().toggleShowDotfilesForWorktree('repo-1::/repo') + store.getState().toggleShowDotfilesForWorktree('repo-2::/repo') + store.getState().toggleShowDotfilesForWorktree('repo-2::/repo') + + expect(store.getState().showDotfilesByWorktree).toEqual({ 'repo-1::/repo': false }) + }) + it('falls back to explorer for invalid persisted right sidebar tabs', () => { const store = createUIStore() diff --git a/src/renderer/src/store/slices/ui.ts b/src/renderer/src/store/slices/ui.ts index 2621de52b..06944bbba 100644 --- a/src/renderer/src/store/slices/ui.ts +++ b/src/renderer/src/store/slices/ui.ts @@ -239,6 +239,24 @@ function filterTrustedOrcaHooksToValidRepos( return next } +function isSafePersistedRecordKey(key: string): boolean { + return key !== '__proto__' && key !== 'constructor' && key !== 'prototype' +} + +function sanitizeShowDotfilesByWorktree(value: unknown): Record { + if (value === null || typeof value !== 'object' || Array.isArray(value)) { + return {} + } + const out: Record = {} + for (const [worktreeId, showDotfiles] of Object.entries(value as Record)) { + if (!worktreeId || !isSafePersistedRecordKey(worktreeId) || typeof showDotfiles !== 'boolean') { + continue + } + out[worktreeId] = showDotfiles + } + return out +} + function sanitizePersistedSidebarWidth(width: unknown, fallback: number, maxWidth: number): number { if (typeof width !== 'number' || !Number.isFinite(width)) { return fallback @@ -257,10 +275,7 @@ function sanitizeAcknowledgedAgentsByPaneKey(value: unknown): Record = {} for (const [key, ackAt] of Object.entries(value as Record)) { - if (typeof key !== 'string') { - continue - } - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + if (typeof key !== 'string' || !isSafePersistedRecordKey(key)) { continue } if (typeof ackAt !== 'number' || !Number.isFinite(ackAt) || ackAt <= 0) { @@ -600,6 +615,9 @@ export type UISlice = { setShowSleepingWorkspaces: (v: boolean) => void hideDefaultBranchWorkspace: boolean setHideDefaultBranchWorkspace: (v: boolean) => void + showDotfilesByWorktree: Record + setShowDotfilesForWorktree: (worktreeId: string, showDotfiles: boolean) => void + toggleShowDotfilesForWorktree: (worktreeId: string) => void filterRepoIds: string[] setFilterRepoIds: (ids: string[]) => void collapsedGroups: Set @@ -1247,6 +1265,40 @@ export const createUISlice: StateCreator = (set, get) hideDefaultBranchWorkspace: false, setHideDefaultBranchWorkspace: (v) => set({ hideDefaultBranchWorkspace: v }), + showDotfilesByWorktree: {}, + setShowDotfilesForWorktree: (worktreeId, showDotfiles) => + set((s) => { + if (!worktreeId) { + return s + } + const current = s.showDotfilesByWorktree[worktreeId] ?? true + if (current === showDotfiles) { + return s + } + const next = { ...s.showDotfilesByWorktree } + // Why: showing dotfiles is the default; only persist worktree-level opt-outs. + if (showDotfiles) { + delete next[worktreeId] + } else { + next[worktreeId] = false + } + return { showDotfilesByWorktree: next } + }), + toggleShowDotfilesForWorktree: (worktreeId) => + set((s) => { + if (!worktreeId) { + return s + } + const nextShowDotfiles = !(s.showDotfilesByWorktree[worktreeId] ?? true) + const next = { ...s.showDotfilesByWorktree } + if (nextShowDotfiles) { + delete next[worktreeId] + } else { + next[worktreeId] = false + } + return { showDotfilesByWorktree: next } + }), + filterRepoIds: [], setFilterRepoIds: (ids) => set({ filterRepoIds: ids }), @@ -1469,6 +1521,7 @@ export const createUISlice: StateCreator = (set, get) // start from the new default: sleeping workspaces visible. showSleepingWorkspaces: !(ui.hideSleepingWorkspaces ?? DEFAULT_HIDE_SLEEPING_WORKSPACES), hideDefaultBranchWorkspace: ui.hideDefaultBranchWorkspace ?? false, + showDotfilesByWorktree: sanitizeShowDotfilesByWorktree(ui.showDotfilesByWorktree), filterRepoIds: (ui.filterRepoIds ?? []).filter((repoId) => validRepoIds.has(repoId)), collapsedGroups: new Set(ui.collapsedGroups ?? []), uiZoomLevel: ui.uiZoomLevel ?? 0, diff --git a/src/renderer/src/store/slices/worktrees.test.ts b/src/renderer/src/store/slices/worktrees.test.ts index 64996c55d..c4e908c06 100644 --- a/src/renderer/src/store/slices/worktrees.test.ts +++ b/src/renderer/src/store/slices/worktrees.test.ts @@ -116,6 +116,7 @@ function createTestStore() { editorDrafts: {}, markdownViewMode: {}, editorViewMode: {}, + showDotfilesByWorktree: {}, expandedDirs: {}, gitStatusByWorktree: {}, gitIgnoredPathsByWorktree: {}, @@ -1480,6 +1481,25 @@ describe('removeWorktree state cleanup', () => { }) }) + it('cleans up dotfile visibility for the removed worktree', async () => { + const store = createTestStore() + const wt = makeWorktree({ id: 'repo1::/path/wt1', repoId: 'repo1', path: '/path/wt1' }) + + store.setState({ + worktreesByRepo: { repo1: [wt] }, + showDotfilesByWorktree: { + 'repo1::/path/wt1': false, + 'repo1::/path/wt2': false + } + } as Partial) + + await store.getState().removeWorktree('repo1::/path/wt1') + + expect(store.getState().showDotfilesByWorktree).toEqual({ + 'repo1::/path/wt2': false + }) + }) + it('cleans up activeTabIdByWorktree for the removed worktree', async () => { const store = createTestStore() const wt = makeWorktree({ id: 'repo1::/path/wt1', repoId: 'repo1', path: '/path/wt1' }) diff --git a/src/renderer/src/store/slices/worktrees.ts b/src/renderer/src/store/slices/worktrees.ts index 7f4388a22..8f3727cef 100644 --- a/src/renderer/src/store/slices/worktrees.ts +++ b/src/renderer/src/store/slices/worktrees.ts @@ -715,6 +715,7 @@ function buildWorktreePurgeState(s: AppState, worktreeIds: string[]): Partial } const nextExpandedDirs = { ...s.expandedDirs } delete nextExpandedDirs[worktreeId] + const nextShowDotfilesByWorktree = { ...s.showDotfilesByWorktree } + delete nextShowDotfilesByWorktree[worktreeId] // If the active file belonged to the removed worktree, clear it const activeFileCleared = s.activeFileId ? s.openFiles.some((f) => f.id === s.activeFileId && f.worktreeId === worktreeId) @@ -1377,6 +1380,7 @@ export const createWorktreeSlice: StateCreator editorDrafts: nextEditorDrafts, markdownViewMode: nextMarkdownViewMode, editorViewMode: nextEditorViewMode, + showDotfilesByWorktree: nextShowDotfilesByWorktree, expandedDirs: nextExpandedDirs, gitStatusByWorktree: nextGitStatusByWorktree, gitIgnoredPathsByWorktree: nextGitIgnoredPathsByWorktree, diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 8e6a70c56..2e2815b7f 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -390,6 +390,7 @@ export function getDefaultUIState(): PersistedUIState { hideSleepingWorkspaces: DEFAULT_HIDE_SLEEPING_WORKSPACES, showSleepingWorkspaces: DEFAULT_SHOW_SLEEPING_WORKSPACES, hideDefaultBranchWorkspace: false, + showDotfilesByWorktree: {}, filterRepoIds: [], collapsedGroups: [], uiZoomLevel: 0, diff --git a/src/shared/types.ts b/src/shared/types.ts index c3a8452db..4c826f821 100644 --- a/src/shared/types.ts +++ b/src/shared/types.ts @@ -2458,6 +2458,8 @@ export type PersistedUIState = { * the predicate in visible-worktrees.ts excludes worktrees with an empty * branch. */ hideDefaultBranchWorkspace: boolean + /** Per-worktree Explorer dotfile visibility. Missing entries inherit the default: show. */ + showDotfilesByWorktree?: Record filterRepoIds: string[] collapsedGroups: string[] uiZoomLevel: number