@@ -146,6 +146,7 @@ public GitProperties EnabledGitProperties
146146 private CancellationTokenSource loadPropsCTS ;
147147 private CancellationTokenSource watcherCTS ;
148148 private CancellationTokenSource searchCTS ;
149+ private CancellationTokenSource updateTagGroupCTS ;
149150
150151 public event EventHandler DirectoryInfoUpdated ;
151152
@@ -1315,9 +1316,41 @@ await SafetyExtensions.IgnoreExceptions(() =>
13151316 finally
13161317 {
13171318 itemLoadQueue . TryRemove ( item . ItemPath , out _ ) ;
1319+ await RefreshTagGroups ( ) ;
13181320 }
13191321 }
13201322
1323+ public async Task RefreshTagGroups ( )
1324+ {
1325+ if ( FilesAndFolders . IsGrouped &&
1326+ folderSettings . DirectoryGroupOption is GroupOption . FileTag &&
1327+ itemLoadQueue . IsEmpty ( ) )
1328+ {
1329+ updateTagGroupCTS ? . Cancel ( ) ;
1330+ updateTagGroupCTS = new ( ) ;
1331+
1332+ await GroupOptionsUpdatedAsync ( updateTagGroupCTS . Token ) ;
1333+ }
1334+ }
1335+
1336+ public Task UpdateItemsTags ( Dictionary < string , string [ ] > newTags )
1337+ {
1338+ return dispatcherQueue . EnqueueOrInvokeAsync ( ( ) =>
1339+ {
1340+ int count = newTags . Count ;
1341+ foreach ( var item in FilesAndFolders )
1342+ {
1343+ if ( newTags . TryGetValue ( item . ItemPath , out var tags ) )
1344+ {
1345+ item . FileTags = tags ;
1346+ if ( -- count == 0 )
1347+ break ;
1348+ }
1349+ }
1350+ } ,
1351+ Microsoft . UI . Dispatching . DispatcherQueuePriority . Low ) ;
1352+ }
1353+
13211354 private bool CheckElevationRights ( ListedItem item )
13221355 {
13231356 if ( item . SyncStatusUI . LoadSyncStatus )
0 commit comments