fix(lock): detect Spotlight hosted by Siri AI on macOS 27 - #64
Conversation
On macOS 27 the Cmd-Space panel is drawn by the Siri AI process (`com.apple.campo`) and the `Spotlight` process never runs, so `FloatingAppMonitor` had no launcher process to observe and a Spotlight rule silently did nothing, whether Lock to or Switch to. Observe that host as well, and let `LauncherOverlayCatalog.ruleIdentity` map a focused host that is not the frontmost app to `com.apple.Spotlight`, so existing rules, backups and the picker entry keep working, while a frontmost host (Siri's regular chat window) keeps its own identity and can carry a rule of its own. The watched notifications gain `AXWindowResized` and `AXApplicationDeactivated`: the dismissed panel is only destroyed after its fade-out, about 0.7 s after focus has already returned to the app behind it, and the host's chat window deactivating must clear the stale attribution or the next panel over another app would be de-duplicated away. Such a re-read can also land after the frontmost change already cleared the attribution, so a same-value launcher report is now a no-op in `LockEngine` instead of resetting the address-bar focus. Finally, the app picker offers Spotlight even when its process is not running, since _/System/Library/CoreServices_ is never scanned and the running-apps pass was the only way it ever got listed. Closes #63 Signed-off-by: Kevin Cui <bh@bugs.cc>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. Summary by CodeRabbit
WalkthroughThe launcher catalog now recognizes Spotlight and the macOS 27 Siri AI host, mapping non-frontmost Siri-hosted panels to Spotlight rules while preserving Siri identity for frontmost Siri windows. Installed launcher overlays appear in the app picker even when they are not running. Focus monitoring now re-evaluates after window resize and application deactivation. LockEngine avoids duplicate launcher transitions. Tests cover discovery, rule resolution, focus retention, and hosted Spotlight behavior. Documentation records the updated design. Sequence Diagram(s)sequenceDiagram
participant User
participant FloatingAppMonitor
participant LockEngine
participant LauncherOverlayCatalog
User->>FloatingAppMonitor: Open Spotlight panel
FloatingAppMonitor->>LockEngine: Report Siri AI host focus
LockEngine->>LauncherOverlayCatalog: Resolve launcher rule identity
LauncherOverlayCatalog-->>LockEngine: Return Spotlight identity
LockEngine-->>User: Apply Spotlight rule
FloatingAppMonitor->>LockEngine: Report resize or deactivation
LockEngine-->>User: Re-evaluate focused element
Merge Risk: ⚪ Minimal · up to This change adds macOS 27 Siri-hosted Spotlight detection while preserving existing Siri behavior and adds focused coverage for the new mapping and safeguards. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
Comment |
On macOS 27 the Cmd-Space panel is drawn by the Siri AI process (
com.apple.campo, shown as "Siri") and theSpotlightprocess never runs, soFloatingAppMonitorhad nothing to observe and a Spotlight rule silently did nothing, whether Lock to or Switch to. The rule identity stayscom.apple.Spotlight: the monitor now also observes the host, andLauncherOverlayCatalog.ruleIdentitymaps a focused host that is not the frontmost app to Spotlight, while a frontmost host (Siri's regular chat window) keeps its own identity so a Siri rule can coexist.Two more AX notifications drive the re-read:
AXWindowResized, because the dismissed panel is only destroyed after its fade-out, about 0.7 s after focus has already returned to the app behind it, andAXApplicationDeactivated, so the chat window losing focus clears the attribution instead of the next panel being de-duplicated away. A same-value launcher report is now a no-op inLockEngine, since such a late re-read used to reset the address-bar focus, and the picker offers Spotlight even when it is not running ( /System/Library/CoreServices is never scanned).On macOS 26 and earlier nothing changes beyond the extra de-duplicated focus reads:
Spotlightkeeps running, every non-host launcher resolves as itself, and the catalog host has no process. Verified on macOS 27.0 (26A5421a) with the real app: Cmd-Space switches to the rule's source in about 170 ms and the log attributes it tocom.apple.Spotlightwith reasonlauncherFocused, Escape reverts in about 70 ms, and the Siri chat window never hits the Spotlight rule. New engine, catalog and scanner tests cover the mapping, the guard and the picker entry.Closes #63