@@ -169,6 +169,7 @@ public GitProperties EnabledGitProperties
169169 private CancellationTokenSource watcherCTS ;
170170 private CancellationTokenSource searchCTS ;
171171 private CancellationTokenSource updateTagGroupCTS ;
172+ private CancellationTokenSource ? filterDebounceCS ;
172173
173174 public event EventHandler FocusFilterHeader ;
174175
@@ -789,7 +790,20 @@ public string? FilesAndFoldersFilter
789790
790791 private void FilesAndFolderFilterUpdated ( )
791792 {
792- _ = ApplyFilesAndFoldersChangesAsync ( ) ;
793+ if ( filterDebounceCS is not null )
794+ {
795+ filterDebounceCS . Cancel ( ) ;
796+ filterDebounceCS . Dispose ( ) ;
797+ }
798+
799+ filterDebounceCS = new CancellationTokenSource ( ) ;
800+ var token = filterDebounceCS . Token ;
801+
802+ _ = Task . Delay ( 250 , token )
803+ . ContinueWith ( _ => ApplyFilesAndFoldersChangesAsync ( ) , token ,
804+ TaskContinuationOptions . OnlyOnRanToCompletion ,
805+ TaskScheduler . Default )
806+ . Unwrap ( ) ;
793807 }
794808
795809
@@ -2796,6 +2810,8 @@ public void UpdateDateDisplay(bool isFormatChange)
27962810 public void Dispose ( )
27972811 {
27982812 CancelLoadAndClearFiles ( ) ;
2813+ filterDebounceCS ? . Cancel ( ) ;
2814+ filterDebounceCS ? . Dispose ( ) ;
27992815 App . Logger . LogInformation ( $ "ShellViewModel.Dispose: CurrentFolder={ LogPathHelper . GetPathIdentifier ( CurrentFolder ? . ItemPath ) } ") ;
28002816
28012817 StorageTrashBinService . Watcher . ItemAdded -= RecycleBinItemCreatedAsync ;
0 commit comments