Skip to content

feat(resolver): ✨ wire hotkey client to use resolver traits#19

Merged
justapithecus merged 1 commit intomainfrom
andrew/feat/resolver/wire
Feb 7, 2026
Merged

feat(resolver): ✨ wire hotkey client to use resolver traits#19
justapithecus merged 1 commit intomainfrom
andrew/feat/resolver/wire

Conversation

@justapithecus
Copy link
Member

Summary

Migrate the hotkey client from direct X11 calls to platform-agnostic resolver trait objects. After this PR, the hotkey client has zero platform-specific code — all X11 knowledge lives in the resolver adapter implementations. This is PR 3 of 4 (the critical migration PR).

Highlights

  • hotkey::run() signature change: now accepts &dyn SessionResolver + &mut dyn HotkeyProvider instead of calling X11Context directly
  • HotkeyProvider::register() replaces manual parse_binding → grab_key → spawn_event_thread sequence
  • SessionResolver::focused_session() replaces get_active_window_pid()resolve_session() pipeline
  • HotkeyEvent replaces internal Action enum; classify_event() removed (classification moved into X11HotkeyProvider)
  • main.rs constructs X11SharedX11SessionResolver + X11HotkeyProvider and passes to hotkey::run()
  • Dead X11Context code annotated #[allow(dead_code)] for cleanup in PR 4

Test plan

  • cargo test — all 227 tests pass
  • cargo clippy --all-targets -- -Dwarnings — clean
  • cargo fmt --check — clean
  • Manual: clippyctl hotkey --capture-key Super+Shift+C --paste-key Super+Shift+V --clipboard-key Super+Shift+X — all three hotkeys should behave identically to pre-migration

🤖 Generated with Claude Code

@justapithecus justapithecus force-pushed the andrew/feat/resolver/x11 branch from 8366784 to 80ebc65 Compare February 7, 2026 21:16
Base automatically changed from andrew/feat/resolver/x11 to main February 7, 2026 21:16
Migrate the hotkey client from direct X11 calls to platform-agnostic
resolver trait objects:

- run() now accepts &dyn SessionResolver + &mut dyn HotkeyProvider
- HotkeyProvider::register() replaces manual parse/grab/event-thread
- SessionResolver::focused_session() replaces X11 + process tree walk
- HotkeyEvent replaces internal Action enum; classify_event() removed
- main.rs constructs X11Shared → X11SessionResolver + X11HotkeyProvider

The hotkey client is now fully platform-agnostic. Platform knowledge
lives entirely in the resolver adapter implementations.

X11Context and related dead code annotated with #[allow(dead_code)]
for cleanup in PR 4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@justapithecus justapithecus force-pushed the andrew/feat/resolver/wire branch from a82f6c6 to 7439d21 Compare February 7, 2026 21:16
@justapithecus justapithecus merged commit 05c4968 into main Feb 7, 2026
4 checks passed
@justapithecus justapithecus deleted the andrew/feat/resolver/wire 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