Skip to content

feat(tui): size side panels by content instead of equal shares - #6691

Merged
bug-ops merged 1 commit into
mainfrom
feat/issue-6675/side-panel-widgets-waste-vert
Jul 28, 2026
Merged

feat(tui): size side panels by content instead of equal shares#6691
bug-ops merged 1 commit into
mainfrom
feat/issue-6675/side-panel-widgets-waste-vert

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 28, 2026

Copy link
Copy Markdown
Owner

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.

  • New layout::{PanelDemand, PanelSizing, fit_panel_heights} — an integer max-min-fair water-filling allocator. PanelDemand::default() == Greedy reproduces 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).
  • Each measured widget (skills, memory, resources, subagents' plain list, security, plan_view, compaction_badge) exposes a pure desired_height derived from the same line/row builder its render uses, so measurement and rendering can never drift apart.
  • New shared widgets::panel::render_lines truncates to the granted height and shows a muted +N more indicator 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).
  • New [tui] panel_sizing config (auto/even) wired through the --init wizard, --migrate-config (step 107), the /panel_sizing command, and the command palette.
  • The collapse toggle is kept as an explicit user pin (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 --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — zeph-tui 1067/1067, zeph-config 990/990
  • Rustdoc gate (RUSTFLAGS=-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 diffs
  • gitleaks protect --staged
  • specs/011-tui/spec.md updated with a Side Panel Sizing section
  • CHANGELOG.md [Unreleased] entry
  • docs/src (book/src/advanced/tui.md) updated
  • .local/testing/playbooks/tui.md scenarios + coverage-status.md row added (main repo)
  • Live tmux-pty testing (playbook scenarios) — not yet run, flagged for the tester/live-tester agent as next step

Closes #6675

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
@github-actions github-actions Bot added enhancement New feature or request documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines) and removed enhancement New feature or request labels Jul 28, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 28, 2026 12:56
@bug-ops
bug-ops merged commit d4e031b into main Jul 28, 2026
47 checks passed
@bug-ops
bug-ops deleted the feat/issue-6675/side-panel-widgets-waste-vert branch July 28, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

side panel widgets waste vertical space by ignoring their content when sizing

1 participant