Skip to content

feat(resolver): ✨ wire ClipboardProvider into broker sink#20

Merged
justapithecus merged 1 commit intomainfrom
andrew/feat/resolver/clipboard-sink
Feb 7, 2026
Merged

feat(resolver): ✨ wire ClipboardProvider into broker sink#20
justapithecus merged 1 commit intomainfrom
andrew/feat/resolver/clipboard-sink

Conversation

@justapithecus
Copy link
Member

Summary

Extract hardcoded xclip logic from the broker's deliver_clipboard() into a ClipboardWriterFn closure injected at startup. The broker remains structurally independent of resolver types — it receives a closure, not a trait object. Also removes dead X11 code from hotkey/x11.rs that was superseded by the resolver adapters in PR 2–3.

Highlights

  • Add ClipboardWriterFn type alias (Box<dyn Fn(&[u8]) -> Result<(), String> + Send + Sync>) to broker::mod
  • Modify deliver_clipboard() to accept a clipboard_writer parameter instead of hardcoding xclip
  • Construct X11ClipboardProvider in main.rs and wrap it as a closure for broker injection
  • Remove dead X11Context, Atoms, and entire impl X11Context block from hotkey/x11.rs
  • Remove unused HotkeyError::X11 variant
  • Clean up stale #[allow(dead_code)] annotations across resolver modules

Test plan

  • cargo test — all 227 tests pass
  • cargo clippy --all-targets -- -Dwarnings — clean
  • cargo fmt --check — clean
  • Manual: clippyctl broker starts and clipboard delivery works via hotkey

🤖 Generated with Claude Code

@justapithecus justapithecus force-pushed the andrew/feat/resolver/wire branch from a82f6c6 to 7439d21 Compare February 7, 2026 21:16
Base automatically changed from andrew/feat/resolver/wire to main February 7, 2026 21:16
Extract hardcoded xclip logic from broker's deliver_clipboard() into a
ClipboardWriterFn closure injected at startup. The broker remains
structurally independent of resolver types — it receives a closure, not
a trait object.

- Add ClipboardWriterFn type alias to broker::mod
- Modify deliver_clipboard() to accept clipboard_writer parameter
- Construct X11ClipboardProvider in main.rs, wrap as closure
- Remove dead X11Context/Atoms/impl from hotkey/x11.rs
- Remove unused HotkeyError::X11 variant
- Clean up stale #[allow(dead_code)] annotations in resolver/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@justapithecus justapithecus force-pushed the andrew/feat/resolver/clipboard-sink branch from f7f25dc to f3e0bfc Compare February 7, 2026 21:16
@justapithecus justapithecus merged commit 91b72b4 into main Feb 7, 2026
4 checks passed
@justapithecus justapithecus deleted the andrew/feat/resolver/clipboard-sink branch February 7, 2026 21:16
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