Skip to content

Conversation

@wesm
Copy link
Collaborator

@wesm wesm commented Jan 23, 2026

Summary

  • Press y in review view or queue view to copy review content to clipboard
  • Shows "Copied to clipboard" flash message on success
  • Cross-platform support via atotto/clipboard (no CGO required)

Changes

  • Add clipboard interface with mockable implementation for testing
  • Add flash message system for user feedback
  • Update help text in queue and review views
  • Comprehensive test coverage including failure scenarios

CI Improvements

  • Add macOS and Windows to test matrix
  • Add CGO_ENABLED=0 build step to verify release compatibility
  • Move coverage to separate Ubuntu-only job

Test plan

  • Unit tests for copy from review view
  • Unit tests for copy from queue view (fetch + copy)
  • Tests for clipboard write failures
  • Tests for 404 and empty output handling
  • Flash message rendering tests
  • All tests pass on Linux
  • CI validates macOS and Windows

🤖 Generated with Claude Code

- Press 'y' in review view to copy review output
- Press 'y' in queue view on completed/failed jobs to fetch and copy
- Shows "Copied to clipboard" flash message on success
- Uses golang.design/x/clipboard for cross-platform support
- ClipboardWriter interface allows mocking for CI tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Switch to atotto/clipboard for CGO-free builds, add tests

- Replace golang.design/x/clipboard with atotto/clipboard
  (uses pbcopy/xclip/clip, no CGO required)
- Simplify realClipboard implementation (no init needed)
- Add httptest tests for fetchReviewAndCopy:
  - Success case with mock server
  - 404 error handling
  - Empty output error handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Add tests for clipboard write failure propagation

- TestTUIClipboardWriteFailurePropagates: verifies errors from
  clipboard.WriteAll propagate through copyToClipboard
- TestTUIFetchReviewAndCopyClipboardFailure: verifies clipboard
  failures after successful fetch are reported correctly

These cover the case when clipboard tools (pbcopy/xclip/clip)
are missing or fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Add macOS and Windows CI jobs for cross-platform testing

- Convert test job to matrix strategy across ubuntu/macos/windows
- Add CGO_ENABLED=0 build step to verify release build compatibility
- Move coverage upload to separate job (Ubuntu only)

This ensures clipboard functionality (and all other code) is tested
on all supported platforms and doesn't regress.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Skip race detector on Windows CI (not supported)

Run plain `go test` on Windows since -race flag requires CGO
which isn't available on windows-latest runners.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Fix flash message causing content shift in review view

Reserve a line for the flash message area in review view so content
doesn't shift when "Copied to clipboard" appears. The flash message
line is always present (blank when no message), preventing jarring
layout changes.

Updated visible lines calculation and test expectations to account
for the new reserved line.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Only show flash message in view where it was triggered

Track which view the flash message was triggered in and only display
it in that same view. Prevents confusing "Copied to clipboard" message
appearing when navigating from queue to review view after copying.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Fix flash message causing layout issues in TUI views

Instead of reserving a dedicated line for the flash message, share
the status line with other notifications:
- Queue view: flash takes priority over update notification
- Review view: flash takes priority over scroll indicator

This fixes the title being pushed off screen and extra blank lines
appearing between the scroll indicator and help bar.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
wesm and others added 5 commits January 22, 2026 22:36
Path separator fixes:
- GetRepoRoot: use filepath.FromSlash on git output (MSYS paths)
- sanitizeTarPath: make destDir absolute before path comparison

Test fixes:
- Use t.TempDir() instead of hardcoded Unix paths like /test/repo
- Skip shell script tests on Windows (agent tests)
- Make Windows absolute path test conditional on runtime.GOOS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Flash view attribution:
- Capture view at trigger time in tuiClipboardResultMsg
- Use captured view instead of current view when setting flashView
- Add test for view-change scenario between trigger and result

MSYS path handling:
- Add normalizeMSYSPath helper to convert /c/... to C:\...
- Use in GetRepoRoot for proper Windows path handling
- Add comprehensive tests for path normalization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix setupMockDaemon to use ROBOREV_DATA_DIR instead of HOME
  (on Windows, os.UserHomeDir() uses USERPROFILE, not HOME)
- Create Windows batch file stubs for codex in tests that need
  an executable command in PATH
- Skip TestDaemonRunStartsAndShutdownsCleanly on Windows due to
  SQLite file locking differences

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test case for "/etc/passwd" expects it to be rejected as an
absolute path, but on Windows this is treated as a relative path
since Windows uses drive letters (C:\) for absolute paths.

The Windows-specific absolute path test (C:\Windows\System32) already
covers the Windows case.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@wesm wesm merged commit 980b749 into main Jan 23, 2026
7 checks passed
@wesm wesm deleted the copy-paste branch January 23, 2026 12:53
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.

2 participants