diff --git a/src/renderer/components/Sidebar/Sidebar.tsx b/src/renderer/components/Sidebar/Sidebar.tsx index d61edaa..d387c84 100644 --- a/src/renderer/components/Sidebar/Sidebar.tsx +++ b/src/renderer/components/Sidebar/Sidebar.tsx @@ -360,14 +360,15 @@ const PostsList: React.FC = () => { }; // Determine which posts to display - const displayPosts = searchResults ?? filteredPosts ?? posts; - const isFiltered = searchResults !== null || filteredPosts !== null; + // Filters only apply to published/archived posts — drafts are always shown unfiltered + const filteredDisplayPosts = searchResults ?? filteredPosts ?? null; + const isFiltered = filteredDisplayPosts !== null; const hasActiveFilters = searchQuery || selectedYear || selectedTags.length > 0 || selectedCategories.length > 0; const groupedPosts = { - draft: displayPosts.filter(p => p.status === 'draft'), - published: displayPosts.filter(p => p.status === 'published'), - archived: displayPosts.filter(p => p.status === 'archived'), + draft: posts.filter(p => p.status === 'draft'), + published: (filteredDisplayPosts ?? posts).filter(p => p.status === 'published'), + archived: (filteredDisplayPosts ?? posts).filter(p => p.status === 'archived'), }; const clearAllFilters = () => { @@ -436,7 +437,7 @@ const PostsList: React.FC = () => { {hasActiveFilters && (
No posts yet
No matching posts