Skip to content

Add shell panel, resizable splits, help dialog, and panel state persistence#4

Merged
bluestreak01 merged 3 commits intomasterfrom
vi_next3
Mar 24, 2026
Merged

Add shell panel, resizable splits, help dialog, and panel state persistence#4
bluestreak01 merged 3 commits intomasterfrom
vi_next3

Conversation

@bluestreak01
Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 commented Mar 24, 2026

Summary

Shell Panel (Ctrl+O)

  • Spawns $SHELL at the bottom of the active panel
  • Independent per-side (left and right can each have their own shell)
  • Full PTY emulation with 10K-line scrollback and trackpad scroll
  • F1 switches focus, Ctrl+O closes

Claude Code Panel (F12) — Refactored

  • Now opens maximized on the opposite panel instead of replacing it entirely
  • Per-side arrays (claude_panels[2]) — can coexist with shell on the other side
  • When maximized, Claude takes the entire column (file panel, CI, shell hidden)
  • Restored on restart with claude -c (continues last session in the original directory)

Resizable Splits

  • Alt+Up/Down resizes the split ratio between file panel and bottom panels (2% increments, 20-80% range)
  • Alt+Enter toggles maximize/restore for shell and CI panels
  • Split ratios persisted per panel type (CI, shell, Claude) across restarts
  • Constants extracted: SPLIT_RESIZE_STEP, SPLIT_MIN/MAX/DEFAULT_PCT

Help Dialog (F1)

  • Scrollable overlay showing all shortcuts grouped by context
  • Sections: File Panels, File Operations, CI, Shell, Claude Code, Viewer, Editor, Application
  • Up/Down/PgUp/PgDn to scroll, Esc/F1/q to close
  • Content built once via OnceLock (zero allocation per frame)

Selection UX

  • Selected+active item shows dark brown on cyan (visually distinct from normal highlight)
  • Shift+Up/Down now toggles selection (unselects already-selected items)

Panel State Persistence

  • Open bottom panels (CI, shell, Claude) saved to state.json on exit
  • Restored on restart: shell respawns, Claude resumes with -c, CI reopens for branch
  • Claude's spawn directory saved separately (may differ from the file panel's directory)

Bug Fixes

  • git status uses --no-optional-locks to avoid index.lock conflicts when Claude runs git commit
  • Git cache refresh interval increased from 2s to 30s (filesystem watcher handles real-time changes)
  • File panel rendering skipped when 0-height (prevents artifacts when maximized)
  • PTY resize synced after every render frame (fixes Alt+Up/Down not updating terminal size)
  • Shell click detection uses actual rendered rect instead of estimated offset

Test plan

  • F1 opens help dialog, scroll works, Esc/F1/q closes
  • Ctrl+O opens shell at bottom of active panel
  • Shell receives keystrokes, scrollback works, F1 switches focus
  • Ctrl+O again closes the shell
  • F12 opens Claude maximized on opposite panel
  • Claude gets the entire column (no file panel, CI, or shell visible on that side)
  • F1 switches focus from Claude to file panel
  • Alt+Up/Down resizes shell/CI split
  • Alt+Enter maximizes/restores shell/CI panel
  • Shift+Up/Down toggles selection (select → unselect on second pass)
  • Selected+active item visually distinct from normal active item
  • Exit and restart: shell, Claude, CI panels restored
  • Claude restored with -c flag in correct directory
  • Split ratios preserved across restarts
  • Open Claude in terminal panel, run git commit — no index.lock error
  • Resize terminal window — all bottom panel PTYs resize correctly

🤖 Generated with Claude Code

bluestreak01 and others added 3 commits March 23, 2026 15:18
Help dialog (F1):
- Scrollable overlay showing all shortcuts grouped by context
- Sections: File Panels, File Operations, CI, Terminal, Viewer, Editor, Application
- Up/Down/PgUp/PgDn/Home/End to scroll, Esc/F1/q to close
- Content built once via OnceLock (zero allocation per frame)

Selection UX:
- Selected+active item shows dark brown on cyan (distinct from normal highlight)
- Shift+Up/Down now toggles selection (unselects already-selected items)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Shell panel:
- Ctrl+O toggles a shell ($SHELL) at the bottom of the active panel
- Same vertical split as CI panel (60/40, or 40/30/30 with both)
- F1 switches focus, Ctrl+O closes, Tab cycles through all panels
- Independent per-side (left and right can each have their own shell)
- Scrollback, mouse scroll, auto-close on exit

Terminal improvements:
- Hardware cursor shown for shell panels, hidden for Claude Code (show_cursor flag)
- Refactored TerminalPanel: spawn_cmd base with spawn_claude/spawn_shell constructors
- Fixed focus state leak: opening Claude terminal now clears shell_focused

Bug fix:
- Shell click detection uses actual rendered rect (shell_panel_areas) instead of
  estimated 40% offset, which was wrong when CI panel was also open
- Shell resize uses actual area dimensions instead of estimates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nel state

Terminal refactor:
- Claude panel now opens maximized on opposite side (was replacing entire panel)
- Per-side arrays: claude_panels[2] replaces singleton terminal_panel
- Shell and Claude can coexist on different sides
- Split ratios adjustable with Alt+Up/Down (2% increments, 20-80% range)
- Alt+Enter toggles maximize (Claude always maximized, shell/CI toggleable)
- When Claude maximized, entire column is Claude (CI/shell/file panel hidden)

Panel state persistence:
- Open bottom panels (CI, shell, Claude) saved to state.json on exit
- Restored on restart: shell respawns, Claude resumes with -c flag
- Claude spawn directory saved separately (may differ from panel dir)
- Split ratios persisted per panel type
- PTY sizes synced with rendered areas after first render

Bug fixes:
- git status uses --no-optional-locks to avoid index.lock conflicts with Claude
- git cache refresh interval increased from 2s to 30s (watcher handles real-time)
- File panel skipped when 0-height (prevents rendering artifacts when maximized)
- PTY resize after every render (fixes Alt+Up/Down not updating terminal size)
- Resize constants extracted (SPLIT_RESIZE_STEP, SPLIT_MIN/MAX/DEFAULT_PCT)

Help dialog and README updated with all new keybindings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bluestreak01 bluestreak01 merged commit f341d56 into master Mar 24, 2026
@bluestreak01 bluestreak01 deleted the vi_next3 branch April 6, 2026 05:50
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