Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(open-knowledge): hide .DS_Store from sidebar Show All Files (#1701)

Andrew Mikofalvy8fdd851bbbc1
diff --git a/.changeset/hide-ds-store-show-all-files.md b/.changeset/hide-ds-store-show-all-files.md
new file mode 100644
index 000000000..8a267fab4
--- /dev/null
+++ b/.changeset/hide-ds-store-show-all-files.md
@@ -0,0 +1,7 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Stop surfacing macOS Finder metadata files (`.DS_Store`, `.localized`) in the file sidebar's "Show All Files" mode.
+
+These files were already hidden in the normal sidebar (they're seeded into `.gitignore` on `ok init`), but "Show All Files" deliberately bypasses `.gitignore` / `.okignore` to surface gitignored content like `dist/` and `build/` — which re-surfaced `.DS_Store` as a sidebar asset row. They are now pruned by an always-on junk-file floor, the file-level analogue of the existing directory floor that keeps `.git/`, `node_modules/`, and `.ok/` hidden even under Show All Files. Legitimate gitignored content still shows.
diff --git a/packages/server/src/content-filter.test.ts b/packages/server/src/content-filter.test.ts
index 253e4c4f7..8cd5e99cd 100644
--- a/packages/server/src/content-filter.test.ts
+++ b/packages/server/src/content-filter.test.ts
@@ -457,6 +457,16 @@ describe('ContentFilter', () => {
expect(filter.isPathIgnored('.git/config', BYPASS)).toBe(true);
expect(filter.isPathIgnored('node_modules/pkg/index.js', BYPASS)).toBe(true);
+ expect(filter.isExcluded('.DS_Store', BYPASS)).toBe(true);
+ expect(filter.isExcluded('notes/.DS_Store', BYPASS)).toBe(true);
+ expect(filter.isExcluded('a/b/c/.DS_Store', BYPASS)).toBe(true);
+ expect(filter.isExcluded('.localized', BYPASS)).toBe(true);
+ expect(filter.isExcluded('notes/.localized', BYPASS)).toBe(true);
+ expect(filter.isPathIgnored('.DS_Store', BYPASS)).toBe(true);
+ expect(filter.isPathIgnored('notes/.DS_Store', BYPASS)).toBe(true);
+ expect(filter.isExcluded('archive.DS_Store', BYPASS)).toBe(false);
+ expect(filter.isExcluded('notes/my.DS_Store.md', BYPASS)).toBe(false);
+
expect(filter.isDirExcluded('dist', BYPASS)).toBe(false);
expect(filter.isDirExcluded('build', BYPASS)).toBe(false);
expect(filter.isDirExcluded('coverage', BYPASS)).toBe(false);
diff --git a/packages/server/src/content-filter.ts b/packages/server/src/content-filter.ts
index 11fed4711..57a658c79 100644
--- a/packages/server/src/content-filter.ts
+++ b/packages/server/src/content-filter.ts
@@ -91,6 +91,12 @@ function pathHasAlwaysSkipSegment(relativePath: string): boolean {
return false;
}
+const BUILTIN_SKIP_FILES = new Set<string>(['.DS_Store', '.localized']);
+
+function isAlwaysSkipFile(relativePath: string): boolean {
+ return BUILTIN_SKIP_FILES.has(relativePath.slice(relativePath.lastIndexOf('/') + 1));
+}
+
function isSingleDocAncestorDir(relativeDir: string, singleDocRelPath: string): boolean {
return singleDocRelPath === relativeDir || singleDocRelPath.startsWith(`${relativeDir}/`);
}
@@ -386,6 +392,8 @@ export function createContentFilter(opts: ContentFilterOptions): ContentFilter {
if (pathHasAlwaysSkipSegment(relativePath)) return true;
+ if (isAlwaysSkipFile(relativePath)) return true;
+
if (singleDocRelPath !== undefined) return relativePath !== singleDocRelPath;
if (opts?.bypassFilters) return false;
@@ -423,6 +431,7 @@ export function createContentFilter(opts: ContentFilterOptions): ContentFilter {
isPathIgnored(relativePath: string, opts?: ContentFilterReadOpts): boolean {
if (isReservedDocName(relativePath)) return true;
if (pathHasAlwaysSkipSegment(relativePath)) return true;
+ if (isAlwaysSkipFile(relativePath)) return true;
if (opts?.bypassFilters) return false;
return isRejectedByConfigurableRules(relativePath);
},
@@ -788,6 +797,7 @@ export async function createContentFilterAsync(opts: ContentFilterOptions): Prom
isExcluded(relativePath: string, opts?: ContentFilterReadOpts): boolean {
if (isReservedDocName(relativePath)) return true;
if (pathHasAlwaysSkipSegment(relativePath)) return true;
+ if (isAlwaysSkipFile(relativePath)) return true;
if (singleDocRelPath !== undefined) return relativePath !== singleDocRelPath;
if (opts?.bypassFilters) return false;
if (isRejectedByConfigurableRules(relativePath)) return true;
@@ -820,6 +830,7 @@ export async function createContentFilterAsync(opts: ContentFilterOptions): Prom
isPathIgnored(relativePath: string, opts?: ContentFilterReadOpts): boolean {
if (isReservedDocName(relativePath)) return true;
if (pathHasAlwaysSkipSegment(relativePath)) return true;
+ if (isAlwaysSkipFile(relativePath)) return true;
if (opts?.bypassFilters) return false;
return isRejectedByConfigurableRules(relativePath);
},