-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Code Quality: Removed old address bar code #17286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 removes legacy address bar and search functionality to simplify the codebase by eliminating the old dual-mode address bar system in favor of the newer Omnibar design. The changes comprehensively remove deprecated search box components, path breadcrumb controls, and their associated view models while cleaning up related UI states and settings.
- Removes entire legacy search box and path breadcrumb implementation
- Eliminates dual-mode address bar system (legacy vs Omnibar) in favor of Omnibar-only approach
- Cleans up obsolete settings, event handlers, and UI state management code
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
ModernShellPage.xaml.cs | Removes search box state management and toolbar edit mode checks |
ColumnShellPage.xaml.cs | Removes search box state management and toolbar edit mode checks |
BaseShellPage.cs | Removes search box event handlers and edit mode functionality |
AdvancedPage.xaml | Removes Omnibar enable/disable toggle setting |
MainPage.xaml.cs | Updates control reference from PathBreadcrumb to Omnibar |
MainPage.xaml | Removes search box visibility controls and adaptive triggers |
Layout pages | Removes edit mode checks from keyboard event handlers |
SearchBoxViewModel.cs | Deletes entire obsolete search box view model |
NavigationToolbarViewModel.cs | Removes legacy search and edit mode properties and methods |
UserControls | Deletes SearchBox and PathBreadcrumb controls entirely |
Settings/Actions | Removes search box related properties and edit mode checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts my earlier fix for a different bug
When using Command mode, switching tabs and then switching back reopens the Omnibar flyout
@@ -216,7 +216,7 @@ private async Task OnPreviewKeyDownAsync(KeyRoutedEventArgs e) | |||
// Execute command for hotkey | |||
var command = Commands[hotKey]; | |||
|
|||
if (command.Code is CommandCodes.OpenItem && source?.FindAscendantOrSelf<PathBreadcrumb>() is not null) | |||
if (command.Code is CommandCodes.OpenItem && (source?.FindAscendantOrSelf<Omnibar>() is not null || source?.FindAscendantOrSelf<AppBarButton>() is not null)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the following issue
If a file is selected, focusing on Command mode button via tab navigation and pressing enter opens the selected file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0x5bfa fyi
@@ -143,7 +137,7 @@ private async void KeyboardAccelerator_Invoked(KeyboardAccelerator sender, Keybo | |||
{ | |||
// Ctrl + V, Paste | |||
case (true, false, false, true, VirtualKey.V): | |||
if (!ToolbarViewModel.IsEditModeEnabled && !ContentPage.IsRenamingItem && !InstanceViewModel.IsPageTypeSearchResults && !ToolbarViewModel.SearchHasFocus) | |||
if (!ContentPage.IsRenamingItem && !InstanceViewModel.IsPageTypeSearchResults) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -137,9 +137,6 @@ public bool IsCurrentInstance | |||
{ | |||
_IsCurrentInstance = value; | |||
|
|||
if (!value && SlimContentPage is not ColumnsLayoutPage) | |||
ToolbarViewModel.IsEditModeEnabled = false; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can force close the Omnibar? This would allow us to solve the issue where its sometimes open after switching tabs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now, theres no method for it. But it looks like we should create one:
// @Omnibar.cs
public void UnfocusOmnibar()
{
RevertTextToUserInput();
_textBoxSuggestionsPopup.IsOpen = false;
_previouslyFocusedElement.TryGetTarget(out var previouslyFocusedElement);
previouslyFocusedElement?.Focus(FocusState.Programmatic);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code wise.
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.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.