Repository navigation
fix(focus): prime Obsidian's Electron accessibility tree so suggestions work (#791) - #825
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughBrowser detection now recognizes Obsidian as an Electron editor. Obsidian activates web accessibility priming, and tests cover case-insensitive bundle matching, priming, and web-content classification. ChangesObsidian Electron support
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Obsidian is now recognized as an Electron editor so its accessibility tree is primed and suggestions can operate in its editor. The targeted behavior and regression coverage are in place, with no remaining merge-readiness risk identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…Jacob#791) Obsidian (md.obsidian) was missing from BrowserAppDetector's Electron-editor allowlist, so Cotabby never set AXManualAccessibility on it and its CodeMirror editor stayed invisible to the focus tracker ("No focused Accessibility element"). A read-only AX probe of Obsidian 1.12.7 / Electron 39 confirmed the app element advertises the attribute. Same shape as the VS Code fix (FuJacob#671). Tests: BrowserAppDetectorTests and WebContentFieldDetectorTests gained md.obsidian cases (red before, green after); full suite 1785 passed / 6 skipped / 0 failed.
1a738a9 to
853eef4
Compare
FuJacob
left a comment
There was a problem hiding this comment.
Reviewed: narrow, correct extension of the Electron-editor priming allowlist; merges cleanly with main's com.openai.codex entry, targeted tests pass. Thanks for the thorough AX probe evidence.
…anchor Brings in FuJacob/cotabby through 7724926 (FuJacob#825, FuJacob#827, FuJacob#834, FuJacob#835, FuJacob#836, FuJacob#837, FuJacob#838): ghost text matched to the host's own rendering plus finishing the word being typed, Obsidian/Electron accessibility priming, rapid Tab accepts kept owned while the overlay presents, Apple Intelligence greyed out when unavailable, a new llama-recall eval fixture, the installer artwork and kickstart script, and a CI test-flakiness fix. Resolution, where both sides changed the same thing: - Suppression reasons: upstream's `CompletionContentPolicy` rejects any completion without a letter or digit (`noWordContent`), which subsumes this fork's `periodOnly`, so that case and its helper are removed and the bare-dot test now asserts the broader reason. Behaviour change worth knowing: a lone closing bracket or question mark is now withheld too, where this fork deliberately let those through; its test records that. - Prompt renderer: upstream's `personaLine(_:prefix:)` (the name only appears at a sign-off) wins; this fork's learned-phrases section is unchanged beside it. - Eval case schema: upstream added `visualContextSummary` and `clipboardContext` for its recall fixture; this fork's `screenText` and `learnedPhrases` stay alongside them. The harness prefers the pre-rendered summary and still puts raw `screenText` through the live local passes. Both scorer helpers kept. - Kept from this fork: the separate test host, the 2-4 word eval preset, phrase memory, the clock-time rule, the debug-artifact gate. Full suite: 2,724 tests, 16 skipped, 0 failures; the installed app's defaults byte-identical afterwards and no debug artifacts written. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary
Obsidian (
md.obsidian) was missing fromBrowserAppDetector.electronEditorBundleIdentifiers, so Cotabby never setAXManualAccessibilityon it. Electron builds its accessibility tree lazily; without that switch Obsidian's window exposes a single bareAXGroup, the system-wide focused-element query returns nil, and the focus tracker logs "No focused Accessibility element" on every tick. Adding the bundle id to the allowlist turns on the same priming, app-scoped focus fallback, descendant search and web-content caret handling that fixed VS Code in #671.Evidence: a read-only AX probe of Obsidian 1.12.7 (Electron 39.8.3 / Chromium 142) shows the application element advertising
AXManualAccessibility(settable, value 0) andAXEnhancedUserInterface, with the focused window holding oneAXGroupand three buttons, i.e. the dormant renderer view. Obsidian worked in 0.3.3 (#276) and broke in 0.6.0 when the Electron allowlist gate was introduced.Validation
BrowserAppDetectorTests,WebContentFieldDetectorTests) failed before the one-line allowlist change and pass after it.xcodebuild buildof theCotabby Devscheme: succeeded (3 pre-existing warnings, 0 errors).swiftlint lint --config .swiftlint.yml --quiet(SwiftLint 0.65.1): exit 0, no warnings on the changed files; repo-wide count unchanged versusmain(0 → 0).-cotabby-debug) and Obsidian frontmost, the log showsCHROME-PRIME enabled web accessibility for Obsidian, thenCHROME-FOCUS-PROBE resolved via hit-test for Obsidian, thenFocus snapshot changed: app=Obsidian capability=Supportedwithcaret=derived(andexact) on every resolve, i.e. the inline ghost-text path, not the popup fallback. Ghost text appears in the editor and can be accepted. Onmainthe same session logs onlyNo focused Accessibility elementfor Obsidian.Linked issues
Fixes #791
Refs #616 (ghost-text placement inside Obsidian is a separate geometry problem and is not addressed here)
Refs #626, #671
Risk / rollout notes
md.obsidian: Cotabby now setsAXManualAccessibilityon Obsidian's application element, exactly as it already does for Chromium browsers, ClickUp and VS Code. No settings, schema or pbxproj changes.md.obsidian) are covered; matching is case-insensitive and exact, so no othermd.*app is affected..estimated; that is the existingCompletionRenderModePolicybehaviour and is left for a follow-up.Summary by CodeRabbit
Bug Fixes
Tests
Greptile Summary
Adds Obsidian to the existing Electron-editor allowlist so Cotabby primes its dormant web accessibility tree and can resolve its CodeMirror editing surface.
md.obsidiancase-insensitively as a covered Electron editor.Confidence Score: 5/5
The PR appears safe to merge, with no outstanding or newly introduced actionable issues.
The current diff narrowly extends an existing Electron recovery path to Obsidian and adds aligned tests; there have been no changes since the previous review and no repository-rule violations remain.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(focus): prime Obsidian's Electron AX..." | Re-trigger Greptile
Context used: