Skip to content

Commit 443a71e

Browse files
Fix: Fixed issue where grouping by tags wouldn't show all items (#11909)
1 parent 7f18bac commit 443a71e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/Files.App/Helpers/ItemListDisplayHelpers/BulkConcurrentObservableCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private void AddItemsToGroup(IEnumerable<T> items, CancellationToken token = def
168168

169169
var key = GetGroupKeyForItem(item);
170170
if (key is null)
171-
return;
171+
continue;
172172

173173
var groups = GroupedCollection?.Where(x => x.Model.Key == key);
174174
if (item is IGroupableItem groupable)

src/Files.App/Helpers/ItemListDisplayHelpers/GroupingHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static Func<ListedItem, string> GetItemGroupKeySelector(GroupOption optio
2323
GroupOption.DateModified => x => dateTimeFormatter.ToTimeSpanLabel(x.ItemDateModifiedReal).Text,
2424
GroupOption.FileType => x => x.PrimaryItemAttribute == StorageItemTypes.Folder && !x.IsShortcut ? x.ItemType : x.FileExtension?.ToLowerInvariant() ?? " ",
2525
GroupOption.SyncStatus => x => x.SyncStatusString,
26-
GroupOption.FileTag => x => x.FileTags?.FirstOrDefault(),
26+
GroupOption.FileTag => x => x.FileTags?.FirstOrDefault() ?? "Untagged",
2727
GroupOption.OriginalFolder => x => (x as RecycleBinItem)?.ItemOriginalFolder,
2828
GroupOption.DateDeleted => x => dateTimeFormatter.ToTimeSpanLabel((x as RecycleBinItem)?.ItemDateDeletedReal ?? DateTimeOffset.Now).Text,
2929
GroupOption.FolderPath => x => PathNormalization.GetParentDir(x.ItemPath.TrimPath()),
@@ -94,9 +94,9 @@ public static (Action<GroupedCollection<ListedItem>>, Action<GroupedCollection<L
9494

9595
GroupOption.FileTag => (x =>
9696
{
97-
ListedItem first = x.First();
97+
ListedItem first = x.FirstOrDefault();
9898
x.Model.ShowCountTextBelow = true;
99-
x.Model.Text = first.FileTagsUI?.FirstOrDefault()?.Name ?? "None".GetLocalizedResource();
99+
x.Model.Text = first.FileTagsUI?.FirstOrDefault()?.Name ?? "Untagged".GetLocalizedResource();
100100
//x.Model.Icon = first.FileTagsUI?.FirstOrDefault()?.Color;
101101
}, null),
102102

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,4 +2854,7 @@
28542854
<data name="ShowFileExtensionWarning" xml:space="preserve">
28552855
<value>Show warning when changing file extensions</value>
28562856
</data>
2857+
<data name="Untagged" xml:space="preserve">
2858+
<value>Untagged</value>
2859+
</data>
28572860
</root>

0 commit comments

Comments
 (0)