Skip to content

fix(focus): prime the Claude desktop app's Electron accessibility tree (#861) - #882

Open
Shen-Yukang wants to merge 1 commit into
FuJacob:mainfrom
Shen-Yukang:fix/822-claude-desktop-priming
Open

Shen-Yukang wants to merge 1 commit into
FuJacob:mainfrom
Shen-Yukang:fix/822-claude-desktop-priming

Conversation

@Shen-Yukang

@Shen-Yukang Shen-Yukang commented Oct 29, 2026 •

Copy link
Copy Markdown

Summary

The Claude desktop app (com.anthropic.claudefordesktop) is a stock Electron app (Electron 44 / Chromium 152 as of Claude 4.29). Its composer stays hidden from Accessibility until a client sets AXManualAccessibility on the app. ChromiumAccessibilityEnabler only sets that flag for bundles on BrowserAppDetector's Electron editor allowlist, and Claude wasn't on it, so no focused field ever resolved there. This adds Claude to the allowlist: the same fix Obsidian got in #825.

Validation

  • xcodebuild test -workspace build/cotabby-dependencies/Cotabby.xcworkspace -scheme Cotabby -destination 'platform=macOS' -derivedDataPath build/DerivedData -only-testing:CotabbyTests/BrowserAppDetectorTests CODE_SIGNING_ALLOWED=NO (Xcode 27.1): ** TEST SUCCEEDED **, 7 tests, 0 failures.
  • A/B test on macOS 26.6.2 with Claude 4.29.0, each run on a freshly started Claude process (the flag stays set for the life of the process, so a Claude that any build had already primed would hide the bug):
    • Release 0.6.2-beta alone: no suggestions in the Claude composer.
    • Cotabby Dev from this branch (Release config, -cotabby-debug): CHROME-PRIME enabled web accessibility for Claude 2.4 s after launch, then the composer resolved as capability=Supported with caret=exact primary (text-marker). Suggestions rendered, and three Tab presses each inserted suggestion text.
  • Not run: swiftlint --strict (not installed locally).

Linked issues

Fixes #861. That report covered Obsidian and Claude desktop; Obsidian was fixed in #825, and this covers Claude.

The branch name says 822 by mistake: #822 (Slack and Codex) is a separate issue and isn't touched here.

Risk / rollout notes

  • Matching stays exact, so Claude's renderer helpers (com.anthropic.claudefordesktop.helper) aren't primed; a test pins this.
  • As with the other allowlisted Electron apps, the flag is re-set each time Claude comes to the front: one AX write per app switch.
  • WebContentFieldDetector.isWebContentField now also returns true for Claude, which affects how far caret geometry is trusted. Claude's composer already vends DOM attributes, which made it web content before, so no change is expected there.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Claude Desktop is now recognized as an editor rather than a browser, allowing the app’s existing editor-specific focus and accessibility handling to apply. Recognition is limited to the main app; helper processes are not included.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Adds Claude desktop to the existing Electron accessibility allowlist so Cotabby can wake its composer before resolving focus.

  • Cotabby can now find Claude’s desktop composer.

Reviews (1) · Last reviewed commit: "fix(focus): prime the Claude desktop app..." · Reviewed by Greptile

FuJacob#861)

Claude desktop (com.anthropic.claudefordesktop) is a stock Electron app
(Electron 44 / Chromium 152 as of Claude 4.29). Its composers, both chat
and the Code tab, are contenteditables that only resolve once
AXManualAccessibility wakes the renderer, and ChromiumAccessibilityEnabler
only sets that flag for allowlisted bundles. Add Claude to the Electron
editor allowlist, the same fix Obsidian got in FuJacob#825.

Tests cover the new entry and keep Claude's renderer helpers
(com.anthropic.claudefordesktop.helper) out of the exact-match allowlist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1a4f0eb-e780-44ac-919d-a08db3c36b94
Commits

Reviewing files that changed from the base of the PR and between 8cdbea2 and 0177f57.

Files selected for processing: 2
  • Cotabby/Support/Focus/Applications/BrowserAppDetector.swift
  • CotabbyTests/Support/Focus/Applications/BrowserAppDetectorTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The Electron editor allowlist now recognizes Claude desktop’s exact bundle identifier. Tests verify its editor and browser classifications, exclude its helper identifier, and check that it requires web accessibility priming.

Changes: Claude Desktop Detection

