Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 99e3a55

Browse files
authoredMay 19, 2025··
Feature: Added support for searching commands on the actions page (#17141)
1 parent 8fffbb4 commit 99e3a55

File tree

12 files changed

+174
-105
lines changed

12 files changed

+174
-105
lines changed
 

‎src/Files.App/Actions/Content/Install/InstallCertificateAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal sealed partial class InstallCertificateAction : ObservableObject, IActi
1010
private readonly IContentPageContext context;
1111

1212
public string Label
13-
=> Strings.Install.GetLocalizedResource();
13+
=> Strings.InstallCertificate.GetLocalizedResource();
1414

1515
public string Description
1616
=> Strings.InstallCertificateDescription.GetLocalizedFormatResource(context.SelectedItems.Count);

‎src/Files.App/Actions/Content/Install/InstallFontAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal sealed partial class InstallFontAction : ObservableObject, IAction
1111
private static readonly StatusCenterViewModel StatusCenterViewModel = Ioc.Default.GetRequiredService<StatusCenterViewModel>();
1212

1313
public string Label
14-
=> Strings.Install.GetLocalizedResource();
14+
=> Strings.InstallFont.GetLocalizedResource();
1515

1616
public string Description
1717
=> Strings.InstallFontDescription.GetLocalizedFormatResource(context.SelectedItems.Count);

‎src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal sealed partial class InstallInfDriverAction : ObservableObject, IAction
1010
private readonly IContentPageContext context;
1111

1212
public string Label
13-
=> Strings.Install.GetLocalizedResource();
13+
=> Strings.InstallDriver.GetLocalizedResource();
1414

1515
public string Description
1616
=> Strings.InstallInfDriverDescription.GetLocalizedFormatResource(context.SelectedItems.Count);

‎src/Files.App/Actions/FileSystem/CopyItemPathAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal sealed class CopyItemPathAction : IAction
1010
private readonly IContentPageContext context;
1111

1212
public string Label
13-
=> Strings.CopyPath.GetLocalizedResource();
13+
=> Strings.CopyItemPath.GetLocalizedResource();
1414

1515
public string Description
1616
=> Strings.CopyItemPathDescription.GetLocalizedResource();

‎src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal sealed partial class PasteItemToSelectionAction : BaseUIAction, IAction
88
private readonly IContentPageContext context;
99

1010
public string Label
11-
=> Strings.Paste.GetLocalizedResource();
11+
=> Strings.PasteToSelectedFolder.GetLocalizedResource();
1212

1313
public string Description
1414
=> Strings.PasteItemToSelectionDescription.GetLocalizedResource();

‎src/Files.App/Actions/Show/ToggleShowHiddenItemsAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal sealed partial class ToggleShowHiddenItemsAction : ObservableObject, IT
88
private readonly IFoldersSettingsService settings;
99

1010
public string Label
11-
=> Strings.ShowHiddenItems.GetLocalizedResource();
11+
=> Strings.HiddenItems.GetLocalizedResource();
1212

1313
public string Description
1414
=> Strings.ToggleShowHiddenItemsDescription.GetLocalizedResource();

‎src/Files.App/Actions/Show/ToggleToolbarAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public string Label
1111
=> Strings.ToggleToolbar.GetLocalizedResource();
1212

1313
public string Description
14-
=> Strings.ToggleToolbar.GetLocalizedResource();
14+
=> Strings.ToggleToolbarDescription.GetLocalizedResource();
1515

1616
public HotKey HotKey
1717
=> new(Keys.B, KeyModifiers.CtrlShift);

‎src/Files.App/Dialogs/SettingsDialog.xaml.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ private void UpdateDialogLayout()
5050
{
5151
ContainerGrid.Height = MainWindow.Instance.Bounds.Height <= 760 ? MainWindow.Instance.Bounds.Height - 70 : 690;
5252
ContainerGrid.Width = MainWindow.Instance.Bounds.Width <= 1100 ? MainWindow.Instance.Bounds.Width : 1100;
53-
MainSettingsNavigationView.PaneDisplayMode = MainWindow.Instance.Bounds.Width < 700 ? NavigationViewPaneDisplayMode.LeftCompact : NavigationViewPaneDisplayMode.Left;
53+
54+
var paneDisplayMode = MainWindow.Instance.Bounds.Width < 700
55+
? NavigationViewPaneDisplayMode.LeftCompact
56+
: NavigationViewPaneDisplayMode.Left;
57+
58+
if (MainSettingsNavigationView.PaneDisplayMode != paneDisplayMode)
59+
MainSettingsNavigationView.PaneDisplayMode = paneDisplayMode;
5460
}
5561

5662
private void MainSettingsNavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)

