fix: hide navigation bar in search page during multi-selection (#20616)

fix: hide navigation bar in search page during multiselect

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-08-04 23:09:40 +05:30 committed by GitHub
parent be85832b20
commit 5901c2e963
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 60 additions and 14 deletions

View file

@ -13,6 +13,7 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/extensions/translate_extensions.dart';
import 'package:immich_mobile/models/search/search_filter.model.dart';
import 'package:immich_mobile/presentation/pages/search/paginated_search.provider.dart';
import 'package:immich_mobile/presentation/widgets/bottom_sheet/general_bottom_sheet.widget.dart';
import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart';
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
import 'package:immich_mobile/providers/search/search_input_focus.provider.dart';
@ -627,7 +628,12 @@ class _SearchResultGrid extends ConsumerWidget {
return timelineService;
}),
],
child: Timeline(key: ValueKey(searchResult.totalAssets), appBar: null, groupBy: GroupAssetsBy.none),
child: Timeline(
key: ValueKey(searchResult.totalAssets),
groupBy: GroupAssetsBy.none,
appBar: null,
bottomSheet: const GeneralBottomSheet(minChildSize: 0.20),
),
),
),
);

View file

@ -22,13 +22,13 @@ class BaseBottomSheet extends ConsumerStatefulWidget {
this.slivers,
this.controller,
this.initialChildSize = 0.35,
this.minChildSize = 0.15,
double? minChildSize,
this.maxChildSize = 0.65,
this.expand = true,
this.shouldCloseOnMinExtent = true,
this.resizeOnScroll = true,
this.backgroundColor,
});
}) : minChildSize = minChildSize ?? 0.15;
@override
ConsumerState<BaseBottomSheet> createState() => _BaseDraggableScrollableSheetState();

View file

@ -6,8 +6,8 @@ import 'package:immich_mobile/domain/models/album/album.model.dart';
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/archive_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/delete_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/delete_permanent_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/delete_local_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/delete_permanent_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/download_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/edit_date_time_action_button.widget.dart';
import 'package:immich_mobile/presentation/widgets/action_buttons/edit_location_action_button.widget.dart';
@ -26,7 +26,8 @@ import 'package:immich_mobile/providers/timeline/multiselect.provider.dart';
import 'package:immich_mobile/widgets/common/immich_toast.dart';
class GeneralBottomSheet extends ConsumerWidget {
const GeneralBottomSheet({super.key});
final double? minChildSize;
const GeneralBottomSheet({super.key, this.minChildSize});
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -60,6 +61,7 @@ class GeneralBottomSheet extends ConsumerWidget {
return BaseBottomSheet(
initialChildSize: 0.45,
minChildSize: minChildSize,
maxChildSize: 0.85,
shouldCloseOnMinExtent: false,
actions: [

View file

@ -115,6 +115,8 @@ class _SliverTimelineState extends ConsumerState<_SliverTimeline> {
_baseScaleFactor = _scaleFactor;
});
});
ref.listenManual(multiSelectProvider.select((s) => s.isEnabled), _onMultiSelectionToggled);
}
void _onEvent(Event event) {
@ -130,6 +132,10 @@ class _SliverTimelineState extends ConsumerState<_SliverTimeline> {
}
}
void _onMultiSelectionToggled(_, bool isEnabled) {
EventStream.shared.emit(MultiSelectToggleEvent(isEnabled));
}
@override
void dispose() {
_scrollController.dispose();