Skip to content

feat: add C-a s to toggle the sidebar in boo ui#50

Merged
kylecarbs merged 2 commits into
mainfrom
ui-sidebar-toggle
Jun 12, 2026
Merged

feat: add C-a s to toggle the sidebar in boo ui#50
kylecarbs merged 2 commits into
mainfrom
ui-sidebar-toggle

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

Closes #47.

The sidebar in boo ui was always visible. C-a s (and C-a C-s) now hides it, giving the viewport the full terminal width, and pressing it again brings the sidebar back at its old width.

Behavior

  • C-a s toggles the sidebar; the focused session's pty resizes with the viewport, exactly like a sidebar resize does.
  • The hidden state survives terminal resizes (SIGWINCH), like the width preference.
  • Mouse hit testing follows: while hidden, every cell belongs to the viewport (wheel, selection, and mouse forwarding work full-width).
  • Sidebar-targeting arrows reveal a hidden sidebar before acting, so their effect is never invisible: C-a Up/Down (browse) and C-a Left/Right (resize). Hiding cancels an active browse for the same reason.
  • Status content (prompts, messages, the keybind bar) still overlays the bottom row while hidden, since it renders full-width independent of the sidebar.
  • The keybind bar, boo help ui, and the README mention the new bind.

Testing

  • Unit tests: hidden-layout geometry and hit testing, toggle/restore with browse cancellation, and arrow-reveal behavior.
  • Integration test on a real PTY: hides, verifies the session list/hint/separator leave the rendered screen and the session pty grows to full width, types into the hidden-sidebar session, then restores and verifies the sidebar returns at its old width. Added a whole-screen waitScreen helper alongside waitLastRow.
  • The keybind-bar test terminal widens from 132 to 140 columns: the bar gained s sidebar and the test asserts its full text renders. The bar remains clipped gracefully on narrower terminals (appendClipped), as before.
  • zig build test-all: 136/136 pass; zig fmt --check clean.
Implementation notes
  • The hidden flag lives on Layout, next to the geometry it changes (viewportCols, viewportX, hit), so renderer and mouse code need no special cases beyond skipping the sidebar/separator segments in composeRow.
  • sidebar_w is preserved while hidden, so show restores the previous width, including a width set by C-a Left/Right.
  • The common "viewport geometry changed" tail (live-view resize, selection drop, full repaint) was shared by relayout and applySidebarWidth; it is now factored into viewportChanged() and reused by the toggle.

This PR was generated by Coder Agents on behalf of @kylecarbs.

The sidebar in boo ui was always visible. C-a s (and C-a C-s) now
hides it, giving the viewport the full terminal width, and brings it
back at its old width. The hidden state survives terminal resizes,
and the sidebar arrows (C-a Up/Down browse, C-a Left/Right resize)
reveal a hidden sidebar before acting so their effect stays visible.

Closes #47
@kylecarbs kylecarbs merged commit c8253de into main Jun 12, 2026
5 checks passed
@kylecarbs kylecarbs deleted the ui-sidebar-toggle branch June 12, 2026 19:33
This was referenced Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toggle sidebar in boo ui

1 participant