Skip to content

The agent that grows with you

feat(desktop): per-project toggle for gitignored files in the file tree (#101065)

Ömer Faruk Yığın27dfbe397f84
diff --git a/apps/desktop/src/app/right-sidebar/files/ipc.test.ts b/apps/desktop/src/app/right-sidebar/files/ipc.test.ts
index f4cc61b393a..419bd194082 100644
--- a/apps/desktop/src/app/right-sidebar/files/ipc.test.ts
+++ b/apps/desktop/src/app/right-sidebar/files/ipc.test.ts
@@ -7,6 +7,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import type { HermesReadDirEntry, HermesReadDirResult } from '@/global'
import { clearProjectDirCache, readProjectDir } from './ipc'
+import { $showIgnoredRoots, setShowIgnoredFiles } from './prefs'
const readDir = vi.fn<(path: string) => Promise<HermesReadDirResult>>()
const readFileDataUrl = vi.fn<(path: string) => Promise<string>>()
@@ -43,6 +44,7 @@ describe('readProjectDir', () => {
afterEach(() => {
clearProjectDirCache()
+ $showIgnoredRoots.set([])
delete (window as unknown as { hermesDesktop?: unknown }).hermesDesktop
})
@@ -124,4 +126,69 @@ describe('readProjectDir', () => {
expect(result.entries.map(entry => entry.name)).toEqual(['debug.log'])
expect(readFileDataUrl).not.toHaveBeenCalled()
})
+
+ it('keeps gitignored entries — and skips the gitignore reads — when the root opted in', async () => {
+ setShowIgnoredFiles('/repo', true)
+ gitRoot.mockResolvedValue('/repo')
+ readDir.mockImplementation(async path => {
+ if (path === '/repo/src') {
+ return ok([
+ { name: 'debug.log', path: '/repo/src/debug.log', isDirectory: false },
+ { name: 'keep.ts', path: '/repo/src/keep.ts', isDirectory: false }
+ ])
+ }
+
+ if (path === '/repo') {
+ return ok([{ name: '.gitignore', path: '/repo/.gitignore', isDirectory: false }])
+ }
+
+ return ok([])
+ })
+ readFileDataUrl.mockResolvedValue(dataUrl('src/*.log\n'))
+
+ const result = await readProjectDir('/repo/src', '/repo')
+
+ expect(result.entries.map(entry => entry.name)).toEqual(['debug.log', 'keep.ts'])
+ expect(gitRoot).not.toHaveBeenCalled()
+ expect(readFileDataUrl).not.toHaveBeenCalled()
+ })
+
+ it('still excludes ALWAYS_EXCLUDED entries when the root opted in', async () => {
+ setShowIgnoredFiles('/repo', true)
+ readDir.mockResolvedValue(
+ ok([
+ { name: '.git', path: '/repo/.git', isDirectory: true },
+ { name: 'node_modules', path: '/repo/node_modules', isDirectory: true },
+ { name: 'src', path: '/repo/src', isDirectory: true }
+ ])
+ )
+
+ const result = await readProjectDir('/repo', '/repo')
+
+ expect(result.entries.map(entry => entry.name)).toEqual(['src'])
+ })
+
+ it('opting one root in leaves other roots filtered', async () => {
+ setShowIgnoredFiles('/repo', true)
+ gitRoot.mockResolvedValue('/other')
+ readDir.mockImplementation(async path => {
+ if (path === '/other/src') {
+ return ok([
+ { name: 'debug.log', path: '/other/src/debug.log', isDirectory: false },
+ { name: 'keep.ts', path: '/other/src/keep.ts', isDirectory: false }
+ ])
+ }
+
+ if (path === '/other') {
+ return ok([{ name: '.gitignore', path: '/other/.gitignore', isDirectory: false }])
+ }
+
+ return ok([])
+ })
+ readFileDataUrl.mockResolvedValue(dataUrl('src/*.log\n'))
+
+ const result = await readProjectDir('/other/src', '/other')
+
+ expect(result.entries.map(entry => entry.name)).toEqual(['keep.ts'])
+ })
})
diff --git a/apps/desktop/src/app/right-sidebar/files/ipc.ts b/apps/desktop/src/app/right-sidebar/files/ipc.ts
index 3141b23281b..98e98e3171f 100644
--- a/apps/desktop/src/app/right-sidebar/files/ipc.ts
+++ b/apps/desktop/src/app/right-sidebar/files/ipc.ts
@@ -5,6 +5,8 @@ import { desktopFsCacheKey, desktopGitRoot, readDesktopDir, readDesktopFileDataU
import { ALWAYS_EXCLUDED } from '@/lib/excluded-paths'
import { cleanPath, comparisonPath } from '@/lib/path-compare'
+import { showsIgnoredFiles } from './prefs'
+
export type ProjectTreeEntry = HermesReadDirEntry
interface GitignoreRule {
@@ -117,6 +119,13 @@ function ignoredBy(rules: GitignoreRule[], entry: HermesReadDirEntry) {
}
async function filterIgnored(entries: HermesReadDirEntry[], rootPath: string, dirPath: string) {
+ // Opting a project into its ignored files skips the gitignore pass entirely —
+ // no git-root probe, no .gitignore reads. ALWAYS_EXCLUDED still applies: `.git`
+ // internals and dependency/build dirs are never worth browsing, in any repo.
+ if (showsIgnoredFiles(rootPath)) {
+ return entries
+ }
+
const root = await gitRootFor(rootPath)
if (!root) {
diff --git a/apps/desktop/src/app/right-sidebar/files/prefs.test.ts b/apps/desktop/src/app/right-sidebar/files/prefs.test.ts
new file mode 100644
index 00000000000..952bb7e58d7
--- /dev/null
+++ b/apps/desktop/src/app/right-sidebar/files/prefs.test.ts
@@ -0,0 +1,58 @@
+import { beforeEach, describe, expect, it } from 'vitest'
+
+import { $showIgnoredRoots, setShowIgnoredFiles, showsIgnoredFiles } from './prefs'
+
+describe('files show-ignored preference', () => {
+ beforeEach(() => {
+ $showIgnoredRoots.set([])
+ })
+
+ it('defaults to filtering and only opts in the root it was told about', () => {
+ expect(showsIgnoredFiles('/repo')).toBe(false)
+
+ setShowIgnoredFiles('/repo', true)
+
+ expect(showsIgnoredFiles('/repo')).toBe(true)
+ expect(showsIgnoredFiles('/other')).toBe(false)
+ })
+
+ it('round-trips off again', () => {
+ setShowIgnoredFiles('/repo', true)
+ setShowIgnoredFiles('/repo', false)
+
+ expect(showsIgnoredFiles('/repo')).toBe(false)
+ expect($showIgnoredRoots.get()).toEqual([])
+ })
+
+ it('treats host spellings of one root as the same project', () => {
+ setShowIgnoredFiles('C:\\Repo\\', true)
+
+ expect(showsIgnoredFiles('c:/repo')).toBe(true)
+ })
+
+ it('does not distinguish a trailing separator on POSIX roots', () => {
+ setShowIgnoredFiles('/repo/', true)
+
+ expect(showsIgnoredFiles('/repo')).toBe(true)
+ })
+
+ it('keeps POSIX roots case-sensitive', () => {
+ setShowIgnoredFiles('/Repo', true)
+
+ expect(showsIgnoredFiles('/repo')).toBe(false)
+ })
+
+ it('ignores an empty root instead of storing a blank entry', () => {
+ setShowIgnoredFiles('', true)
+
+ expect(showsIgnoredFiles('')).toBe(false)
+ expect($showIgnoredRoots.get()).toEqual([])
+ })
+
+ it('never records a root twice', () => {
+ setShowIgnoredFiles('/repo', true)
+ setShowIgnoredFiles('/repo/', true)
+
+ expect($showIgnoredRoots.get()).toHaveLength(1)
+ })
+})
diff --git a/apps/desktop/src/app/right-sidebar/files/prefs.ts b/apps/desktop/src/app/right-sidebar/files/prefs.ts
new file mode 100644
index 00000000000..07349670dea
--- /dev/null
+++ b/apps/desktop/src/app/right-sidebar/files/prefs.ts
@@ -0,0 +1,53 @@
+import { connectionScopedAtom } from '@/lib/connection-scoped'
+import { cleanPath, comparisonPath } from '@/lib/path-compare'
+import { Codecs } from '@/lib/persisted'
+
+// "Show gitignored files" is a per-project preference: a repo that keeps a
+// second checkout, a build output or an env-specific folder out of git is
+// exactly the repo whose owner wants to browse it, while every other project
+// should stay clean. Storing one global flag makes that choice leak across
+// projects, so the roots opted in are persisted as a list.
+//
+// The scope is CONNECTION + project root: the same absolute path can name two
+// different repos on two backends, and the connection scope keeps those apart
+// (see lib/connection-scoped). Presence in the list means "show"; absence is
+// the default, so an untouched install persists nothing at all.
+const SHOW_IGNORED_KEY = 'hermes.desktop.files.showIgnored'
+
+export const $showIgnoredRoots = connectionScopedAtom<string[]>(SHOW_IGNORED_KEY, [], Codecs.stringArray)
+
+/** Storage/comparison spelling for a project root — backends, pickers and
+ * session rows disagree on separator and drive-letter case. */
+function rootKey(root: string): string {
+ return comparisonPath(cleanPath(root))
+}
+
+/** The single resolver every reader goes through, so the tree, its lazy child
+ * reads and its revalidations always agree on one answer for a root. */
+export function showsIgnoredFiles(root: string): boolean {
+ if (!root) {
+ return false
+ }
+
+ return $showIgnoredRoots.get().includes(rootKey(root))
+}
+
+/** Set the preference for one project root. Returns whether it actually
+ * changed, so the caller can skip an expensive reload on a no-op. */
+export function setShowIgnoredFiles(root: string, show: boolean): boolean {
+ if (!root) {
+ return false
+ }
+
+ const key = rootKey(root)
+ const current = $showIgnoredRoots.get()
+ const has = current.includes(key)
+
+ if (has === show) {
+ return false
+ }
+
+ $showIgnoredRoots.set(show ? [...current, key] : current.filter(item => item !== key))
+
+ return true
+}
diff --git a/apps/desktop/src/app/right-sidebar/files/use-project-tree.test.ts b/apps/desktop/src/app/right-sidebar/files/use-project-tree.test.ts
index a42e6636615..387b514f5f7 100644
--- a/apps/desktop/src/app/right-sidebar/files/use-project-tree.test.ts
+++ b/apps/desktop/src/app/right-sidebar/files/use-project-tree.test.ts
@@ -6,6 +6,7 @@ import { $connection } from '@/store/session'
import { notifyWorkspaceChanged } from '@/store/workspace-events'
import { clearProjectDirCache, readProjectDir } from './ipc'
+import { $showIgnoredRoots } from './prefs'
import { resetProjectTreeState, useProjectTree } from './use-project-tree'
const readDir = vi.fn<(path: string) => Promise<HermesReadDirResult>>()
@@ -13,6 +14,7 @@ const readDir = vi.fn<(path: string) => Promise<HermesReadDirResult>>()
beforeEach(() => {
$connection.set(null)
resetProjectTreeState()
+ $showIgnoredRoots.set([])
readDir.mockReset()
;(window as unknown as { hermesDesktop: { readDir: typeof readDir } }).hermesDesktop = { readDir }
})
@@ -21,6 +23,7 @@ afterEach(() => {
cleanup()
$connection.set(null)
resetProjectTreeState()
+ $showIgnoredRoots.set([])
delete (window as unknown as { hermesDesktop?: unknown }).hermesDesktop
})
@@ -555,4 +558,123 @@ describe('useProjectTree', () => {
await waitFor(() => expect(result.current.data.map(node => node.name)).toEqual(['from-b']))
})
+
+ // The whole point of the toggle is "show me more files", so the folder the
+ // user is looking at must gain rows, not lose them. loadRoot(force) rebuilds
+ // `data` from the root listing alone, which drops every loaded subtree's
+ // children while arborist keeps the row open — an expanded folder rendering
+ // empty, with nothing left to re-fetch it.
+ it('keeps expanded folders populated when the show-ignored preference flips', async () => {
+ const gitRoot = vi.fn(async () => '/p')
+ const readFileDataUrl = vi.fn(async () => `data:text/plain;base64,${btoa('*.log\n')}`)
+
+ readDir.mockImplementation(async path => {
+ if (path === '/p') {
+ return ok([
+ { name: '.gitignore', path: '/p/.gitignore', isDirectory: false },
+ { name: 'src', path: '/p/src', isDirectory: true }
+ ])
+ }
+
+ if (path === '/p/src') {
+ return ok([
+ { name: 'app.ts', path: '/p/src/app.ts', isDirectory: false },
+ { name: 'debug.log', path: '/p/src/debug.log', isDirectory: false }
+ ])
+ }
+
+ return ok([])
+ })
+ ;(window as unknown as { hermesDesktop: unknown }).hermesDesktop = { gitRoot, readDir, readFileDataUrl }
+
+ const { result } = renderHook(() => useProjectTree('/p'))
+
+ await waitFor(() => expect(result.current.rootLoading).toBe(false))
+
+ // Mirror the real expand flow: arborist records the open state, then the
+ // hook lazy-loads that folder's children.
+ act(() => {
+ result.current.setNodeOpen('/p/src', true)
+ })
+
+ await act(async () => {
+ await result.current.loadChildren('/p/src')
+ })
+
+ expect(result.current.showIgnored).toBe(false)
+ expect(result.current.data.find(n => n.name === 'src')?.children?.map(c => c.name)).toEqual(['app.ts'])
+
+ await act(async () => {
+ result.current.setShowIgnored(true)
+ })
+
+ await waitFor(() =>
+ expect(result.current.data.find(n => n.name === 'src')?.children?.map(c => c.name)).toEqual([
+ 'app.ts',
+ 'debug.log'
+ ])
+ )
+ expect(result.current.showIgnored).toBe(true)
+ expect(result.current.openState['/p/src']).toBe(true)
+
+ await act(async () => {
+ result.current.setShowIgnored(false)
+ })
+
+ await waitFor(() =>
+ expect(result.current.data.find(n => n.name === 'src')?.children?.map(c => c.name)).toEqual(['app.ts'])
+ )
+ expect(result.current.showIgnored).toBe(false)
+ })
+
+ // A listing read under the old preference must never be committed after a
+ // toggle flipped it, or it re-hides the rows the toggle just revealed.
+ it('drops a child listing that was read before the preference flipped', async () => {
+ const gitRoot = vi.fn(async () => '/p')
+ const readFileDataUrl = vi.fn(async () => `data:text/plain;base64,${btoa('*.log\n')}`)
+ let releaseChild: ((value: HermesReadDirResult) => void) | undefined
+
+ readDir.mockImplementation(async path => {
+ if (path === '/p') {
+ return ok([
+ { name: '.gitignore', path: '/p/.gitignore', isDirectory: false },
+ { name: 'src', path: '/p/src', isDirectory: true }
+ ])
+ }
+
+ if (path === '/p/src') {
+ return new Promise<HermesReadDirResult>(resolve => {
+ releaseChild = resolve
+ })
+ }
+
+ return ok([])
+ })
+ ;(window as unknown as { hermesDesktop: unknown }).hermesDesktop = { gitRoot, readDir, readFileDataUrl }
+
+ const { result } = renderHook(() => useProjectTree('/p'))
+
+ await waitFor(() => expect(result.current.rootLoading).toBe(false))
+
+ let pendingChild: Promise<void> | undefined
+
+ act(() => {
+ pendingChild = result.current.loadChildren('/p/src')
+ })
+
+ await waitFor(() => expect(releaseChild).toBeTypeOf('function'))
+
+ act(() => {
+ result.current.setShowIgnored(true)
+ })
+
+ await act(async () => {
+ releaseChild?.(ok([{ name: 'app.ts', path: '/p/src/app.ts', isDirectory: false }]))
+ await pendingChild
+ })
+
+ // The stale read carried only the filtered row; committing it would have
+ // replaced the placeholder with a listing the new preference disagrees with.
+ expect(result.current.data.find(n => n.name === 'src')?.children?.map(c => c.name)).not.toEqual(['app.ts'])
+ })
})
diff --git a/apps/desktop/src/app/right-sidebar/files/use-project-tree.ts b/apps/desktop/src/app/right-sidebar/files/use-project-tree.ts
index 13ee0f7c1aa..aeb1a1713d7 100644
--- a/apps/desktop/src/app/right-sidebar/files/use-project-tree.ts
+++ b/apps/desktop/src/app/right-sidebar/files/use-project-tree.ts
@@ -7,6 +7,7 @@ import { $connection } from '@/store/session'
import { $workspaceChangeTick, consumeWorkspaceChange } from '@/store/workspace-events'
import { clearProjectDirCache, type ProjectTreeEntry, readProjectDir } from './ipc'
+import { $showIgnoredRoots, setShowIgnoredFiles, showsIgnoredFiles } from './prefs'
export interface TreeNode {
/** Absolute filesystem path. Doubles as react-arborist node id. */
@@ -104,10 +105,13 @@ export interface UseProjectTreeResult {
openState: Record<string, boolean>
rootError: string | null
rootLoading: boolean
+ /** True while this project's gitignored entries are displayed. */
+ showIgnored: boolean
collapseAll: () => void
loadChildren: (id: string) => Promise<void>
refreshRoot: () => Promise<void>
setNodeOpen: (id: string, open: boolean) => void
+ setShowIgnored: (show: boolean) => void
}
interface ProjectTreeState {
@@ -295,6 +299,11 @@ async function revalidateTree(
}
const rootPath = state.resolvedCwd || cwd
+ // The gitignore filter is user-switchable, so a listing read under the old
+ // preference must not be committed after a toggle flipped it — it would
+ // re-hide entries the toggle just revealed. Snapshot the policy, re-check it
+ // on commit, same shape as the requestId / connectionKey guards.
+ const filterAtRead = showsIgnoredFiles(rootPath)
if (!change.full && change.dirs.length) {
// Only re-read changed dirs that are actually loaded (root, or an expanded
@@ -308,7 +317,12 @@ async function revalidateTree(
const reads = await Promise.all(targets.map(async dir => ({ dir, ...(await readProjectDir(dir, rootPath)) })))
setProjectTree(latest => {
- if (latest.cwd !== cwd || !latest.loaded || desktopFsCacheKey() !== connectionKey) {
+ if (
+ latest.cwd !== cwd ||
+ !latest.loaded ||
+ desktopFsCacheKey() !== connectionKey ||
+ showsIgnoredFiles(rootPath) !== filterAtRead
+ ) {
return latest
}
@@ -360,7 +374,10 @@ async function revalidateTree(
const nextData = await reconcile(rootPath, state.data)
setProjectTree(latest =>
- latest.cwd === cwd && latest.loaded && desktopFsCacheKey() === connectionKey
+ latest.cwd === cwd &&
+ latest.loaded &&
+ desktopFsCacheKey() === connectionKey &&
+ showsIgnoredFiles(rootPath) === filterAtRead
? { ...latest, data: nextData }
: latest
)
@@ -378,9 +395,33 @@ export function useProjectTree(cwd: string): UseProjectTreeResult {
const connection = useStore($connection)
const workspaceTick = useStore($workspaceChangeTick)
const connectionKey = desktopFsCacheKey(connection)
+ // Subscribed so a toggle re-renders the header; the roots list itself is read
+ // through showsIgnoredFiles so every caller shares one resolver.
+ useStore($showIgnoredRoots)
+
+ const effectiveCwd = state.cwd === cwd && state.resolvedCwd ? state.resolvedCwd : cwd
+ const showIgnored = showsIgnoredFiles(effectiveCwd)
const refreshRoot = useCallback(() => loadRoot(cwd, { connectionKey, force: true }), [connectionKey, cwd])
+ // Flipping the filter changes what every already-read directory contains, so
+ // every loaded listing is stale by construction. `loadRoot(force)` is the
+ // wrong instrument: it rebuilds `data` from the root listing alone, so an
+ // expanded subtree loses its children while arborist keeps the row open —
+ // the folder renders empty and nothing re-fetches it. The full reconcile
+ // re-reads every loaded dir recursively and merges by path id, so expansion
+ // and the subtrees on screen both survive.
+ const setShowIgnored = useCallback(
+ (show: boolean) => {
+ if (!setShowIgnoredFiles(effectiveCwd, show)) {
+ return
+ }
+
+ void revalidateTree(cwd, { dirs: [], full: true }, connectionKey)
+ },
+ [connectionKey, cwd, effectiveCwd]
+ )
+
const setNodeOpen = useCallback(
(id: string, open: boolean) => {
setProjectTree(current => {
@@ -435,6 +476,7 @@ export function useProjectTree(cwd: string): UseProjectTreeResult {
})
const rootPath = $projectTree.get().resolvedCwd || cwd
+ const filterAtRead = showsIgnoredFiles(rootPath)
let entries: ProjectTreeEntry[] = []
let error: string | undefined
@@ -447,7 +489,13 @@ export function useProjectTree(cwd: string): UseProjectTreeResult {
}
setProjectTree(current => {
- if (current.cwd !== cwd || desktopFsCacheKey() !== connectionKey) {
+ // Same filter guard as revalidateTree: a child listing read before a
+ // show-ignored toggle must not land after it.
+ if (
+ current.cwd !== cwd ||
+ desktopFsCacheKey() !== connectionKey ||
+ showsIgnoredFiles(rootPath) !== filterAtRead
+ ) {
return current
}
@@ -535,25 +583,29 @@ export function useProjectTree(cwd: string): UseProjectTreeResult {
collapseAll,
collapseNonce: state.cwd === cwd ? state.collapseNonce : 0,
data: state.cwd === cwd ? state.data : [],
- effectiveCwd: state.cwd === cwd && state.resolvedCwd ? state.resolvedCwd : cwd,
+ effectiveCwd,
loadChildren,
openState: state.cwd === cwd ? state.openState : {},
refreshRoot,
rootError: state.cwd === cwd ? state.rootError : null,
rootLoading: state.cwd === cwd ? state.rootLoading : Boolean(cwd),
- setNodeOpen
+ setNodeOpen,
+ setShowIgnored,
+ showIgnored
}),
[
collapseAll,
cwd,
+ effectiveCwd,
loadChildren,
refreshRoot,
setNodeOpen,
+ setShowIgnored,
+ showIgnored,
state.collapseNonce,
state.cwd,
state.data,
state.openState,
- state.resolvedCwd,
state.rootError,
state.rootLoading
]
diff --git a/apps/desktop/src/app/right-sidebar/index.tsx b/apps/desktop/src/app/right-sidebar/index.tsx
index b154ecf304c..aa3ddb261c5 100644
--- a/apps/desktop/src/app/right-sidebar/index.tsx
+++ b/apps/desktop/src/app/right-sidebar/index.tsx
@@ -48,7 +48,9 @@ export function RightSidebarPane({ onActivateFile, onActivateFolder }: RightSide
refreshRoot,
rootError,
rootLoading,
- setNodeOpen
+ setNodeOpen,
+ setShowIgnored,
+ showIgnored
} = useProjectTree(hasWorkspace ? currentCwd : '')
const cwdName =
@@ -99,7 +101,9 @@ export function RightSidebarPane({ onActivateFile, onActivateFolder }: RightSide
onNodeOpenChange={setNodeOpen}
onPreviewFile={previewFile}
onRefresh={() => void refreshRoot()}
+ onToggleShowIgnored={() => setShowIgnored(!showIgnored)}
openState={openState}
+ showIgnored={showIgnored}
/>
</aside>
)
@@ -111,6 +115,8 @@ interface FilesystemTabProps extends FileTreeBodyProps {
hasWorkspace: boolean
onCollapseAll: () => void
onRefresh: () => void
+ onToggleShowIgnored: () => void
+ showIgnored: boolean
}
// Sidebar palette + hover-reveal: header actions stay reachable while moving
@@ -136,7 +142,9 @@ function FilesystemTab({
onNodeOpenChange,
onPreviewFile,
onRefresh,
- openState
+ onToggleShowIgnored,
+ openState,
+ showIgnored
}: FilesystemTabProps) {
const { t } = useI18n()
const r = t.rightSidebar
@@ -153,6 +161,20 @@ function FilesystemTab({
<div className="flex min-w-0 flex-1">
<SidebarPanelLabel>{cwdName}</SidebarPanelLabel>
</div>
+ <Tip label={showIgnored ? r.hideIgnored : r.showIgnored}>
+ <Button
+ aria-label={showIgnored ? r.hideIgnored : r.showIgnored}
+ aria-pressed={showIgnored}
+ // Stays visible while active: the tree is showing more than the
+ // repo does, and that has to be legible without hovering.
+ className={showIgnored ? HEADER_ACTION_CLASS : HEADER_ACTION_LABEL_REVEAL}
+ onClick={onToggleShowIgnored}
+ size="icon-xs"
+ variant="ghost"
+ >
+ <Codicon name={showIgnored ? 'eye' : 'eye-closed'} size="0.8125rem" />
+ </Button>
+ </Tip>
<Tip label={r.refreshTree}>
<Button
aria-label={r.refreshTree}
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 36ca2afbaf0..fc86affe0bd 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -2684,6 +2684,8 @@ export const ar = defineLocale({
openFolder: 'فتح مجلد',
refreshTree: 'تحديث الشجرة',
collapseAll: 'طي الكل',
+ showIgnored: 'إظهار الملفات المتجاهلة في git',
+ hideIgnored: 'إخفاء الملفات المتجاهلة في git',
previewUnavailable: 'المعاينة غير متاحة',
couldNotPreview: path => `تعذرت معاينة ${path}`,
noProjectTitle: 'لا يوجد مشروع',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index cc8e2964178..40fd801831f 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -3786,6 +3786,8 @@ export const en: Translations = {
openFolder: 'Open folder',
refreshTree: 'Refresh tree',
collapseAll: 'Collapse all folders',
+ showIgnored: 'Show gitignored files',
+ hideIgnored: 'Hide gitignored files',
previewUnavailable: 'Preview unavailable',
couldNotPreview: path => `Could not preview ${path}`,
noProjectTitle: 'No project',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 91efc4db084..113b4e8101f 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -3134,6 +3134,8 @@ export const ja = defineLocale({
openFolder: 'フォルダーを開く',
refreshTree: 'ツリーを更新',
collapseAll: 'すべてのフォルダーを折りたたむ',
+ showIgnored: 'gitignore されたファイルを表示',
+ hideIgnored: 'gitignore されたファイルを非表示',
previewUnavailable: 'プレビューは利用できません',
couldNotPreview: path => `${path} をプレビューできませんでした`,
noProjectTitle: 'プロジェクトなし',
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 1b6f9f3d593..7cfc88906d5 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -3440,6 +3440,8 @@ export const ru = defineLocale({
openFolder: 'Открыть папку',
refreshTree: 'Обновить дерево',
collapseAll: 'Свернуть все папки',
+ showIgnored: 'Показать файлы из gitignore',
+ hideIgnored: 'Скрыть файлы из gitignore',
previewUnavailable: 'Предпросмотр недоступен',
couldNotPreview: path => `Не удалось предпросмотреть ${path}`,
noProjectTitle: 'Проект не открыт',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 33f70765042..6469e3f8813 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -3309,6 +3309,8 @@ export interface Translations {
openFolder: string
refreshTree: string
collapseAll: string
+ showIgnored: string
+ hideIgnored: string
previewUnavailable: string
couldNotPreview: (path: string) => string
noProjectTitle: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 4ba4a0551cf..1dfce3548f9 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -3098,6 +3098,8 @@ export const zhHant = defineLocale({
openFolder: '開啟資料夾',
refreshTree: '重新整理檔案樹',
collapseAll: '收合所有資料夾',
+ showIgnored: '顯示 gitignore 的檔案',
+ hideIgnored: '隱藏 gitignore 的檔案',
previewUnavailable: '預覽不可用',
couldNotPreview: path => `無法預覽 ${path}`,
noProjectTitle: '沒有專案',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index f760066a643..37db3d43598 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -3868,6 +3868,8 @@ export const zh = defineLocale({
openFolder: '打开文件夹',
refreshTree: '刷新文件树',
collapseAll: '折叠所有文件夹',
+ showIgnored: '显示 gitignore 的文件',
+ hideIgnored: '隐藏 gitignore 的文件',
previewUnavailable: '预览不可用',
couldNotPreview: path => `无法预览 ${path}`,
noProjectTitle: '没有项目',