Skip to content

rename-shells#58

Merged
marcus merged 3 commits intomainfrom
rename-shells
Jan 21, 2026
Merged

rename-shells#58
marcus merged 3 commits intomainfrom
rename-shells

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented Jan 21, 2026

Created from worktree manager

marcus and others added 3 commits January 20, 2026 15:17
Feature 1: Shell Rename
- Add ViewModeRenameShell modal with text input for custom display names
- Press R to rename selected shell (max 50 chars, unique, non-empty)
- Modal shows current name and stable tmux session ID
- Validation with user-friendly error messages (empty, duplicate, length)
- Keyboard navigation: Tab/Shift+Tab cycle focus, Enter confirms, Esc cancels
- Mouse support: click input field or buttons
- Add RenameShellDoneMsg for state update after rename
- Renamed names display in sidebar for easy identification
- Names persist via saveSelectionState() (tmux session name stays stable)

Feature 2: Right-Align [+] Buttons
- Move "+" buttons from inline to right edge of sidebar headers
- Shells subheader: "+ " → fill spacing + "+"
- Worktrees subheader: "+ " → fill spacing + "+"
- Matches "New" button styling (already right-aligned)
- Improves visual hierarchy and reduces text clutter
- Updates hit region X coordinates for correct mouse interaction
- Works at all terminal widths (minimum 1 space between)

Implementation details:
- types.go: Add ViewModeRenameShell enum, RenameShellDoneMsg struct
- plugin.go: Modal state fields, region constants
- keys.go: R key handler with validation logic, keyboard nav functions
- view_modals.go: renderRenameShellModal with dimmed overlay
- view_list.go: Add ViewModeRenameShell case, right-align button code
- update.go: Handle RenameShellDoneMsg, update shell name
- mouse.go: Hover tracking and click handlers for modal
- commands.go: Add rename-shell command to footer
- worktrees-plugin.md: Document shell management and rename feature

Tests: Rename shell with R, verify persistence after restart, test validation,
verify buttons right-aligned at various terminal widths.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…text()

- Added ViewModeRenameShell case in Commands() to return proper footer commands (Rename/Cancel)
- Added ViewModeRenameShell case in FocusContext() to dispatch keyboard events to correct context
- These were critical bugs preventing the rename shell modal from functioning correctly

The feature was missing support for:
1. Footer command hints during rename operation
2. Proper keyboard context for keybinding dispatch

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@marcus marcus merged commit daa1b96 into main Jan 21, 2026
1 check passed
@marcus marcus deleted the rename-shells branch January 21, 2026 00:30
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