Skip to content

Comments

feat: add resizable panes with draggable dividers#20

Merged
randlee merged 2 commits intodevelopfrom
feature/resizable-panes
Jan 27, 2026
Merged

feat: add resizable panes with draggable dividers#20
randlee merged 2 commits intodevelopfrom
feature/resizable-panes

Conversation

@randlee
Copy link
Owner

@randlee randlee commented Jan 27, 2026

Summary

  • Add draggable vertical dividers between panes for user-controlled sizing
  • Implement terminal hardening fixes from ARCH-CODEX architecture review
  • Remove dead code from previous terminal element refactor

Changes

Resizable Panes

  • ResizeDragState struct tracks drag operations (divider index, start position, ratios)
  • render_divider() creates 6px hitbox with col-resize cursor and visual feedback
  • flex_basis(relative(ratio)) layout replaces equal flex_1() sizing
  • Double-click divider resets to default ratios (1:2:1)
  • MIN_PANE_WIDTH (150px) enforced during resize
  • Ratios persist via existing debounced save mechanism

Terminal Hardening (ARCH-CODEX)

  • HIGH: Add minimum-width guard (2 columns) to prevent alacritty rendering crashes
  • MEDIUM: Fix Alt+key handling to prepend ESC for shell shortcuts (Alt+b, Alt+f, etc.)
  • LOW: Remove unused update_terminal_snapshot, build_lines_from_content, and rendered_lines

Files Changed

  • src/ui/workspace.rs - Main resizable panes implementation
  • src/terminal/element.rs - Minimum-width guard
  • src/terminal/pane.rs - Alt+key fix, dead code removal
  • src/terminal/tab.rs - Remove unused field
  • docs/design/resizable-panes.md - Design document

Test plan

  • Build passes: cargo check
  • Clippy clean: cargo clippy --all-targets
  • Tests pass: cargo test (68 tests)
  • Manual: Drag dividers to resize panes
  • Manual: Double-click divider to reset ratios
  • Manual: Test Alt+b/Alt+f in terminal for word navigation
  • Manual: Resize window very narrow to test minimum-width guard

🤖 Generated with Claude Code

randlee and others added 2 commits January 27, 2026 11:41
- Add ResizeDragState and drag handling for pane dividers
- Implement render_divider with 6px hitbox and col-resize cursor
- Add flex_basis layout with configurable pane_ratios
- Double-click divider to reset ratios to default (1:2:1)
- Enforce MIN_PANE_WIDTH (150px) during resize
- Ratios persist via existing debounced save mechanism

Terminal hardening (ARCH-CODEX review fixes):
- Add minimum-width guard (2 columns) to prevent alacritty crashes
- Fix Alt+key handling to send ESC prefix for shell shortcuts
- Remove unused terminal snapshot code (dead code cleanup)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@randlee randlee merged commit b211201 into develop Jan 27, 2026
5 checks passed
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.

1 participant