Skip to content

Replace focus polling with AXObserver tracking#76

Merged
FuJacob merged 1 commit into
mainfrom
codex/axobserver-focus-tracking
Apr 29, 2026
Merged

Replace focus polling with AXObserver tracking#76
FuJacob merged 1 commit into
mainfrom
codex/axobserver-focus-tracking

Conversation

@FuJacob

@FuJacob FuJacob commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the timer-based focus polling path with process-scoped AXObserver notifications for focus/window changes, value/selection changes, element destruction, and app deactivation.
  • Publishes raw AXObserver hit events through the focus model and flashes a short debug-overlay pulse so we can see when observer callbacks actually fire.
  • Removes pollInterval wiring from the app environment and updates focus docs/comments around the event-driven model.

Validation

xcodebuild test -scheme tabby -project tabby.xcodeproj -destination 'platform=macOS' CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
# ** TEST SUCCEEDED **
# Executed 61 tests, with 0 failures (0 unexpected)

Note: the test process still printed the existing llama.cpp/ggml Metal teardown GGML_ASSERT([rsets->data count] == 0) after XCTest reported success; xcodebuild exited 0. I did not record a live-app screen capture for the new debug pulse yet.

Linked issues

Refs #18
Refs #16

Risk / rollout notes

  • This is intentionally experimental: it removes polling entirely and does not include the fallback polling path from the full ticket acceptance criteria.
  • Apps that do not reliably emit Accessibility notifications may leave focus state stale until another activation or observer event occurs.
  • Non-deactivation AX notifications are coalesced with a 0.005s delay before reading AX state so value/selection attributes can settle.
  • Idle CPU still needs to be measured against the old polling implementation before treating this as production-ready.

@FuJacob FuJacob merged commit 7dee361 into main Apr 29, 2026
3 checks passed
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