‎src/Files.App/Strings/en-US/Resources.resw

Lines changed: 71 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<data name="CopyPath" xml:space="preserve">
124124
<value>Copy path</value>
125125
</data>
126+
<data name="CopyItemPath" xml:space="preserve">
127+
<value>Copy item path</value>
128+
</data>
126129
<data name="CopyPathWithQuotes" xml:space="preserve">
127130
<value>Copy path with quotes</value>
128131
</data>
@@ -163,7 +166,7 @@
163166
<value>Skip</value>
164167
</data>
165168
<data name="SelectAll" xml:space="preserve">
166-
<value>Select All</value>
169+
<value>Select all</value>
167170
</data>
168171
<data name="InvertSelection" xml:space="preserve">
169172
<value>Invert selection</value>
@@ -214,7 +217,7 @@
214217
<value>Show hidden files and folders</value>
215218
</data>
216219
<data name="ShowDotFiles" xml:space="preserve">
217-
<value>Show dot files</value>
220+
<value>Dot files</value>
218221
</data>
219222
<data name="Appearance" xml:space="preserve">
220223
<value>Appearance</value>
@@ -1089,7 +1092,10 @@
10891092
<value>Toggle the info pane to view the detail/preview panes</value>
10901093
</data>
10911094
<data name="ToggleToolbar" xml:space="preserve">
1092-
<value>Toggle the Toolbar</value>
1095+
<value>Toggle toolbar</value>
1096+
</data>
1097+
<data name="ToggleToolbarDescription" xml:space="preserve">
1098+
<value>Toggle visibility of the toolbar</value>
10931099
</data>
10941100
<data name="DetailsPanePreviewNotAvaliableText" xml:space="preserve">
10951101
<value>No preview available</value>
@@ -1392,7 +1398,7 @@
13921398
<value>{0} items</value>
13931399
</data>
13941400
<data name="ReopenClosedTab" xml:space="preserve">
1395-
<value>Reopen closed tab</value>
1401+
<value>Reopen tab</value>
13961402
</data>
13971403
<data name="Rename" xml:space="preserve">
13981404
<value>Rename</value>
@@ -1599,7 +1605,7 @@
15991605
<value>Replace all child object permissions entries with inheritable permission entries from this object</value>
16001606
</data>
16011607
<data name="CloseActivePane" xml:space="preserve">
1602-
<value>Close active pane</value>
1608+
<value>Close pane</value>
16031609
</data>
16041610
<data name="EnterCompactOverlay" xml:space="preserve">
16051611
<value>Enter compact overlay</value>
@@ -2289,10 +2295,7 @@
22892295
<value>Context menu options</value>
22902296
</data>
22912297
<data name="ShowFileExtensions" xml:space="preserve">
2292-
<value>Show file extensions</value>
2293-
</data>
2294-
<data name="ShowHiddenItems" xml:space="preserve">
2295-
<value>Show hidden items</value>
2298+
<value>File extensions</value>
22962299
</data>
22972300
<data name="FormatDriveText" xml:space="preserve">
22982301
<value>Format</value>
@@ -2301,13 +2304,13 @@
23012304
<value>Help</value>
23022305
</data>
23032306
<data name="FullScreen" xml:space="preserve">
2304-
<value>Toggle full screen</value>
2307+
<value>Full screen</value>
23052308
</data>
23062309
<data name="ConfirmDeleteTag" xml:space="preserve">
23072310
<value>Are you sure you want to delete this tag?</value>
23082311
</data>
23092312
<data name="PlayAll" xml:space="preserve">
2310-
<value>Play all</value>
2313+
<value>Play</value>
23112314
</data>
23122315
<data name="Height" xml:space="preserve">
23132316
<value>Height</value>
@@ -2367,7 +2370,7 @@
23672370
<value>Increase size</value>
23682371
</data>
23692372
<data name="ToggleSortDirection" xml:space="preserve">
2370-
<value>Toggle sort direction</value>
2373+
<value>Sort direction</value>
23712374
</data>
23722375
<data name="InvalidTagNameWarning" xml:space="preserve">
23732376
<value>Invalid name</value>
@@ -2379,37 +2382,37 @@
23792382
<value>Videos</value>
23802383
</data>
23812384
<data name="LaunchPreviewPopup" xml:space="preserve">
2382-
<value>Launch preview popup</value>
2385+
<value>Preview popup</value>
23832386
</data>
23842387
<data name="ToggleCompactOverlay" xml:space="preserve">
23852388
<value>Toggle compact overlay</value>
23862389
</data>
23872390
<data name="OpenHelpDescription" xml:space="preserve">
2388-
<value>Open online help page in browser</value>
2391+
<value>Open the online help page in your browser</value>
23892392
</data>
23902393
<data name="ToggleFullScreenDescription" xml:space="preserve">
2391-
<value>Toggle full screen</value>
2394+
<value>Toggle full screen mode</value>
23922395
</data>
23932396
<data name="EnterCompactOverlayDescription" xml:space="preserve">
2394-
<value>Enter compact overlay</value>
2397+
<value>Enter compact overlay mode</value>
23952398
</data>
23962399
<data name="ExitCompactOverlayDescription" xml:space="preserve">
2397-
<value>Exit compact overlay</value>
2400+
<value>Exit compact overlay mode</value>
23982401
</data>
23992402
<data name="ToggleCompactOverlayDescription" xml:space="preserve">
2400-
<value>Toggle compact overlay</value>
2403+
<value>Toggle compact overlay mode</value>
24012404
</data>
24022405
<data name="SearchDescription" xml:space="preserve">
2403-
<value>Go to search box</value>
2406+
<value>Start search in the OmniBar</value>
24042407
</data>
24052408
<data name="ToggleShowHiddenItemsDescription" xml:space="preserve">
2406-
<value>Toggle whether to show hidden items</value>
2409+
<value>Toggle visibility of hidden items</value>
24072410
</data>
24082411
<data name="ToggleDotFilesSettingDescription" xml:space="preserve">
2409-
<value>Toggle whether to show dot files</value>
2412+
<value>Toggle visibility of dot files</value>
24102413
</data>
24112414
<data name="ToggleShowFileExtensionsDescription" xml:space="preserve">
2412-
<value>Toggle whether to show file extensions</value>
2415+
<value>Toggle visibility of file extensions</value>
24132416
</data>
24142417
<data name="TogglePreviewPaneDescription" xml:space="preserve">
24152418
<value>Toggle the preview pane to view file previews</value>
@@ -2418,7 +2421,7 @@
24182421
<value>Toggle whether to show sidebar</value>
24192422
</data>
24202423
<data name="CopyItemDescription" xml:space="preserve">
2421-
<value>Copy {0, plural, one {item} other {items}} to clipboard</value>
2424+
<value>Copy selected {0, plural, one {item} other {items}} to clipboard</value>
24222425
</data>
24232426
<data name="CopyPathDescription" xml:space="preserve">
24242427
<value>Copy path of the current directory to the clipboard</value>
@@ -2433,19 +2436,22 @@
24332436
<value>Copy path of the current directory with quotes to the clipboard</value>
24342437
</data>
24352438
<data name="CutItemDescription" xml:space="preserve">
2436-
<value>Cut {0, plural, one {item} other {items}} to clipboard</value>
2439+
<value>Cut selected {0, plural, one {item} other {items}} to clipboard</value>
24372440
</data>
24382441
<data name="PasteItemDescription" xml:space="preserve">
2439-
<value>Paste items from clipboard to current folder</value>
2442+
<value>Paste clipboard items to the current folder</value>
24402443
</data>
24412444
<data name="PasteShortcutDescription" xml:space="preserve">
2442-
<value>Paste items from clipboard to current folder as shortcuts</value>
2445+
<value>Paste clipboard items to the current folder as shortcuts</value>
24432446
</data>
24442447
<data name="PasteItemToSelectionDescription" xml:space="preserve">
2445-
<value>Paste items from clipboard to selected folder</value>
2448+
<value>Paste clipboard items to the selected folder</value>
2449+
</data>
2450+
<data name="PasteToSelectedFolder" xml:space="preserve">
2451+
<value>Paste to selected folder</value>
24462452
</data>
24472453
<data name="DeleteItemDescription" xml:space="preserve">
2448-
<value>Delete {0, plural, one {item} other {items}}</value>
2454+
<value>Delete selected {0, plural, one {item} other {items}}</value>
24492455
</data>
24502456
<data name="CreateFolderDescription" xml:space="preserve">
24512457
<value>Create new folder</value>
@@ -2457,7 +2463,7 @@
24572463
<value>Create new shortcut to any item</value>
24582464
</data>
24592465
<data name="EmptyRecycleBinDescription" xml:space="preserve">
2460-
<value>Empty recycle bin</value>
2466+
<value>Empty the contents of Recycle Bin</value>
24612467
</data>
24622468
<data name="FormatDriveDescription" xml:space="preserve">
24632469
<value>Open "Format Drive" menu for selected item</value>
@@ -2487,10 +2493,10 @@
24872493
<value>Select all items</value>
24882494
</data>
24892495
<data name="InvertSelectionDescription" xml:space="preserve">
2490-
<value>Invert item selection</value>
2496+
<value>Invert selected items</value>
24912497
</data>
24922498
<data name="ClearSelectionDescription" xml:space="preserve">
2493-
<value>Clear item selection</value>
2499+
<value>Clear selected items</value>
24942500
</data>
24952501
<data name="ToggleSelectDescription" xml:space="preserve">
24962502
<value>Toggle item selection</value>
@@ -2522,6 +2528,15 @@
25222528
<data name="SetAsAppBackgroundDescription" xml:space="preserve">
25232529
<value>Set selected picture as the app background</value>
25242530
</data>
2531+
<data name="InstallFont" xml:space="preserve">
2532+
<value>Install font</value>
2533+
</data>
2534+
<data name="InstallDriver" xml:space="preserve">
2535+
<value>Install driver</value>
2536+
</data>
2537+
<data name="InstallCertificate" xml:space="preserve">
2538+
<value>Install certificate</value>
2539+
</data>
25252540
<data name="InstallFontDescription" xml:space="preserve">
25262541
<value>Install selected {0, plural, one {font} other {fonts}}</value>
25272542
</data>
@@ -2685,13 +2700,13 @@
26852700
<value>Toggle group sort direction</value>
26862701
</data>
26872702
<data name="NewTabDescription" xml:space="preserve">
2688-
<value>Open new tab</value>
2703+
<value>Open a new tab</value>
26892704
</data>
26902705
<data name="NavigateBackDescription" xml:space="preserve">
2691-
<value>Navigate backward in navigation history</value>
2706+
<value>Navigate backward</value>
26922707
</data>
26932708
<data name="NavigateForwardDescription" xml:space="preserve">
2694-
<value>Navigate forward in navigation history</value>
2709+
<value>Navigate forward</value>
26952710
</data>
26962711
<data name="NavigateUpDescription" xml:space="preserve">
26972712
<value>Navigate up one directory</value>
@@ -2724,7 +2739,7 @@
27242739
<value>Close all tabs including the current tab</value>
27252740
</data>
27262741
<data name="ReopenClosedTabDescription" xml:space="preserve">
2727-
<value>Reopen last closed tab</value>
2742+
<value>Reopen recently closed tab</value>
27282743
</data>
27292744
<data name="PreviousTabDescription" xml:space="preserve">
27302745
<value>Move to the previous tab</value>
@@ -2736,13 +2751,13 @@
27362751
<value>Close current tab</value>
27372752
</data>
27382753
<data name="CloseActivePaneDescription" xml:space="preserve">
2739-
<value>Close active pane</value>
2754+
<value>Close the active pane</value>
27402755
</data>
27412756
<data name="FocusOtherPane" xml:space="preserve">
27422757
<value>Focus other pane</value>
27432758
</data>
27442759
<data name="FocusOtherPaneDescription" xml:space="preserve">
2745-
<value>Switch focus to the non active pane</value>
2760+
<value>Switch focus to the other pane</value>
27462761
</data>
27472762
<data name="ToggleSidebar" xml:space="preserve">
27482763
<value>Toggle the sidebar</value>
@@ -2950,13 +2965,13 @@
29502965
<value>Untagged</value>
29512966
</data>
29522967
<data name="PreviousTab" xml:space="preserve">
2953-
<value>Moves to the previous tab</value>
2968+
<value>Previous tab</value>
29542969
</data>
29552970
<data name="NextTab" xml:space="preserve">
2956-
<value>Moves to the next tab</value>
2971+
<value>Next tab</value>
29572972
</data>
29582973
<data name="CloseTab" xml:space="preserve">
2959-
<value>Closes current tab</value>
2974+
<value>Close tab</value>
29602975
</data>
29612976
<data name="EditPath" xml:space="preserve">
29622977
<value>Edit path</value>
@@ -2986,7 +3001,7 @@
29863001
<value>Show checkboxes when selecting items</value>
29873002
</data>
29883003
<data name="EditPathDescription" xml:space="preserve">
2989-
<value>Focus path bar</value>
3004+
<value>Edit path in the OmniBar</value>
29903005
</data>
29913006
<data name="AddItemDescription" xml:space="preserve">
29923007
<value>Create new item</value>
@@ -3001,7 +3016,7 @@
30013016
<value>Delete permanently</value>
30023017
</data>
30033018
<data name="DeleteItemPermanentlyDescription" xml:space="preserve">
3004-
<value>Delete {0, plural, one {item} other {items}} permanently</value>
3019+
<value>Delete selected {0, plural, one {item} other {items}} permanently</value>
30053020
</data>
30063021
<data name="PlayAllDescription" xml:space="preserve">
30073022
<value>Play the selected media files</value>
@@ -3121,7 +3136,7 @@
31213136
<value>Create a folder with the currently selected {0, plural, one {item} other {items}}</value>
31223137
</data>
31233138
<data name="OpenProperties" xml:space="preserve">
3124-
<value>Open properties</value>
3139+
<value>Properties</value>
31253140
</data>
31263141
<data name="OpenClassicProperties" xml:space="preserve">
31273142
<value>Open File Explorer properties</value>
@@ -3266,7 +3281,7 @@
32663281
<value>Initialize repo</value>
32673282
</data>
32683283
<data name="InitRepoDescription" xml:space="preserve">
3269-
<value>Initialize a Git repository</value>
3284+
<value>Initialize current folder as a git repository</value>
32703285
</data>
32713286
<data name="GitOriginRepositoryName" xml:space="preserve">
32723287
<value>Remote Repository Name</value>
@@ -3281,13 +3296,13 @@
32813296
<value>Sort items by path</value>
32823297
</data>
32833298
<data name="OpenDirectoryInNewPaneDescription" xml:space="preserve">
3284-
<value>Open directory in new pane</value>
3299+
<value>Open selected directory in a new pane</value>
32853300
</data>
32863301
<data name="OpenDirectoryInNewTabDescription" xml:space="preserve">
3287-
<value>Open directory in new tab</value>
3302+
<value>Open selected directory in a new tab</value>
32883303
</data>
32893304
<data name="OpenInNewWindowDescription" xml:space="preserve">
3290-
<value>Open directory in new window</value>
3305+
<value>Open selected directory in a new window</value>
32913306
</data>
32923307
<data name="OpenAllTaggedItems" xml:space="preserve">
32933308
<value>Open all</value>
@@ -3312,10 +3327,10 @@
33123327
<value>The '{0}' command is not ready to be executed.</value>
33133328
</data>
33143329
<data name="CommandPalette" xml:space="preserve">
3315-
<value>Command palette</value>
3330+
<value>Command Palette</value>
33163331
</data>
33173332
<data name="OpenCommandPaletteDescription" xml:space="preserve">
3318-
<value>Open command palette</value>
3333+
<value>Open Command Palette in the OmniBar</value>
33193334
</data>
33203335
<data name="ShortcutItemWorkingDir" xml:space="preserve">
33213336
<value>Start in:</value>
@@ -3740,7 +3755,7 @@
37403755
<value>Sort files and folders together</value>
37413756
</data>
37423757
<data name="SortFilesAndFoldersTogetherDescription" xml:space="preserve">
3743-
<value>Sort files and folders together</value>
3758+
<value>Sort files and folders in the same list</value>
37443759
</data>
37453760
<data name="SortFilesFirst" xml:space="preserve">
37463761
<value>Sort files first</value>
@@ -4001,16 +4016,16 @@
40014016
<value>Tab actions menu</value>
40024017
</data>
40034018
<data name="AddVerticalPane" xml:space="preserve">
4004-
<value>Add vertical pane</value>
4019+
<value>Vertical pane</value>
40054020
</data>
40064021
<data name="AddVerticalPaneDescription" xml:space="preserve">
4007-
<value>Add a vertical pane</value>
4022+
<value>Add vertical pane</value>
40084023
</data>
40094024
<data name="AddHorizontalPane" xml:space="preserve">
4010-
<value>Add horizontal pane</value>
4025+
<value>Horizontal pane</value>
40114026
</data>
40124027
<data name="AddHorizontalPaneDescription" xml:space="preserve">
4013-
<value>Add a horizontal pane</value>
4028+
<value>Add horizontal pane</value>
40144029
</data>
40154030
<data name="ArrangePanesVertically" xml:space="preserve">
40164031
<value>Arrange vertically</value>
@@ -4103,10 +4118,10 @@
41034118
<value>Always switch focus to newly created tab</value>
41044119
</data>
41054120
<data name="ToggleShelfPane" xml:space="preserve">
4106-
<value>Toggle the shelf pane</value>
4121+
<value>Toggle shelf pane</value>
41074122
</data>
41084123
<data name="ToggleShelfPaneDescription" xml:space="preserve">
4109-
<value>Toggle the shelf pane visibility</value>
4124+
<value>Toggle the visibility of the shelf pane</value>
41104125
</data>
41114126
<data name="ShowShelfPaneButtonInAddressBar" xml:space="preserve">
41124127
<value>Show shelf pane toggle in address bar</value>

