Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions lib/screens/libraries/tabs/library_browse_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1671,8 +1671,13 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<MediaItem, LibraryBrows
/// Whether the sort chip is visible
bool get _isSortChipVisible => _sortOptions.isNotEmpty && _selectedGrouping != 'folders';

/// Whether the current browse result count is ready to display.
bool get _isItemCountVisible => !isLoading && errorMessage == null;

Comment thread
RyanTheTechMan marked this conversation as resolved.
/// Builds the chips bar widget
Widget _buildChipsBar() {
final theme = Theme.of(context);
final itemCountText = totalSize.toString();
VoidCallback? groupingNavigateRight;
if (_isFiltersChipVisible) {
groupingNavigateRight = () => _filtersChipFocusNode.requestFocus();
Expand All @@ -1681,7 +1686,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<MediaItem, LibraryBrows
}

return Container(
color: Theme.of(context).scaffoldBackgroundColor,
color: theme.scaffoldBackgroundColor,
padding: const EdgeInsets.symmetric(horizontal: 16),
alignment: .centerLeft,
child: Row(
Expand All @@ -1699,7 +1704,7 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<MediaItem, LibraryBrows
onNavigateRight: groupingNavigateRight,
onBack: widget.onBack,
),
const SizedBox(width: 8),
if (_isFiltersChipVisible || _isSortChipVisible) const SizedBox(width: 8),
// Filters chip
if (_isFiltersChipVisible)
FocusableFilterChip(
Expand Down Expand Up @@ -1730,6 +1735,19 @@ class _LibraryBrowseTabState extends BaseLibraryTabState<MediaItem, LibraryBrows
: () => _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),
),
),
],
],
),
);
Expand Down