From 910dc1d040de68c272658e6ab371a91d0ee5c684 Mon Sep 17 00:00:00 2001 From: Ryan Ernest Date: Fri, 10 Jul 2026 03:15:26 -0400 Subject: [PATCH] feat(libraries): show item count in browse toolbar Display the server-reported Browse result count next to the filter and sort controls on desktop and TV. The count follows grouping and filter changes, and renders as plain digits without locale-specific separators. This is similar to how Plex displays the number in it's app. --- .../libraries/tabs/library_browse_tab.dart | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/screens/libraries/tabs/library_browse_tab.dart b/lib/screens/libraries/tabs/library_browse_tab.dart index 1bcdb146c..97cb30e33 100644 --- a/lib/screens/libraries/tabs/library_browse_tab.dart +++ b/lib/screens/libraries/tabs/library_browse_tab.dart @@ -1671,8 +1671,13 @@ class _LibraryBrowseTabState extends BaseLibraryTabState _sortOptions.isNotEmpty && _selectedGrouping != 'folders'; + /// Whether the current browse result count is ready to display. + bool get _isItemCountVisible => !isLoading && errorMessage == null; + /// Builds the chips bar widget Widget _buildChipsBar() { + final theme = Theme.of(context); + final itemCountText = totalSize.toString(); VoidCallback? groupingNavigateRight; if (_isFiltersChipVisible) { groupingNavigateRight = () => _filtersChipFocusNode.requestFocus(); @@ -1681,7 +1686,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState _groupingChipFocusNode.requestFocus(), onBack: widget.onBack, ), + if (_isItemCountVisible) ...[ + const SizedBox(width: 12), + Semantics( + key: const ValueKey('library_browse_item_count'), + label: t.libraries.content, + value: itemCountText, + excludeSemantics: true, + child: Text( + itemCountText, + style: theme.textTheme.labelMedium?.copyWith(color: theme.colorScheme.onSurfaceVariant), + ), + ), + ], ], ), );