Bug Description
When the "Auto right sidebar" setting is enabled (the default), manually collapsing the right sidebar is not respected when switching between tasks. Every task navigation forces the sidebar back open, making it impossible to keep it dismissed while browsing tasks.
Steps to Reproduce
- Open a project with at least two tasks/sessions
- Click on Task A — right sidebar expands (expected on first open)
- Collapse/dismiss the right sidebar manually
- Click on Task B
- Observe: the right sidebar re-expands, ignoring the manual dismissal
Actual vs Expected Behavior
Actual: The right sidebar unconditionally expands every time activeTask changes to a non-null value. The useEffect in usePanelLayout.ts (line ~272) calls setCollapsed(false) whenever activeTask !== null, with no check for whether the user manually collapsed it.
Expected: If the user manually collapsed the right sidebar, switching tasks should respect that choice. The auto-expand should only apply when transitioning from a non-task view (home, settings) to a task view — not on every task-to-task navigation.
Additionally, the collapsed state is only held in React useState (in right-sidebar.tsx) with no persistence to localStorage, so it is also lost on page reload.
Additional Context
The root cause is in src/renderer/hooks/usePanelLayout.ts, lines ~261-284. The effect watches activeTask and unconditionally expands the sidebar when it's non-null:
} else if (activeTask !== null) {
rightSidebarSetCollapsedRef.current?.(false); // always forces open
}
A fix would need to:
- Track whether the user manually collapsed the sidebar (e.g., a
userDismissed ref)
- Skip auto-expand when the user explicitly dismissed the sidebar
- Optionally persist the collapsed state to localStorage alongside the existing panel size persistence in
persisted-layout.ts
Related: #407 (feature request for auto-open on file changes — same mechanism, opposite direction)
Bug Description
When the "Auto right sidebar" setting is enabled (the default), manually collapsing the right sidebar is not respected when switching between tasks. Every task navigation forces the sidebar back open, making it impossible to keep it dismissed while browsing tasks.
Steps to Reproduce
Actual vs Expected Behavior
Actual: The right sidebar unconditionally expands every time
activeTaskchanges to a non-null value. TheuseEffectinusePanelLayout.ts(line ~272) callssetCollapsed(false)wheneveractiveTask !== null, with no check for whether the user manually collapsed it.Expected: If the user manually collapsed the right sidebar, switching tasks should respect that choice. The auto-expand should only apply when transitioning from a non-task view (home, settings) to a task view — not on every task-to-task navigation.
Additionally, the collapsed state is only held in React
useState(inright-sidebar.tsx) with no persistence to localStorage, so it is also lost on page reload.Additional Context
The root cause is in
src/renderer/hooks/usePanelLayout.ts, lines ~261-284. The effect watchesactiveTaskand unconditionally expands the sidebar when it's non-null:A fix would need to:
userDismissedref)persisted-layout.tsRelated: #407 (feature request for auto-open on file changes — same mechanism, opposite direction)