High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix: expand sheet when album search is focused (#20651)
Brandon Wees081307ced2de
diff --git a/mobile/lib/presentation/widgets/album/album_selector.widget.dart b/mobile/lib/presentation/widgets/album/album_selector.widget.dartindex 47ce167455..a97ca736d1 100644--- a/mobile/lib/presentation/widgets/album/album_selector.widget.dart+++ b/mobile/lib/presentation/widgets/album/album_selector.widget.dart@@ -27,8 +27,9 @@ typedef AlbumSelectorCallback = void Function(RemoteAlbum album);class AlbumSelector extends ConsumerStatefulWidget {final AlbumSelectorCallback onAlbumSelected;+ final Function? onKeyboardExpanded;- const AlbumSelector({super.key, required this.onAlbumSelected});+ const AlbumSelector({super.key, required this.onAlbumSelected, this.onKeyboardExpanded});@overrideConsumerState<AlbumSelector> createState() => _AlbumSelectorState();@@ -52,6 +53,12 @@ class _AlbumSelectorState extends ConsumerState<AlbumSelector> {searchController.addListener(() {onSearch(searchController.text, filterMode);});++ searchFocusNode.addListener(() {+ if (searchFocusNode.hasFocus) {+ widget.onKeyboardExpanded?.call();+ }+ });}void onSearch(String searchTerm, QuickFilterMode sortMode) {diff --git a/mobile/lib/presentation/widgets/bottom_sheet/general_bottom_sheet.widget.dart b/mobile/lib/presentation/widgets/bottom_sheet/general_bottom_sheet.widget.dartindex 8edfcb749e..07b0ea6da8 100644--- a/mobile/lib/presentation/widgets/bottom_sheet/general_bottom_sheet.widget.dart+++ b/mobile/lib/presentation/widgets/bottom_sheet/general_bottom_sheet.widget.dart@@ -25,12 +25,30 @@ import 'package:immich_mobile/providers/server_info.provider.dart';import 'package:immich_mobile/providers/timeline/multiselect.provider.dart';import 'package:immich_mobile/widgets/common/immich_toast.dart';-class GeneralBottomSheet extends ConsumerWidget {+class GeneralBottomSheet extends ConsumerStatefulWidget {final double? minChildSize;const GeneralBottomSheet({super.key, this.minChildSize});@override- Widget build(BuildContext context, WidgetRef ref) {+ ConsumerState<GeneralBottomSheet> createState() => _GeneralBottomSheetState();+}++class _GeneralBottomSheetState extends ConsumerState<GeneralBottomSheet> {+ late DraggableScrollableController sheetController;+ @override+ void initState() {+ super.initState();+ sheetController = DraggableScrollableController();+ }++ @override+ void dispose() {+ sheetController.dispose();+ super.dispose();+ }++ @override+ Widget build(BuildContext context) {final multiselect = ref.watch(multiSelectProvider);final isTrashEnable = ref.watch(serverInfoProvider.select((state) => state.serverFeatures.trash));@@ -59,9 +77,14 @@ class GeneralBottomSheet extends ConsumerWidget {ref.read(multiSelectProvider.notifier).reset();}+ Future<void> onKeyboardExpand() {+ return sheetController.animateTo(0.85, duration: const Duration(milliseconds: 200), curve: Curves.easeInOut);+ }+return BaseBottomSheet(+ controller: sheetController,initialChildSize: 0.45,- minChildSize: minChildSize,+ minChildSize: widget.minChildSize,maxChildSize: 0.85,shouldCloseOnMinExtent: false,actions: [@@ -90,7 +113,7 @@ class GeneralBottomSheet extends ConsumerWidget {],slivers: [const AddToAlbumHeader(),- AlbumSelector(onAlbumSelected: addAssetsToAlbum),+ AlbumSelector(onAlbumSelected: addAssetsToAlbum, onKeyboardExpanded: onKeyboardExpand),],);}