diff --git a/.changes/2361-general-fixes.md b/.changes/2361-general-fixes.md new file mode 100644 index 000000000000..46862d6b13bf --- /dev/null +++ b/.changes/2361-general-fixes.md @@ -0,0 +1,4 @@ +- [Fix] : Pin icon changes now reflected in list immediately +- [Fix] : No more keyboard overlay issue when we do add task from quick action buttons +- [Improvement] : Better color contrast on Boost Post Backgrounds +- [Improvement] : Better boost slide scroll management on desktop \ No newline at end of file diff --git a/app/lib/features/events/providers/event_providers.dart b/app/lib/features/events/providers/event_providers.dart index a9454d1853c0..3ff89d5aecf2 100644 --- a/app/lib/features/events/providers/event_providers.dart +++ b/app/lib/features/events/providers/event_providers.dart @@ -1,5 +1,6 @@ import 'package:acter/features/bookmarks/providers/bookmarks_provider.dart'; import 'package:acter/features/bookmarks/types.dart'; +import 'package:acter/features/bookmarks/util.dart'; import 'package:acter/features/events/providers/event_type_provider.dart'; import 'package:acter/features/events/actions/sort_event_list.dart'; import 'package:acter/features/events/providers/notifiers/event_notifiers.dart'; @@ -186,16 +187,25 @@ final eventListSearchedProvider = FutureProvider.autoDispose final eventListQuickSearchedProvider = FutureProvider.autoDispose>((ref) async { final searchTerm = ref.watch(quickSearchValueProvider); + + final priotizeBookmarkedEvents = await priotizeBookmarked( + ref, + BookmarkType.events, + await ref.watch(allEventListProvider(null).future), + getId: (t) => t.eventId().toString(), + ); + return _filterEventBySearchTerm( searchTerm, - await ref.watch(allEventListProvider(null).future), + priotizeBookmarkedEvents, ); }); final eventListSearchedAndFilterProvider = FutureProvider.autoDispose .family, String?>((ref, spaceId) async { //Declare filtered event list - final filteredEventList = + + final List filteredEventList = switch (ref.watch(eventListFilterProvider(spaceId))) { EventFilters.bookmarked => await ref.watch(bookmarkedEventListProvider(spaceId).future), @@ -205,9 +215,25 @@ final eventListSearchedAndFilterProvider = FutureProvider.autoDispose await ref.watch(allUpcomingEventListProvider(spaceId).future), EventFilters.past => await ref.watch(allPastEventListProvider(spaceId).future), - EventFilters.all => await ref.watch(allEventListProvider(spaceId).future), + EventFilters.all => + (await ref.watch(allOngoingEventListProvider(spaceId).future)) + .followedBy( + await ref.watch(allUpcomingEventListProvider(spaceId).future), + ) + .followedBy(await ref.watch(allPastEventListProvider(spaceId).future)) + .toList(), }; + final priotizeBookmarkedEvents = await priotizeBookmarked( + ref, + BookmarkType.events, + filteredEventList, + getId: (t) => t.eventId().toString(), + ); + final searchTerm = ref.watch(eventListSearchTermProvider(spaceId)); - return _filterEventBySearchTerm(searchTerm, filteredEventList); + return _filterEventBySearchTerm( + searchTerm, + priotizeBookmarkedEvents, + ); }); diff --git a/app/lib/features/news/model/news_post_color_data.dart b/app/lib/features/news/model/news_post_color_data.dart new file mode 100644 index 000000000000..a185abccfa40 --- /dev/null +++ b/app/lib/features/news/model/news_post_color_data.dart @@ -0,0 +1,12 @@ + +import 'package:flutter/material.dart'; + +List newsPostColors = [ + Colors.brown, + Colors.red, + Colors.orange, + Colors.deepPurple, + Colors.purple, + Colors.indigo, + Colors.pink, +]; diff --git a/app/lib/features/news/news_utils/news_utils.dart b/app/lib/features/news/news_utils/news_utils.dart index 15632ea3ad98..8a0666fd69e2 100644 --- a/app/lib/features/news/news_utils/news_utils.dart +++ b/app/lib/features/news/news_utils/news_utils.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:acter/common/utils/utils.dart'; +import 'package:acter/features/news/model/news_post_color_data.dart'; import 'package:acter/features/news/model/news_slide_model.dart'; import 'package:acter/features/news/providers/news_post_editor_providers.dart'; import 'package:acter_flutter_sdk/acter_flutter_sdk.dart'; @@ -51,7 +52,7 @@ class NewsUtils { //Add text slide static void addTextSlide(WidgetRef ref) { - final clr = getRandomElement(Colors.primaries); + final clr = getRandomElement(newsPostColors); NewsSlideItem textSlide = NewsSlideItem( type: NewsSlideType.text, text: '', @@ -62,7 +63,7 @@ class NewsUtils { //Add image slide static Future addImageSlide(WidgetRef ref) async { - final clr = getRandomElement(Colors.primaries); + final clr = getRandomElement(newsPostColors); XFile? imageFile = await imagePicker.pickImage( source: ImageSource.gallery, ); @@ -78,7 +79,7 @@ class NewsUtils { //Add video slide static Future addVideoSlide(WidgetRef ref) async { - final clr = getRandomElement(Colors.primaries); + final clr = getRandomElement(newsPostColors); XFile? videoFile = await imagePicker.pickVideo( source: ImageSource.gallery, ); diff --git a/app/lib/features/news/providers/news_post_editor_providers.dart b/app/lib/features/news/providers/news_post_editor_providers.dart index 98b426edb15a..c7c383f79457 100644 --- a/app/lib/features/news/providers/news_post_editor_providers.dart +++ b/app/lib/features/news/providers/news_post_editor_providers.dart @@ -1,6 +1,7 @@ import 'package:acter/common/utils/utils.dart'; import 'package:acter/common/widgets/event/event_selector_drawer.dart'; import 'package:acter/common/widgets/spaces/space_selector_drawer.dart'; +import 'package:acter/features/news/model/news_post_color_data.dart'; import 'package:acter/features/news/model/news_post_state.dart'; import 'package:acter/features/news/model/news_references_model.dart'; import 'package:acter/features/news/model/news_slide_model.dart'; @@ -21,7 +22,7 @@ class NewsStateNotifier extends StateNotifier { void changeTextSlideBackgroundColor() { NewsSlideItem? selectedNewsSlide = state.currentNewsSlide; - selectedNewsSlide?.backgroundColor = getRandomElement(Colors.primaries); + selectedNewsSlide?.backgroundColor = getRandomElement(newsPostColors); state = state.copyWith(currentNewsSlide: selectedNewsSlide); } diff --git a/app/lib/features/news/widgets/news_full_view.dart b/app/lib/features/news/widgets/news_full_view.dart index feeb5ca40539..d839fafb5e7d 100644 --- a/app/lib/features/news/widgets/news_full_view.dart +++ b/app/lib/features/news/widgets/news_full_view.dart @@ -2,6 +2,7 @@ import 'package:acter/common/animations/like_animation.dart'; import 'package:acter/features/news/providers/news_providers.dart'; import 'package:acter/features/news/widgets/news_item/news_item.dart'; import 'package:acter_flutter_sdk/acter_flutter_sdk_ffi.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -49,21 +50,29 @@ class NewsVerticalViewState extends ConsumerState { } Widget buildPagerView() { - return PageView.builder( - controller: _pageController, - itemCount: widget.newsList.length, - scrollDirection: Axis.vertical, - itemBuilder: (context, index) => InkWell( - onDoubleTap: () async { - LikeAnimation.run(index); - final news = widget.newsList[index]; - final manager = await ref.read(newsReactionsProvider(news).future); - final status = manager.likedByMe(); - if (!status) { - await manager.sendLike(); - } + return ScrollConfiguration( + behavior: ScrollConfiguration.of(context).copyWith( + dragDevices: { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, }, - child: NewsItem(news: widget.newsList[index]), + ), + child: PageView.builder( + controller: _pageController, + itemCount: widget.newsList.length, + scrollDirection: Axis.vertical, + itemBuilder: (context, index) => InkWell( + onDoubleTap: () async { + LikeAnimation.run(index); + final news = widget.newsList[index]; + final manager = await ref.read(newsReactionsProvider(news).future); + final status = manager.likedByMe(); + if (!status) { + await manager.sendLike(); + } + }, + child: NewsItem(news: widget.newsList[index]), + ), ), ); } diff --git a/app/lib/features/pins/actions/pin_update_actions.dart b/app/lib/features/pins/actions/pin_update_actions.dart index a8d548f07247..427650fac7d6 100644 --- a/app/lib/features/pins/actions/pin_update_actions.dart +++ b/app/lib/features/pins/actions/pin_update_actions.dart @@ -114,7 +114,10 @@ Future updatePinIcon( await updateBuilder.send(); EasyLoading.dismiss(); + + //TODO : this only fixes the case where we do the update. if the change comes from outside - another user - this will not trigger. ref.invalidate(pinProvider); + ref.invalidate(pinListProvider); } catch (e, s) { _log.severe('Failed to change icon of pin', e, s); if (!context.mounted) { diff --git a/app/lib/features/space/providers/space_navbar_provider.dart b/app/lib/features/space/providers/space_navbar_provider.dart index 372fa8aa4c36..cd215dcafa26 100644 --- a/app/lib/features/space/providers/space_navbar_provider.dart +++ b/app/lib/features/space/providers/space_navbar_provider.dart @@ -61,16 +61,16 @@ final tabsProvider = } } - final hasSpaces = await ref.watch(hasSubSpacesProvider(spaceId).future); - if (hasSpaces) { - tabs.add(TabEntry.spaces); - } - final hasChats = await ref.watch(hasSubChatsProvider(spaceId).future); if (hasChats) { tabs.add(TabEntry.chats); } + final hasSpaces = await ref.watch(hasSubSpacesProvider(spaceId).future); + if (hasSpaces) { + tabs.add(TabEntry.spaces); + } + tabs.add(TabEntry.members); final membership = ref.watch(roomMembershipProvider(spaceId)); diff --git a/app/lib/features/space/widgets/space_sections/chats_section.dart b/app/lib/features/space/widgets/space_sections/chats_section.dart index f4ed6d24bc22..7e0aa75bc81c 100644 --- a/app/lib/features/space/widgets/space_sections/chats_section.dart +++ b/app/lib/features/space/widgets/space_sections/chats_section.dart @@ -74,7 +74,7 @@ class ChatsSection extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SectionHeader( - title: L10n.of(context).suggestedChats, + title: L10n.of(context).chats, isShowSeeAllButton: true, onTapSeeAll: () => context.pushNamed( Routes.subChats.name, diff --git a/app/lib/features/space/widgets/space_sections/spaces_section.dart b/app/lib/features/space/widgets/space_sections/spaces_section.dart index 025827c9950e..2e28a0112c87 100644 --- a/app/lib/features/space/widgets/space_sections/spaces_section.dart +++ b/app/lib/features/space/widgets/space_sections/spaces_section.dart @@ -73,7 +73,7 @@ class SpacesSection extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SectionHeader( - title: L10n.of(context).suggestedSpaces, + title: L10n.of(context).spaces, isShowSeeAllButton: true, onTapSeeAll: () => context.pushNamed( Routes.subSpaces.name, diff --git a/app/lib/features/tasks/actions/create_task.dart b/app/lib/features/tasks/actions/create_task.dart index a41eb7a89c12..0e0d4ce9bdab 100644 --- a/app/lib/features/tasks/actions/create_task.dart +++ b/app/lib/features/tasks/actions/create_task.dart @@ -24,9 +24,12 @@ Future showCreateTaskBottomSheet( showDragHandle: true, useSafeArea: true, isScrollControlled: true, - builder: (context) => CreateTaskWidget( - taskList: taskList, - taskName: taskName, + builder: (context) => Padding( + padding: MediaQuery.of(context).viewInsets, + child: CreateTaskWidget( + taskList: taskList, + taskName: taskName, + ), ), ); }