feat(tui): add section spacing setting to /custom layout dialog#3533
Merged
Conversation
The /custom dialog gains a Section spacing selector (Compact, Normal, Relaxed) controlling the number of blank lines rendered between sidebar sections (1, 2, or 3). The gap was previously hardcoded in the tab component; it is now owned by the sidebar's renderSections, and the setting is persisted as settings.layout.section_spacing in the user config, omitted when set to the default.
dgageot
approved these changes
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
The
/customlayout dialog gains a Section spacing selector controlling the vertical gap between the sidebar sections (blocks). The gap was previously hardcoded in the tab component (2 blank lines).Behavior
settings.layout.section_spacingin~/.config/cagent/config.yaml; omitted whennormal, and the wholelayoutentry is cleared when every setting is at its defaultnormal, so existing configs can never break the layoutImplementation
pkg/tui/messages/layout.goSectionSpacingtype withParseSectionSpacingandBlankLines(), mirroring theSidebarPositionpatternpkg/tui/components/tab/tab.gopkg/tui/components/sidebar/sidebar.goSetSectionGapon the model;renderSectionsinserts the configured blank lines between sections.appendSectionreturns the section start index so agent click zones stay anchored for any gappkg/tui/dialog/customize.gocyclePosition/renderPositionRowgeneralized tocycleValue/renderSelectorRow, shared by both selectorspkg/tui/handlers.gopkg/userconfig/userconfig.gosection_spacingfield (omitempty)docs/features/tui/index.mdThe tab header structure (title line + one padding line) is intentionally unchanged: it is load-bearing for click-zone offsets (
tabHeaderLines,verticalStarY).Testing
ParseSectionSpacing/BlankLinesmapping, user config round trip and default omissiongo build ./...,golangci-lint run(0 issues), fullpkg/tui/...andpkg/userconfigsuites pass