Skip to content

feat(macos): Expose the adapter's activation state - #827

Open
William-Selna wants to merge 2 commits into
AccessKit:mainfrom
William-Selna:macos-activation-state
Open

William-Selna wants to merge 2 commits into
AccessKit:mainfrom
William-Selna:macos-activation-state

Conversation

@William-Selna

Copy link
Copy Markdown

update_if_active handles every activation phase but gives the host no way to learn which phase it is in. A host whose request_initial_tree returns None has to mirror the adapter's state machine to know when the one required full tree is due.

This adds a read-only Adapter::activation_state (also on SubclassingAdapter) returning Inactive, Placeholder or Active; the state machine is unchanged.

By exposing the adapter’s activation state, hosts that defer building their accessibility tree until an assistive technology connects can tell when the tree is needed and whether the next update must be a full tree, without tracking activation themselves.

William-Selna and others added 2 commits October 15, 2026 23:52
`Adapter::update_if_active` does the right thing in every activation
phase, but it cannot tell the host which phase that was. A host whose
`ActivationHandler::request_initial_tree` returns `None` has to mirror
the adapter's state machine in its own handler to know when the one full
tree that `update_if_active` then requires is due, and a host that
prepares its tree updates eagerly has no way to tell that nobody will
consume them yet.

`Adapter::activation_state`, also surfaced on `SubclassingAdapter`,
returns `Inactive`, `Placeholder` or `Active`. It is a read-only probe;
the state machine itself is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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.

1 participant