Skip to content

Comments

CmdPal: Fix search box text selection in ShellPage.GoHome#42937

Merged
michaeljolley merged 1 commit intomicrosoft:mainfrom
jiripolasek:feature/42443-cmdpal-fix-focus-on-activate-when-home
Oct 26, 2025
Merged

CmdPal: Fix search box text selection in ShellPage.GoHome#42937
michaeljolley merged 1 commit intomicrosoft:mainfrom
jiripolasek:feature/42443-cmdpal-fix-focus-on-activate-when-home

Conversation

@jiripolasek
Copy link
Collaborator

@jiripolasek jiripolasek commented Oct 25, 2025

Summary of the Pull Request

This PR fixes an issue where ShellPage.GoHome wouldn’t select the search box text when the current page was already the home page.

In that case, the navigation stack was empty, and no code was executed because focusing the text had been delegated to the GoBack operation.

Change log one-liner

Ensured search text is selected when Go home when activated and Highlight search on activate are both enabled.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Fixes an issue where GoHome wouldn’t select the search box text if the current page was already the home page. In this case, the navigation stack is empty, and no code is executed because focusing the text was previously delegated to the “navigate back” operation.
@jiripolasek jiripolasek added the Product-Command Palette Refers to the Command Palette utility label Oct 25, 2025
@michaeljolley michaeljolley merged commit e256e79 into microsoft:main Oct 26, 2025
10 checks passed
@jiripolasek
Copy link
Collaborator Author

jiripolasek commented Oct 26, 2025

image

vanzue pushed a commit that referenced this pull request Oct 27, 2025
## Summary of the Pull Request

This PR fixes an issue where `ShellPage.GoHome` wouldn’t select the
search box text when the current page was already the home page.

In that case, the navigation stack was empty, and no code was executed
because focusing the text had been delegated to the `GoBack` operation.

## Change log one-liner

Ensured search text is selected when Go home when activated and
Highlight search on activate are both enabled.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42443
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** Added on the required places
- [x] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
@yeelam-gordon yeelam-gordon requested a review from Copilot November 7, 2025 01:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the focus behavior in the GoHome navigation method to improve performance by deferring focus operations until all back-navigation steps complete, rather than focusing the search box on each intermediate step.

Key changes:

  • Modified GoHome to pass focusSearch: false to GoBack during the navigation loop
  • Added explicit search box focus logic after the navigation loop completes
  • Ensures focus is set even when already at home (no navigation needed)

@yeelam-gordon yeelam-gordon added this to the PowerToys 0.96 milestone Nov 11, 2025
@jiripolasek jiripolasek deleted the feature/42443-cmdpal-fix-focus-on-activate-when-home branch December 2, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[command palette] Go home when activated and highlight selection on activate settings not working

3 participants