Skip to content

The agent that grows with you

feat(desktop): apply the reveal floor in the project tree listing

Brooklyn Nicholson952c941e741e
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 e5857a6070a..09e5505d59b 100644
--- a/apps/desktop/src/app/right-sidebar/files/ipc.test.ts
+++ b/apps/desktop/src/app/right-sidebar/files/ipc.test.ts
@@ -154,6 +154,37 @@ describe('readProjectDir', () => {
expect(result.entries.map(entry => entry.name)).toEqual(['src'])
})
+ it('reveals revealable hygiene entries (out, vendor, coverage) when the root opted in (#55169)', async () => {
+ setShowIgnoredFiles('/repo', true)
+ readDir.mockResolvedValue(
+ ok([
+ { name: '.git', path: '/repo/.git', isDirectory: true },
+ { name: 'coverage', path: '/repo/coverage', isDirectory: true },
+ { name: 'out', path: '/repo/out', isDirectory: true },
+ { name: 'src', path: '/repo/src', isDirectory: true },
+ { name: 'vendor', path: '/repo/vendor', isDirectory: true }
+ ])
+ )
+
+ const result = await readProjectDir('/repo', '/repo')
+
+ expect(result.entries.map(entry => entry.name)).toEqual(['coverage', 'out', 'src', 'vendor'])
+ })
+
+ it('keeps revealable hygiene entries hidden when the root has not opted in', async () => {
+ readDir.mockResolvedValue(
+ ok([
+ { name: 'coverage', path: '/repo/coverage', isDirectory: true },
+ { name: 'out', path: '/repo/out', 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')
diff --git a/apps/desktop/src/app/right-sidebar/files/ipc.ts b/apps/desktop/src/app/right-sidebar/files/ipc.ts
index 8457b0e83c6..7681939ded0 100644
--- a/apps/desktop/src/app/right-sidebar/files/ipc.ts
+++ b/apps/desktop/src/app/right-sidebar/files/ipc.ts
@@ -2,7 +2,7 @@ import ignore from 'ignore'
import type { HermesReadDirEntry, HermesReadDirResult } from '@/global'
import { desktopFsCacheKey, desktopGitRoot, readDesktopDir, readDesktopFileDataUrl } from '@/lib/desktop-fs'
-import { ALWAYS_EXCLUDED } from '@/lib/excluded-paths'
+import { ALWAYS_EXCLUDED, SHOW_IGNORED_EXCLUDED } from '@/lib/excluded-paths'
import { cleanPath, comparisonPath, isUnderPath } from '@/lib/path-compare'
import { showsIgnoredFiles } from './prefs'
@@ -203,10 +203,16 @@ export async function readProjectDir(dirPath: string, rootPath = dirPath): Promi
return { entries: [], error: 'no-bridge' }
}
+ // The transport-level noise (.git internals, dependency/build dirs) is
+ // stripped at both ends, so the reveal floor is SHOW_IGNORED_EXCLUDED —
+ // ALWAYS_EXCLUDED names the transports keep (out, vendor, coverage, …)
+ // stay browsable in a project that opted into showing ignored files (#55169).
+ const showIgnored = showsIgnoredFiles(rootPath)
+ const filterSet = showIgnored ? SHOW_IGNORED_EXCLUDED : ALWAYS_EXCLUDED
const result = await readDesktopDir(dirPath)
- const entries = (result?.entries ?? []).filter(entry => !ALWAYS_EXCLUDED.has(entry.name))
+ const entries = (result?.entries ?? []).filter(entry => !filterSet.has(entry.name))
- return { ...result, entries: await filterIgnored(entries, rootPath, dirPath) }
+ return { ...result, entries: showIgnored ? entries : await filterIgnored(entries, rootPath, dirPath) }
}
export function clearProjectDirCache(rootPath?: string) {