feat(resolver): ✨ wire ClipboardProvider into broker sink#20
Merged
justapithecus merged 1 commit intomainfrom Feb 7, 2026
Merged
feat(resolver): ✨ wire ClipboardProvider into broker sink#20justapithecus merged 1 commit intomainfrom
justapithecus merged 1 commit intomainfrom
Conversation
a82f6c6 to
7439d21
Compare
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>
f7f25dc to
f3e0bfc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract hardcoded
xcliplogic from the broker'sdeliver_clipboard()into aClipboardWriterFnclosure injected at startup. The broker remains structurally independent of resolver types — it receives a closure, not a trait object. Also removes dead X11 code fromhotkey/x11.rsthat was superseded by the resolver adapters in PR 2–3.Highlights
ClipboardWriterFntype alias (Box<dyn Fn(&[u8]) -> Result<(), String> + Send + Sync>) tobroker::moddeliver_clipboard()to accept aclipboard_writerparameter instead of hardcoding xclipX11ClipboardProviderinmain.rsand wrap it as a closure for broker injectionX11Context,Atoms, and entireimpl X11Contextblock fromhotkey/x11.rsHotkeyError::X11variant#[allow(dead_code)]annotations across resolver modulesTest plan
cargo test— all 227 tests passcargo clippy --all-targets -- -Dwarnings— cleancargo fmt --check— cleanclippyctl brokerstarts and clipboard delivery works via hotkey🤖 Generated with Claude Code