Added support for the Mac and Windows operating systems!!!#4
Added support for the Mac and Windows operating systems!!!#4philocalyst wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
@philocalyst Ugh, given -6000 lines in main.rs, I take it the entire linux support was removed? 😨 The diff would have to be reduced substantially for review. Also, I haven't read through the later parts of the PR - so I'll just ask - have you managed to get integration tests running for either windows/mac? As in, using the real OS WM & message bus? For Linux that was a setup with a headless X11 & wayland and a private transient dbus
| @@ -0,0 +1,47 @@ | |||
| ## macOS Backend (NSWorkspace polling) | |||
There was a problem hiding this comment.
@philocalyst All the backends should be async push-based - no polling. Daemon wakes up on events from the windowing system.
| @@ -0,0 +1,51 @@ | |||
| ## Windows Backend (Win32 GetForegroundWindow polling) | |||
|
HAHA I forgot to stage those, I'll get to it later today
And thanks for the notes.
▰▰▰▰▰
Miles Wirth 🙃
… From: Kai ***@***.***>
Sent: 12 April 2026 09:07
To: 7mind/kanata-switcher ***@***.***>
Cc: Miles Wirht ***@***.***>, Mention ***@***.***>
Subject: Re: [7mind/kanata-switcher] Added support for the Mac and Windows operating systems!!! (PR #4)
@neko-kai commented on this pull request.
@philocalyst Ugh, given -6000 lines in main.rs, I take it the entire linux support was removed? 😨 The diff would have to be reduced substantially for review. Also, I haven't read through the later parts of the PR - so I'll just ask - have you managed to get integration tests running for either windows/mac? As in, using the real OS WM & message bus? For Linux that was a setup with a headless X11 & wayland and a private transient dbus
> @@ -0,0 +1,47 @@
+## macOS Backend (NSWorkspace polling)
@philocalyst All the backends should be async push-based - no polling. Daemon wakes up on events from the windowing system.
> @@ -0,0 +1,51 @@
+## Windows Backend (Win32 GetForegroundWindow polling)
Same here
--
Reply to this email directly or view it on GitHub:
#4 (review)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
| - [ ] `class` field matches macOS bundle IDs (e.g., `com.apple.Safari`) | ||
| - [ ] Case-insensitive matching works (e.g., `com.apple.safari` matches Safari) | ||
| - [ ] Partial regex matches work (e.g., `com.apple` matches all Apple apps) | ||
| - [ ] Non-matching apps leave the current layer unchanged |
There was a problem hiding this comment.
@philocalyst Not correct: non-matching apps should switch back to default layer, as with linux & windows below. Ideally that should have been caught by unit tests - perhaps the matching logic was duplicated instead of being shared between modules - and tested?
| @@ -0,0 +1,159 @@ | |||
| //! macOS backend for kanata-switcher. | |||
| //! | |||
| //! Uses `NSWorkspaceDidActivateApplicationNotification` to receive push-based | |||
| @@ -0,0 +1,257 @@ | |||
| //! Windows backend for kanata-switcher. | |||
There was a problem hiding this comment.
@philocalyst Both windows and macos implementations are quite small. I wonder if anything could be done to reduce the diff from its current +8000 -6000, not very reviewable, state.
There was a problem hiding this comment.
Frankly this is a problem of the codebase's single-file attitude, if we had moved to a trait system with file scoping the diff would literally be sub 500
There was a problem hiding this comment.
@philocalyst Fair enough! One way to deal with that would be if you could create a separate PR that just performs the refactoring to traits without changing logic - I could review that with difft and the IDE despite the high line count. Then after that is merged this PR would have a workable sub-500 diff.
There was a problem hiding this comment.
You know what! I will do that!! You win lol
You'll have to test though, unless you could setup PR CI?
There was a problem hiding this comment.
@philocalyst CI should work now as long as the branch includes latest commit 72ff404
There was a problem hiding this comment.
@philocalyst Hey, I've attempted to perform that refactor in #5 – I wonder whether the structure in that PR is close to what you had in mind
There was a problem hiding this comment.
@philocalyst The main refactor to traits + test split has been merged into persistent-daemon branch. (The tests have been split by desktop backend, but not by platform - but windows/mac only have one focus backend each, so perhaps they could be regarded as backends first for that purpose)
e240fd8 to
0014405
Compare
|
@neko-kai Now good I think!?!! |
|
@philocalyst Much better, but... there are no new integration tests. Are there are any in kanata-vk-agent or window_tools? I suspect some amount of automated testing is possible for macOS and Windows too |
0014405 to
74a9e41
Compare
|
Added the integration tests! @neko-kai |
So happy to get this done! Matches the original code from kanata-vk-agent for mac, and window_tools for the windows backend. Includes tests and qa. Very much slop, but functioning slop!