Skip to content

Add clear (x) button to title bar search box#5185

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
feature/searchbox-clear-button
Jul 23, 2026
Merged

Add clear (x) button to title bar search box#5185
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
feature/searchbox-clear-button

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the search box in MainWindow by adding a clear ("✕") button, making it easier for users to clear their search input. The button only appears when there is text in the search box, and clicking it clears the input and refocuses the search box. The padding of the search box was also adjusted to accommodate the new button.

Search box usability improvements:

  • Added a clear ("✕") button (ClearSearchButton) to the search box in MainWindow.axaml, which appears only when the search box contains text and allows users to quickly clear the input.
  • Implemented the ClearSearchBox_Click event handler in MainWindow.axaml.cs to clear the search text and refocus the search box when the clear button is clicked.
  • Increased the right padding of the search box to ensure space for the clear button and prevent text overlap.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a title-bar search clear button that appears when text is present.

Changes:

  • Adds an overlaid clear button and adjusts search-box padding.
  • Clears and refocuses the search box when clicked.
  • Adds localized tooltip and accessibility labels, though the translation key is missing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/UniGetUI.Avalonia/Views/MainWindow.axaml Adds and styles the clear button.
src/UniGetUI.Avalonia/Views/MainWindow.axaml.cs Implements clear-and-refocus behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/UniGetUI.Avalonia/Views/MainWindow.axaml
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit d9fcef6 into main Jul 23, 2026
6 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the feature/searchbox-clear-button branch July 23, 2026 20:36
@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jul 23, 2026 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[IMPROVEMENT] (Enter your description here)

3 participants