fix: hide empty archived section and folders (#872)
* fix: hide archived section and empty folders when no sessions remain - Only push archived group in useSessionGrouping when there are archived sessions, preventing an empty archived section from rendering - Hide empty folders in archived bucket via shouldKeepFolder check in SessionGroupSection (folders with no sessions and no content in children are filtered out) - Always filter folders through shouldKeepFolder, not just during search * perf: memoize archived folder filtering
This commit is contained in:
@@ -219,18 +219,21 @@ export const useSessionGrouping = (args: Args) => {
|
||||
});
|
||||
});
|
||||
|
||||
groups.push({
|
||||
id: 'archived',
|
||||
label: 'archived',
|
||||
branch: null,
|
||||
description: 'Archived and unassigned sessions',
|
||||
isMain: false,
|
||||
isArchivedBucket: true,
|
||||
worktree: null,
|
||||
directory: null,
|
||||
folderScopeKey: !args.isVSCode && normalizedProjectRoot ? getArchivedScopeKey(normalizedProjectRoot) : null,
|
||||
sessions: groupedNodes.get(archivedKey) ?? [],
|
||||
});
|
||||
const archivedSessions = groupedNodes.get(archivedKey) ?? [];
|
||||
if (archivedSessions.length > 0) {
|
||||
groups.push({
|
||||
id: 'archived',
|
||||
label: 'archived',
|
||||
branch: null,
|
||||
description: 'Archived and unassigned sessions',
|
||||
isMain: false,
|
||||
isArchivedBucket: true,
|
||||
worktree: null,
|
||||
directory: null,
|
||||
folderScopeKey: !args.isVSCode && normalizedProjectRoot ? getArchivedScopeKey(normalizedProjectRoot) : null,
|
||||
sessions: archivedSessions,
|
||||
});
|
||||
}
|
||||
|
||||
return groups;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user