Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

storage-inspector: When parent dir is searched, child files should be open too (#8525)

Shahmir Varqha98e8c02a054f
diff --git a/frontend/src/components/storage/storage-inspector.tsx b/frontend/src/components/storage/storage-inspector.tsx
index 11de822425..a4ba152a84 100644
--- a/frontend/src/components/storage/storage-inspector.tsx
+++ b/frontend/src/components/storage/storage-inspector.tsx
@@ -240,6 +240,11 @@ const StorageEntryRow: React.FC<{
const name = displayName(entry.path);
const hasSearch = !!searchValue.trim();
+ const selfMatches =
+ isDir &&
+ hasSearch &&
+ name.toLowerCase().includes(searchValue.trim().toLowerCase());
+
// During a search, auto-expand directories whose loaded descendants match
const hasMatchingDescendants =
isDir &&
@@ -380,7 +385,7 @@ const StorageEntryRow: React.FC<{
prefix={entry.path}
depth={depth + 1}
locale={locale}
- searchValue={searchValue}
+ searchValue={selfMatches ? "" : searchValue} // When a parent directory matches the search, we don't need to filter the children.
onOpenFile={onOpenFile}
/>
)}