feat(layout): add flex-stretch panels and focus mode#22
feat(layout): add flex-stretch panels and focus mode#22linniksa wants to merge 1 commit intojohannesjo:mainfrom
Conversation
a068420 to
bdd5d95
Compare
Task panels now stretch to fill available width using flex-grow instead of fixed pixel sizes. Added a focus mode toggle button in the task title bar that shows only the active task at full width. In focus mode, hidden panels use visibility:hidden (not display:none) so terminals keep their correct dimensions. Focus mode state is persisted across app restarts.
bdd5d95 to
f5e27e1
Compare
There was a problem hiding this comment.
Thank you very much for this and sorry for the late reply. Somehow I wasn't receiving notifications for PRs opened here....
Code Review
Nice implementation — the visibility: hidden + position: absolute approach for keeping terminals alive with correct dimensions is well-chosen, and the persistence/store changes follow existing patterns cleanly.
Must fix
focusMode missing from persistedSnapshot() in autosave.ts
saveState() in persistence.ts includes focusMode, but persistedSnapshot() in autosave.ts does not. This means toggling focus mode won't trigger an autosave. If the app crashes before another field changes, the state is lost. Add focusMode: store.focusMode to the snapshot.
Worth addressing
scrollIntoView fires in focus mode
The createEffect at TilingLayout.tsx:26 still calls scrollIntoView in focus mode. With panels stacked absolutely this is meaningless and could cause scroll jumps. Consider guarding:
if (!activeId || !containerRef || store.focusMode) return;minSize on PanelChild is unused
minSize: 520 on the cached PanelChild (line ~52) is no longer consumed since ResizablePanel was removed. The actual enforcement is the CSS min-width: 520px in the flex wrapper. Having "520" in two places is a maintenance risk — consider removing minSize from the cache or adding a shared constant.
Ctrl+Shift+Wheel resize silently removed
The createCtrlShiftWheelResizeHandler integration was removed but not mentioned in the PR description. This is a user-facing feature regression. Also, createCtrlShiftWheelResizeHandler in wheelZoom.ts becomes dead code (no other consumers). If the removal is intentional, note it in the description and consider cleaning up the dead export.
Nice to have
Keyboard shortcut for focus mode — the app has extensive keyboard navigation but focus mode is only togglable via the icon button.
Auto-exit focus mode with 1 task — when tasks are deleted down to 1, focus mode provides no benefit. Consider auto-disabling when taskOrder.length <= 1.
Summary
Task panels now stretch to fill available width using flex-grow instead of fixed pixel sizes. Added a focus mode toggle button in the task title bar that shows only the active task at full width.
Description
Flex-stretch layout (default)
Panels automatically distribute available space — 1 task fills the entire width, 2 tasks split 50/50, etc. Minimum width
(520px) is preserved; horizontal scroll appears when needed.
Minimum width is still enforced when there are many tasks:
Focus mode
A new focus button in the task title bar shows only the active task at full width. Other tasks remain alive in the background (terminals keep running). Switching tasks via sidebar or keyboard shortcuts works seamlessly while in focus mode.
Check List
testing performed
applicable. — N/A, internal UI feature