‎src/Files.App/ViewModels/Settings/ActionsViewModel.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ public sealed partial class ActionsViewModel : ObservableObject
2020
public ObservableCollection<ModifiableActionItem> ValidActionItems { get; } = [];
2121
public ObservableCollection<ModifiableActionItem> AllActionItems { get; } = [];
2222

23+
private ObservableCollection<ModifiableActionItem> _FilteredActionItems;
24+
public ObservableCollection<ModifiableActionItem> FilteredActionItems
25+
{
26+
get { return _FilteredActionItems; }
27+
set { SetProperty(ref _FilteredActionItems, value); }
28+
}
29+
2330
private bool _IsResetAllConfirmationTeachingTipOpened;
2431
public bool IsResetAllConfirmationTeachingTipOpened
2532
{
@@ -148,6 +155,8 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(() =>
148155
}
149156
}
150157
});
158+
159+
FilteredActionItems = new ObservableCollection<ModifiableActionItem>(ValidActionItems);
151160
}
152161

153162
private void ExecuteShowAddNewKeyBindingBlockCommand()
@@ -432,5 +441,21 @@ ActionsSettingsService.ActionsV2 is not null
432441
item.IsInEditMode = false;
433442
ValidActionItems.Remove(item);
434443
}
444+
445+
public void FilterItems(string query)
446+
{
447+
if (string.IsNullOrEmpty(query))
448+
{
449+
FilteredActionItems = new ObservableCollection<ModifiableActionItem>(ValidActionItems);
450+
}
451+
else
452+
{
453+
FilteredActionItems = new ObservableCollection<ModifiableActionItem>(
454+
ValidActionItems.Where(item =>
455+
item.CommandLabel.Contains(query, StringComparison.OrdinalIgnoreCase) ||
456+
item.CommandDescription.Contains(query, StringComparison.OrdinalIgnoreCase))
457+
);
458+
}
459+
}
435460
}
436461
}

