feat(tui): size side panels by content instead of equal shares - #6691
Merged
Conversation
The Skills, Memory, Resources, and SubAgents side panels used to split the column into equal Fill(1) shares regardless of content, wasting rows on sparse panels and silently clipping busy ones. Introduce PanelDemand/PanelSizing and an integer max-min-fair water-filling allocator (fit_panel_heights) so each panel gets exactly what its content needs, with leftover redistributed to panels that want it. Each measured widget now derives desired_height from the same line builder its render call uses, so measurement and rendering can never drift apart. A shared panel::render_lines primitive shows a muted "+N more" indicator instead of silently truncating content under pressure. The collapse toggle is kept as an explicit user pin that overrides content-driven sizing. Adds a [tui] panel_sizing config key (auto/even) with wizard, migration, and command-palette wiring; even approximates the old equal-share layout for users who prefer it. Closes #6675
bug-ops
enabled auto-merge (squash)
July 28, 2026 12:56
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
Replaces the TUI dashboard's side-panel column (Skills, Memory, Resources, SubAgents) equal-
Fill(1)split with content-driven sizing, so a sparse panel no longer wastes rows and a busy one is no longer silently clipped.layout::{PanelDemand, PanelSizing, fit_panel_heights}— an integer max-min-fair water-filling allocator.PanelDemand::default() == Greedyreproduces the pre-existing equal-share layout's totals exactly (per-slot remainder placement differs from ratatui's cassowary solver — documented, not treated as a bug).desired_heightderived from the same line/row builder itsrenderuses, so measurement and rendering can never drift apart.widgets::panel::render_linestruncates to the granted height and shows a muted+N moreindicator instead of silently dropping content under pressure.App::panel_demands()composes widget measurement with chrome (focused-panel header, resources' gauge/compaction badge, the subagents equalizer carve-out);App::subagent_slot_mode()is now the single source of truth for which view the SubAgents slot shows (previously decided independently in two places).[tui] panel_sizingconfig (auto/even) wired through the--initwizard,--migrate-config(step 107), the/panel_sizingcommand, and the command palette.PanelDemand::Collapsed) that overrides content-driven sizing.Went through a full validation round (tester, perf, security, adversarial critic) before code review; the critic's first pass caught 2 critical + 3 significant issues (an equalizer-never-renders regression on an empty sub-agent list, an off-by-one in the overflow indicator, the skills panel silently dropping its MCP section under pressure, and an over-claimed behavioral-parity docstring) — all fixed and re-verified before this PR was opened.
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— zeph-tui 1067/1067, zeph-config 990/990RUSTFLAGS=-D warnings+--deny rustdoc::broken_intra_doc_links)cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler"cargo insta test— zeph-tui/zeph-config clean, 0 snapshot diffsgitleaks protect --stagedspecs/011-tui/spec.mdupdated with a Side Panel Sizing sectionCHANGELOG.md[Unreleased]entrydocs/src(book/src/advanced/tui.md) updated.local/testing/playbooks/tui.mdscenarios +coverage-status.mdrow added (main repo)Closes #6675