Refactor search bars + improve search accessibility#1608
Draft
zoeyAhmed wants to merge 7 commits into
Draft
Conversation
This widget is similar to GtkSearchEntry, but with 2 extra properties to provide a spinner and end widget, which the bar in the search page needs, and only providing a signal for search changed, rather then search started/end. BzSearchBar implements GtkEditable and GtkAccessible, to provide accessible semantics for the top level widget, by overriding `Gtk.Accessible.get_platform_state ()` to return the platform state of the GtkText contained within. This fixes an issue with Bazaar's search bars not announcing the placeholder text if they are currently empty.
Since we are using a BoxLayout in BzSearchBar with spacing 8, the extra padding is not necessary anymore
Override `GtkWidgetClass.grab_focus`, and use that to grab focus in `ensure_active` to grab focus on the search bar immediately, even when no text has been entered. This is desirable to the previous behaviour so the screen reader will always read out the placeholder text of the search bar, instead of focusing on the previously foucsed widget, which may not be the search bar and will just read out its tooltip
f872110 to
6390721
Compare
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.
Draft because theres an issue with focusing the search bar causing it to somehow draw focus rings around both the end-child and the search bar when focusing into the search bar,
and I need to run clang-format again.This MR fixes quite a few of the issues I found with both keyboard navigation + screen readers I found within Bazaar
Before:
Bazaar-before-search-tweaks.mp4
After:
Bazaar-after-search-tweaks.mp4