Skip to content

Refactor search bars + improve search accessibility#1608

Draft
zoeyAhmed wants to merge 7 commits into
bazaar-org:mainfrom
zoeyAhmed:fix-search-accessibility
Draft

Refactor search bars + improve search accessibility#1608
zoeyAhmed wants to merge 7 commits into
bazaar-org:mainfrom
zoeyAhmed:fix-search-accessibility

Conversation

@zoeyAhmed

@zoeyAhmed zoeyAhmed commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

  • The search bars did not read out their placeholder text when focused, and not containing any text
  • Ctrl+F focused the last widget and not the search bar when the search page is presented
  • Bazaar did not read out the number of search results to the screen reader.

Before:

Bazaar-before-search-tweaks.mp4

After:

Bazaar-after-search-tweaks.mp4

zoeyAhmed added 7 commits June 9, 2026 19:09
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
@zoeyAhmed zoeyAhmed force-pushed the fix-search-accessibility branch from f872110 to 6390721 Compare June 9, 2026 18:09
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