Layer / File(s) Summary
Allowlist and detection tests
Cotabby/Support/Focus/Applications/BrowserAppDetector.swift, CotabbyTests/Support/Focus/Applications/BrowserAppDetectorTests.swift
The allowlist adds Claude desktop’s exact bundle identifier. Tests verify that it is an Electron editor, not a browser, requires web accessibility priming, and that its helper identifier is excluded.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~7 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: fujacob

Merge Risk: Minimal · up to 0177f

No concrete merge-blocking risk was identified in the reviewed changes.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: enabling Electron accessibility priming for Claude Desktop.
Linked Issues check Passed Issue #861 is the only active directly linked issue. Its coding requirement is that suggestions appear in the Claude desktop composer, and in Obsidian. Evidence at the reviewed head (0177f57): (1) Br…
Out of Scope Changes check Passed The supplied change set has two files. BrowserAppDetector.swift adds one allowlist entry for the Claude bundle identifier, with a comment that explains it. BrowserAppDetectorTests.swift adds assertion…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #861 is the only active directly linked issue. Its coding requirement is that suggestions appear in the Claude desktop composer, and in Obsidian. Evidence at the reviewed head (0177f57): (1) BrowserAppDetector.swift adds "com.anthropic.claudefordesktop" to electronEditorBundleIdentifiers. isElectronEditor lowercases the input and checks exact set membership. needsWebAccessibilityPriming includes isElectronEditor, so Claude now passes the priming gate. (2) BrowserAppDetectorTests asserts that the Claude bundle is an Electron editor, is not a browser, and needs priming. It also asserts that the .helper bundle is excluded. (3) Obsidian (md.obsidian) is already allowlisted at head, so the Obsidian part of #861 is covered by existing code. The runtime result (composer resolves as Supported and Tab inserts suggestions) comes from the author's A/B test and xcodebuild run in the PR description. I did not reproduce those runs. The link from the predicate to ChromiumAccessibilityEnabler is taken from the PR summary and code comments, not from a file read. Repository diffs were unavailable, so the base-to-head change set comes from the supplied summary.

Full details: Out of Scope Changes check

Explanation

The supplied change set has two files. BrowserAppDetector.swift adds one allowlist entry for the Claude bundle identifier, with a comment that explains it. BrowserAppDetectorTests.swift adds assertions for the Claude bundle and its helper. Both changes directly implement the Claude part of #861. The PR description says WebContentFieldDetector.isWebContentField also returns true for Claude. That result follows from the allowlist entry. The supplied summary lists no edit to WebContentFieldDetector. The branch name mentions #822, but no code in the change set touches #822 work. The Obsidian reference in the code comment cites #791, while the PR description cites #825. This is a documentation mismatch, not an out-of-scope change. Repository diffs were unavailable, so this verdict depends on the supplied file list.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@7hdmm9pp2w-code 7hdmm9pp2w-code left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minimal and correct. The match is exact, so .helper processes stay out, and the test pins that. One heads-up for whoever merges #867 as well: the Claude composer grows as you type, which is exactly the case where #867's bottom-edge floor would cut wrapped ghost rows.


Context: I built main with #885, #882, #879, #883, #866 and #867 merged on top (no conflicts) and ran the full test suite the way tests.yml does. All tests touched by these PRs pass. The only two failures also fail on plain main (locale-dependent, see #891). These reviews are based on reading the code; I have not tested the UI by hand.

@7hdmm9pp2w-code

Copy link
Copy Markdown

Field report: I've been running this on top of current main (together with #875, #853 and #892) in daily use. Suggestions now appear in the Claude desktop app's composer as expected. No side effects noticed in other apps.

7hdmm9pp2w-code added a commit to 7hdmm9pp2w-code/cotabby that referenced this pull request Nov 19, 2026
Two review findings on the opt-in Tab Moves to Next Field setting:

- Claude's desktop composer can report AXTextField, and the Claude bundle
  is not in BrowserAppDetector's Electron editor list on main yet (FuJacob#882).
  Name it explicitly so Tab keeps accepting there regardless of FuJacob#882.
- With Accept Entire Suggestion on a double tap of Tab, handing the first
  Tab to the host left no second press, so nothing could accept the whole
  suggestion in a form field. The press now keeps accepting while the
  double tap applies, and the setting is disabled with an explanation in
  that configuration. The description no longer claims full acceptance
  works everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

[Bug] [Bug] No suggestions in Electron apps (Obsidian, Claude desktop); native apps work

2 participants