feat(tui): add mouse-drag sidebar resize#23738
Conversation
Co-Authored-By: Agusti F. <6601142+agustif@users.noreply.github.com>
|
ty for picking this back up hope this time gets merged! |
|
This feature seems useful, how is it going now? |
|
Your design did the heavy lifting, appreciate the original work and the doc trail you left on #5917. Now we wait on maintainer review; happy to address anything they want changed. |
|
Draft, waiting on maintainer design approval per CONTRIBUTING.md. Code is ready and verified locally, nothing pending on my side. |
|
@thdxr Hi Dax! Any chance this could get a peek? Would love this.. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #6087
Type of change
What does this PR do?
Makes the TUI right sidebar resizable by dragging its left edge. The sidebar width was previously hard-coded to 42 columns in
sidebar.tsxand referenced again inroutes/session/index.tsx; there was no way to change it short of patching the binary.Behavior:
theme.warning(same yellow used by the permission prompt triangle, for visual consistency).[20, min(80, floor(terminal_width / 2))]- the dynamic upper bound prevents the sidebar from swallowing the chat on borderline-wide terminals (~120 cols).kv.signalundersidebar_width, survives restarts.This picks up the design from #5917 (mouse-drag, width-persist, 20–80 clamp, 1px handle) which @agustif got a thumbs-up for from the team before it auto-closed at 60 days stale. The codebase had drifted too much (kv.signal refactor, no-floating-promises rule, etc.) for a clean rebase, so this is a fresh implementation with the same UX. @agustif is credited via
Co-Authored-Byon the commit.Previous attempts:
Opening as draft per CONTRIBUTING.md's design-approval expectation on UI features - happy to flip to ready-for-review once approved, or close if you'd prefer to discuss the design more on #6087 first.
How did you verify your code works?
bun run typecheckpasses clean (tsgo, cache-bypassed full run)bunx oxlinton the changed files: 0 new warnings (19 baseline → 19 after)bun dev .- hovering the sidebar/chat boundary highlights the handle yellow, drag resizes, value persists across restarts. Tested at 120/160/200 terminal widths; dynamic clamp keeps chat readable.Screenshots / recordings
21.16.49_21-04-2026.mp4
Checklist