feat: add clipboard copy support and fix hint bar overlap#115
Conversation
Add ability to copy selected text to system clipboard from the TUI. - Add cross-platform clipboard utility (wl-copy, xclip, xsel, pbcopy, clip.exe) - Cmd+C copies selected text on macOS - Ctrl+Shift+C or Alt+C copies on Linux - Ctrl+C copies on Windows - Show feedback toast when text is copied - Auto-dismiss feedback after 2 seconds Closes #91
Move the hint bar in ChatView from inside the input area to an absolute position on the bottom border line. This prevents the hints from overlapping with long input text.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughAdds cross‑platform clipboard write support and UI feedback to the TUI: new clipboard utility, integrations in chat and run components to copy selected renderer text on copy shortcuts, repositioned ChatView hint bar. Changes
Sequence DiagramsequenceDiagram
participant User
participant KeyHandler as KeyboardHandler
participant Renderer
participant Clipboard as Clipboard Utility
participant OS as OS Clipboard
participant Toast
User->>KeyHandler: Press Cmd+C / Ctrl+C
KeyHandler->>Renderer: Is copy shortcut? / getSelectedText()
alt Selection exists
Renderer-->>KeyHandler: Selected text
KeyHandler->>Clipboard: writeToClipboard(selectedText)
Clipboard->>OS: Run platform command (pbcopy / wl-copy / xclip / clip)
OS-->>Clipboard: Command result
Clipboard-->>KeyHandler: ClipboardResult {success, error?, charCount?}
KeyHandler->>Toast: Show "Copied" feedback (2s)
Toast->>User: Display and auto-dismiss
else No selection
KeyHandler-->>User: No action
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #115 +/- ##
==========================================
+ Coverage 41.61% 41.95% +0.33%
==========================================
Files 57 59 +2
Lines 12606 12690 +84
==========================================
+ Hits 5246 5324 +78
- Misses 7360 7366 +6
🚀 New features to boost your workflow:
|
- Test platform-specific command selection (pbcopy, wl-copy, xclip, clip) - Test Linux fallback chain (wl-copy -> xclip -> xsel) - Test error handling (ENOENT, other errors, non-zero exit codes) - Test BSD support (FreeBSD, OpenBSD use Linux clipboard tools) - Achieves 94.87% line coverage on clipboard.ts
feat: add clipboard copy support and fix hint bar overlap
Summary
Closes #91
Test plan
Summary by CodeRabbit
New Features
UI Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.