Skip to content

feat(layout): add flex-stretch panels and focus mode#22

Open
linniksa wants to merge 1 commit intojohannesjo:mainfrom
linniksa:feature/focus-on-task
Open

feat(layout): add flex-stretch panels and focus mode#22
linniksa wants to merge 1 commit intojohannesjo:mainfrom
linniksa:feature/focus-on-task

Conversation

@linniksa
Copy link

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.

image

Minimum width is still enforced when there are many tasks:

image

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.

image
  • Focus mode state is persisted across app restarts
  • Terminal resize events are fired on task switch to ensure proper redraw

Check List

  • New functionality includes testing. — N/A, manual UI
    testing performed
  • New functionality has been documented in the README if
    applicable. — N/A, internal UI feature

@linniksa linniksa force-pushed the feature/focus-on-task branch from a068420 to bdd5d95 Compare March 15, 2026 09:24
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.
@linniksa linniksa force-pushed the feature/focus-on-task branch from bdd5d95 to f5e27e1 Compare March 15, 2026 09:25
Copy link
Owner

@johannesjo johannesjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants