Bug
Right-clicking a project in the sidebar and selecting Remove project shows:
Project is not empty
Delete all threads in this project before removing it.
…even when the sidebar shows no threads under that project.
Root Cause
The deletion guard in Sidebar.tsx checks threadIdsByProjectId[projectId] which includes all non-deleted threads — including archived ones. But the sidebar rendering filters archived threads out (.filter((thread) => thread.archivedAt === null)), so they're invisible to the user.
Projects that only contain archived threads appear empty but can't be deleted.
Suggested Fix
In handleProjectContextMenu, filter out archived threads before the emptiness check so it matches what the sidebar displays:
const projectThreadIds = threadIdsByProjectId[projectId] ?? [];
- if (projectThreadIds.length > 0) {
+ const visibleThreadIds = projectThreadIds.filter(
+ (threadId) => sidebarThreadsById[threadId]?.archivedAt === null,
+ );
+ if (visibleThreadIds.length > 0) {
And add sidebarThreadsById to the useCallback dependency array.
Bug
Right-clicking a project in the sidebar and selecting Remove project shows:
…even when the sidebar shows no threads under that project.
Root Cause
The deletion guard in
Sidebar.tsxchecksthreadIdsByProjectId[projectId]which includes all non-deleted threads — including archived ones. But the sidebar rendering filters archived threads out (.filter((thread) => thread.archivedAt === null)), so they're invisible to the user.Projects that only contain archived threads appear empty but can't be deleted.
Suggested Fix
In
handleProjectContextMenu, filter out archived threads before the emptiness check so it matches what the sidebar displays:And add
sidebarThreadsByIdto theuseCallbackdependency array.