‎src/Files.App/Views/Settings/ActionsPage.xaml

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xmlns:i="using:Microsoft.Xaml.Interactivity"
1010
xmlns:keyboard="using:Files.App.UserControls.KeyboardShortcut"
1111
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
12+
xmlns:uc="using:Files.App.UserControls"
1213
xmlns:wctconverters="using:CommunityToolkit.WinUI.Converters"
1314
x:Name="PageRoot"
1415
DataContext="{x:Bind ViewModel, Mode=OneWay}"
@@ -69,34 +70,50 @@
6970
Text="{helpers:ResourceString Name=Actions}" />
7071

7172
<!-- Subtitle -->
72-
<Grid ColumnSpacing="12">
73+
<Grid ColumnSpacing="8" RowSpacing="8">
7374
<Grid.ColumnDefinitions>
7475
<ColumnDefinition Width="*" />
7576
<ColumnDefinition Width="Auto" />
7677
<ColumnDefinition Width="Auto" />
7778
</Grid.ColumnDefinitions>
7879

80+
<Grid.RowDefinitions>
81+
<RowDefinition Height="Auto" />
82+
<RowDefinition Height="Auto" />
83+
</Grid.RowDefinitions>
84+
7985
<!-- Subtitle Text -->
8086
<TextBlock
8187
Margin="0,8,0,4"
8288
FontSize="16"
8389
FontWeight="Medium"
8490
Text="{helpers:ResourceString Name=Commands}" />
8591

