Skip to content

feat: add ClaudeCodeFocus command for smart toggle behavior #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

ThomasK33
Copy link
Member

Summary

Implements two-command toggle approach for improved terminal behavior:

  • :ClaudeCode - Simple show/hide toggle (new default)
  • :ClaudeCodeFocus - Smart focus-aware toggle (original complex behavior)

Fixes #16
Fixes #35

Changes

  • Add ClaudeCodeFocus command with focus-aware toggle logic
  • Change ClaudeCode to simple show/hide behavior
  • Add <leader>af keybinding for focus command
  • Implement both toggle modes in native and snacks providers
  • Update documentation and dev config with new commands
  • Add comprehensive tests for both toggle behaviors

User Experience

Simple Toggle (:ClaudeCode)

  • Always shows terminal if hidden
  • Always hides terminal if visible
  • Intuitive for most users

Smart Focus (:ClaudeCodeFocus)

  • Shows terminal if hidden
  • Focuses terminal if visible but not focused
  • Hides terminal if currently focused
  • Power user feature for advanced workflows

- Add ClaudeCodeFocus command with focus-aware toggle logic
- Change ClaudeCode to simple show/hide toggle behavior
- Add <leader>af keybinding for focus command
- Implement both toggle modes in native and snacks providers
- Update documentation and dev config with new command
- Add comprehensive tests for both toggle behaviors

Fixes #16: Keep Claude Code running when toggling
Fixes #35: Improve terminal toggle user experience

Change-Id: If9e739d1af6e7cdfc9dc92dded8be7a3b9c3cf61
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 merged commit 4bebd0e into main Jun 13, 2025
3 checks passed
@ThomasK33 ThomasK33 deleted the feat/two-command-toggle-behavior branch June 13, 2025 14:08
ThomasK33 added a commit that referenced this pull request Jun 18, 2025
This release includes significant feature additions and bug fixes:

**Version Updates:**
- Updated main version table in lua/claudecode/init.lua (0.1.0-alpha → 0.2.0)
- Updated client versions in scripts/claude_interactive.sh (3 locations)
- Updated ClaudeCodeNvim version in scripts/lib_claude.sh
- Removed prerelease flag for stable release

**Documentation:**
- Added comprehensive CHANGELOG.md with v0.2.0 release notes
- Documented all merged PRs since v0.1.0 with proper references
- Updated CLAUDE.md with detailed release process documentation
- Fixed diff keymap references in README.md (<leader>da → <leader>aa)

**Features Added (since v0.1.0):**
- Diagnostics integration (#34)
- File explorer support for oil.nvim, nvim-tree, neotree (#27, #22)
- Enhanced terminal management with ClaudeCodeFocus command (#40)
- Auto terminal provider detection (#36)
- Customizable diff keymaps via LazyVim spec (#47)

**Bug Fixes:**
- Terminal focus errors when buffer hidden (#43)
- Improved diff acceptance behavior (#41)
- Fixed syntax highlighting in proposed diff view (#32)
- Visual selection range handling improvements (#26)
- Native terminal bufhidden behavior (#39)

All code quality checks pass and documentation is updated for maintainability.

Change-Id: I0e4e7c9bae98df922356dc8b8aa0acd7e8293a48
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 mentioned this pull request Jun 18, 2025
ThomasK33 added a commit that referenced this pull request Jun 18, 2025
This release includes significant feature additions and bug fixes:

**Version Updates:**
- Updated main version table in lua/claudecode/init.lua (0.1.0-alpha → 0.2.0)
- Updated client versions in scripts/claude_interactive.sh (3 locations)
- Updated ClaudeCodeNvim version in scripts/lib_claude.sh
- Removed prerelease flag for stable release

**Documentation:**
- Added comprehensive CHANGELOG.md with v0.2.0 release notes
- Documented all merged PRs since v0.1.0 with proper references
- Updated CLAUDE.md with detailed release process documentation
- Fixed diff keymap references in README.md (<leader>da → <leader>aa)

**Features Added (since v0.1.0):**
- Diagnostics integration (#34)
- File explorer support for oil.nvim, nvim-tree, neotree (#27, #22)
- Enhanced terminal management with ClaudeCodeFocus command (#40)
- Auto terminal provider detection (#36)
- Customizable diff keymaps via LazyVim spec (#47)

**Bug Fixes:**
- Terminal focus errors when buffer hidden (#43)
- Improved diff acceptance behavior (#41)
- Fixed syntax highlighting in proposed diff view (#32)
- Visual selection range handling improvements (#26)
- Native terminal bufhidden behavior (#39)

All code quality checks pass and documentation is updated for maintainability.

Change-Id: I0e4e7c9bae98df922356dc8b8aa0acd7e8293a48
Signed-off-by: Thomas Kosiewski <tk@coder.com>
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.

[BUG] Not able to toggle(close) Claude code with ClaudeCode command when not focused [FEATURE] Keep Claude Code running when toggling
1 participant