Add collapsible panel groups to reduce horizontal clutter in the tiling layout
Problem
When many tasks or agent panels are open at the same time, the current tiling layout can become very crowded horizontally and requires frequent horizontal scrolling.
This is especially noticeable when multiple panels belong to the same project or are part of the same coordinated workflow. They are logically related, but they are still displayed as fully separate panels in the UI. Even if the user only wants to keep those related tasks available in the background, they still take up a lot of horizontal space.
Proposed solution
I would like to add support for collapsible panel groups.
The general idea is to group adjacent panels that belong to the same project and the same task type, for example:
- regular independent task panels
- coordinator / coordinated task panels
Each group can be collapsed. When collapsed:
- the first panel in the group remains visible
- the other panels in the same group are temporarily hidden
- an expand button is shown beside the visible panel
- resize handle behavior remains reasonable while collapsed
- the collapsed state can be persisted and restored after restarting the app
This would reduce horizontal space usage while still keeping related task context available, making multi-task workflows easier to manage.
Current status
I already have an initial implementation in a local branch, but I have not pushed it to a remote branch yet.
The current implementation roughly includes:
- detecting and rendering panel groups in the tiling layout
- adding collapse / expand interactions for groups
- adapting resize handle behavior for collapsed groups
- saving and restoring panel group collapsed state
- adding related tests
- adjusting visual styles to make grouping and collapse controls clearer
Next steps
I think the ability to expand or collapse a group of task panels is quite useful. I have a branch implementing this feature, and I have to admit that the current implementation still has room for improvement. For example, the background color of the task panel covering the task panel looks a bit awkward. I would like to hear your thoughts.
Thanks so much for this — it's a genuinely useful idea, and I really appreciate that you've already put in the work and shared screenshots. You're right that there's a real gap here: today the only way to reclaim horizontal space in the strip is to collapse a task to the sidebar, which suspends its agent. There's no way to keep a task running but tucked out of the way, which is exactly what you're after.
I'd love to move this forward. A few thoughts, and a couple of requests if you don't mind:
-
Could you please push your branch as a draft PR? That way we can look at it concretely rather than from screenshots, and I can give much more specific feedback.
-
Could we lean toward an explicit, manual fold rather than automatic grouping? The "adjacent + same project + same type" rule tends to re-form unpredictably whenever panels get reordered, a task closes, or a new one is created — so a group can change without the user doing anything. An explicit "fold these / hide but keep running" action stays predictable. Happy to discuss if you see it differently.
-
On the visual treatment (the part you flagged as awkward): I think the root cause is that the hidden panels are still drawn as shrunken panel cards, so it reads as one panel overlapping another. If instead they collapse into a thin rail — no card background or border, just a slim spine with a count and a small status indicator — it should read as "a folded stack" rather than an overlap. Keeping the agents running and surfacing a hidden task that needs attention would also be great.
-
Could we keep
taskOrderflat and layer the collapsed state on top (a per-task flag), rather than restructuring it into a tree? That keeps the change off the core layout model and much easier to review.
None of this is a no — quite the opposite. The need is real and I'd like to get it in. Thank you again for taking the initiative on this, and please let me know what you think!
#179 Currently, I'm grouping tasks by project or coordinator mode. I think manual grouping is also possible, but I feel it's more suitable for situations with a large number of tasks. However, the question is, do we really create a large number of tasks? In your most common scenario, how many tasks do you create?