86-
<!-- Show Add New Section Button -->
87-
<Button
88-
x:Name="ShowAddNewGridButton"
92+
<TextBox
93+
x:Name="SearchBox"
8994
Grid.Column="1"
90-
Command="{x:Bind ViewModel.ShowAddNewKeyBindingBlockCommand, Mode=OneWay}"
91-
Content="{helpers:ResourceString Name=AddCommand}"
92-
IsEnabled="{x:Bind ViewModel.ShowAddNewKeyBindingBlock, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
95+
MinWidth="200"
96+
PlaceholderText="{helpers:ResourceString Name=Search}"
97+
TextChanged="SearchBox_TextChanged" />
9398

94-
<!-- Restore Defaults Button -->
95-
<Button
96-
x:Name="RestoreDefaultsButton"
99+
<StackPanel
100+
x:Name="CommandStackPanel"
97101
Grid.Column="2"
98-
Command="{x:Bind ViewModel.ShowRestoreDefaultsConfirmationCommand, Mode=OneWay}"
99-
Content="{helpers:ResourceString Name=RestoreDefaults}" />
102+
Orientation="Horizontal"
103+
Spacing="8">
104+
<!-- Add New Action Button -->
105+
<Button
106+
x:Name="AddNewGridButton"
107+
Command="{x:Bind ViewModel.ShowAddNewKeyBindingBlockCommand, Mode=OneWay}"
108+
Content="{helpers:ResourceString Name=AddCommand}"
109+
IsEnabled="{x:Bind ViewModel.ShowAddNewKeyBindingBlock, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
110+
111+
<!-- Restore Defaults Button -->
112+
<Button
113+
x:Name="RestoreDefaultsButton"
114+
Command="{x:Bind ViewModel.ShowRestoreDefaultsConfirmationCommand, Mode=OneWay}"
115+
Content="{helpers:ResourceString Name=RestoreDefaults}" />
116+
</StackPanel>
100117
</Grid>
101118

