Skip to content

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Jul 1, 2025

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

  • For Feature: Added support for opening the breadcrumb dropdown via keyboard navigation #16092
  • Fixed "Entering text in Command mode, switching to Edit path mode, and then back to Command mode doesn't clear the original text"
  • Fixed "Pressing tab in Command mode closes flyout but doesn't switch to the next control"
  • Fixed "Switching to Path mode from Command mode isn't selecting the text"
  • Moved the logic for resetting the selected mode on LostFocus from the app into the control

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

Fixed Command Palette text when switching between modes

  1. Entered text in Command mode
  2. Switched to Edit path mode
  3. Switched back to Command mode
  4. Confirmed the text was correctly cleared

Moved the logic for resetting the selected mode on LostFocus from the app into the control

  1. Switched to Edit path mode
  2. Removed focus by clicking the file area
  3. Confirmed the Omnibar switched to Breadcrumb mode
  4. Switched to Command mode and repeated steps 2 and 3

Pressing tab in Command mode closes flyout but doesn't switch to the next control

  1. Focused on path box
  2. Pressed tab
  3. Confirmed the breadcrumb bar is selected
  4. Switched to Command mode
  5. Confirmed pressing tab selects the mode button

Switching to Path mode from Command mode isn't selecting the text

  1. Switched to Command mode
  2. Switched to Edit path mode
  3. Confirmed the text was selected

Copy link
Contributor

@Copilot 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 refactors how the command palette text and selected mode reset logic are handled by moving focus‐loss behavior into the Omnibar control and clearing the text on mode changes.

  • Clear the command palette text when entering Command Palette mode via a new ModeChanged event handler.
  • Move LostFocus logic out of NavigationToolbar into the Omnibar control to reset the selected mode internally.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Files.App/UserControls/NavigationToolbar.xaml.cs Replaced Omnibar_LostFocus handler with Omnibar_ModeChanged to clear the palette text on mode switches
src/Files.App/UserControls/NavigationToolbar.xaml Updated AutoSuggestBox binding to use ModeChanged instead of LostFocus
src/Files.App.Controls/Omnibar/Omnibar.cs Subscribes the control’s own LostFocus event to reset mode
src/Files.App.Controls/Omnibar/Omnibar.Events.cs Added Omnibar_LostFocus method to reset CurrentSelectedMode to the default on focus loss
Comments suppressed due to low confidence (2)

src/Files.App/UserControls/NavigationToolbar.xaml.cs:430

  • Please add an XML summary comment explaining when this handler is invoked and its role in clearing the command palette text.
		private void Omnibar_ModeChanged(object sender, OmnibarModeChangedEventArgs e)

src/Files.App/UserControls/NavigationToolbar.xaml.cs:432

  • Add unit or integration tests to verify that switching into Command Palette mode triggers this logic and clears the text as expected.
			// Reset the command palette text when switching modes

@yaira2 yaira2 closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant