Repository navigation
feat(macos): Expose the adapter's activation state - #827
Open
William-Selna wants to merge 2 commits into
Open
William-Selna wants to merge 2 commits into
William-Selna wants to merge 2 commits into
Conversation
`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
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.
update_if_activehandles every activation phase but gives the host no way to learn which phase it is in. A host whoserequest_initial_treereturnsNonehas 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 onSubclassingAdapter) returningInactive,PlaceholderorActive; 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.