102119
<!-- New Key Binding Block -->
@@ -119,39 +136,14 @@
119136
</Grid.ColumnDefinitions>
120137

121138
<!-- New Command Selector -->
122-
<ComboBox
139+
<uc:ComboBoxEx
123140
x:Name="NewKeyBindingItemPickerComboBox"
124-
Padding="0"
141+
DisplayMemberPath="CommandLabel"
125142
DropDownClosed="NewKeyBindingItemPickerComboBox_DropDownClosed"
126143
ItemsSource="{x:Bind ViewModel.AllActionItems, Mode=OneWay}"
127144
PlaceholderText="{helpers:ResourceString Name=ChooseAnAction}"
128145
SelectedIndex="{x:Bind ViewModel.SelectedActionItemIndex, Mode=TwoWay}"
129-
SelectedItem="{x:Bind ViewModel.SelectedActionItem, Mode=TwoWay}">
130-
<ComboBox.ItemTemplate>
131-
<DataTemplate x:DataType="dataitems:ModifiableActionItem">
132-
<StackPanel Width="240" HorizontalAlignment="Left">
133-
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{x:Bind CommandLabel}" />
134-
<TextBlock
135-
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
136-
Style="{StaticResource CaptionTextBlockStyle}"
137-
Text="{x:Bind CommandDescription}"
138-
TextTrimming="CharacterEllipsis"
139-
TextWrapping="NoWrap" />
140-
</StackPanel>
141-
</DataTemplate>
142-
</ComboBox.ItemTemplate>
143-
<ComboBox.Resources>
144-
<StaticResource x:Key="ComboBoxBackground" ResourceKey="ControlFillColorTransparentBrush" />
145-
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="ControlFillColorTransparentBrush" />
146-
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="ControlFillColorTransparentBrush" />
147-
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="ControlFillColorTransparentBrush" />
148-
149-
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="ControlFillColorTransparentBrush" />
150-
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="ControlFillColorTransparentBrush" />
151-
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="ControlFillColorTransparentBrush" />
152-
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="ControlFillColorTransparentBrush" />
153-
</ComboBox.Resources>
154-
</ComboBox>
146+
SelectedItem="{x:Bind ViewModel.SelectedActionItem, Mode=TwoWay}" />
155147

