Replace osascript polling with direct AX API for Zoom mute detection#3709
Merged
Replace osascript polling with direct AX API for Zoom mute detection#3709
Conversation
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
✅ Deploy Preview for hyprnote canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
…_title Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
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.
Replace osascript with direct AX API for Zoom mute detection
Summary
Replaces the
osascript/AppleScript-based Zoom mute state detection with direct macOS Accessibility API calls viacidre'saxmodule. Instead of spawning an externalosascriptprocess every polling cycle, the new implementation:ns::RunningApp::with_bundle_id()This eliminates per-poll process spawning overhead and removes the
std::process::Commanddependency from this module.Motivated by discussion in yury/cidre#38 about using cidre's accessibility API bindings.
Updates since last revision
unsafe { std::mem::transmute(&*value) }inax_element_titlewith cidre's safevalue.try_as_string()?method, eliminating theunsafeblock entirely. This addresses the Graphite review comment about potential UB if the AX API returned a non-CFStringtype.cfimport.Review & Testing Checklist for Human
test_check_zoom_mute_stateignored test with Zoom open."Mute audio"/"Unmute audio"(lowercase). New code also matches"Mute Audio"/"Unmute Audio". Verify which casing Zoom actually uses to confirm the old strings are still needed.None) when accessibility permissions are not granted, matching the previous behavior.Notes
WatcherState,is_zoom_using_mic()gate,Observertrait impl) is unchanged — only thecheck_zoom_mute_state()internals were replaced.cidredependency now explicitly requests the"ax"feature (previously relied on default"full"features).cf::Type::try_as_string(), which safely returnsNoneif the value is not aCFString.Requested by: @yujonglee
Link to Devin run