feat(tui): add /custom command to customize layout#3509
Merged
Conversation
Add a layout customization dialog opened with /custom: move the sidebar (right, left, top, bottom) and toggle the visibility of its token usage, agents, tools, and todos sections. Changes are previewed live (schematic in the dialog plus the real UI behind it), applied to every tab, and persisted in the user config under settings.layout. The top and bottom positions render the sidebar as a compact band that reuses the vertical sidebar styling (accent blocks, usage glyph, agent colors, todo icons) in the same section order. A left sidebar mirrors its edge padding so it sits flush against the terminal edge, keeping the layout symmetric with the default right position.
aheritier
approved these changes
Jul 7, 2026
Sayt-0
pushed a commit
to EronWright/docker-agent
that referenced
this pull request
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
/customslash command (also in the command palette as "Customize Layout") opening a dialog to customize the chat layout: sidebar position and which sidebar sections are visible. Every change is previewed live (schematic inside the dialog plus immediate application to the UI behind it) and persisted in the user config.Dialog preview
The schematic adapts to the selection: the sidebar box moves (left/right column, top/bottom band) and hidden sections disappear from it.
Features
Right(default),Left(vertical, mirrored),Top/Bottom(compact horizontal band)settings.layoutin~/.config/cagent/config.yaml, loaded at startup, defaults omitted↑/↓navigate,←/→/spacechange,enterapply and persist,esccancel and restoreMessage flow
Band rendering (top/bottom)
The band reuses the vertical sidebar's visual language (accent blocks, usage glyph, agent accent colors, todo status icons), in the same section order, via shared render helpers (
workingDirLine,tokenUsageLine):Left position
The sidebar's internal edge padding is mirrored so it sits flush against the terminal edge, keeping the layout symmetric with the default right position:
Implementation notes
pkg/tui/messages/layout.go:LayoutSettingstype plus open/preview/apply/cancel messagespkg/tui/dialog/customize.go: dialog with adaptive schematic previewpkg/tui/page/chat: position-aware geometry, rendering, hit testing, and drag-resize directionpkg/tui/components/sidebar:SectionVisibility(vertical sections and collapsed band),SetMirroredPadding, band info line (agents, tools, todos)pkg/userconfig:settings.layoutschema and defaults--sidebar=falseshows a notificationTesting
/customparsinggo build,golangci-lint, andgo run ./lint .pass; remaining test failures are network-dependent tests (pkg/config, pkg/httpclient, pkg/teamloader) that also fail onmainin the sandbox