156148
<!-- Editor (Using PreviewKeyDown to prevent Ctrl+A) -->
157149
<TextBox
@@ -208,7 +200,7 @@
208200
<!-- List Of Available Key Bindings -->
209201
<ListView
210202
x:Name="ValidKeyBindingsListView"
211-
ItemsSource="{x:Bind ViewModel.ValidActionItems, Mode=OneWay}"
203+
ItemsSource="{x:Bind ViewModel.FilteredActionItems, Mode=OneWay}"
212204
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
213205
ScrollViewer.HorizontalScrollMode="Disabled"
214206
ScrollViewer.VerticalScrollBarVisibility="Hidden"
@@ -416,5 +408,30 @@
416408
PreferredPlacement="Bottom"
417409
Subtitle="{helpers:ResourceString Name=KeybindingInvalidKeyNotification}" />
418410

411+
<VisualStateManager.VisualStateGroups>
412+
<VisualStateGroup>
413+
<VisualState x:Name="DefaultState">
414+
<VisualState.StateTriggers>
415+
<AdaptiveTrigger MinWindowWidth="880" />
416+
</VisualState.StateTriggers>
417+
<VisualState.Setters>
418+
<Setter Target="CommandStackPanel.(Grid.Column)" Value="2" />
419+
<Setter Target="CommandStackPanel.(Grid.ColumnSpan)" Value="2" />
420+
<Setter Target="CommandStackPanel.(Grid.Row)" Value="0" />
421+
</VisualState.Setters>
422+
</VisualState>
423+
<VisualState x:Name="CompactState">
424+
<VisualState.StateTriggers>
425+
<AdaptiveTrigger MinWindowWidth="0" />
426+
</VisualState.StateTriggers>
427+
<VisualState.Setters>
428+
<Setter Target="CommandStackPanel.(Grid.ColumnSpan)" Value="3" />
429+
<Setter Target="CommandStackPanel.(Grid.Column)" Value="0" />
430+
<Setter Target="CommandStackPanel.(Grid.Row)" Value="1" />
431+
<Setter Target="SearchBox.(Grid.Column)" Value="2" />
432+
</VisualState.Setters>
433+
</VisualState>
434+
</VisualStateGroup>
435+
</VisualStateManager.VisualStateGroups>
419436
</Grid>
420437
</Page>

‎src/Files.App/Views/Settings/ActionsPage.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,11 @@ private void NewKeyBindingItemPickerComboBox_DropDownClosed(object sender, objec
158158
// Focus the editor TextBox
159159
KeyBindingEditorTextBox.Focus(FocusState.Programmatic);
160160
}
161+
162+
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
163+
{
164+
var query = ((TextBox)sender).Text;
165+
ViewModel.FilterItems(query);
166+
}
161167
}
162168
}

0 commit comments

Comments
 (0)
Please sign in to comment.