Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: improve chat message animations (#7890)

Lucas38839b42557e
diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list.dart
index d24055d581..355037d665 100644
--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list.dart
+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list.dart
@@ -3,13 +3,15 @@
import 'dart:async';
import 'dart:math';
+import 'package:appflowy_backend/log.dart';
import 'package:diffutil_dart/diffutil.dart' as diffutil;
+import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
-import 'package:flutter/rendering.dart';
import 'package:flutter_chat_core/flutter_chat_core.dart';
import 'package:flutter_chat_ui/src/scroll_to_bottom.dart';
import 'package:flutter_chat_ui/src/utils/message_list_diff.dart';
import 'package:provider/provider.dart';
+import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
class ChatAnimatedList extends StatefulWidget {
const ChatAnimatedList({
@@ -53,9 +55,19 @@ class ChatAnimatedListState extends State<ChatAnimatedList>
late final Animation<double> _scrollToBottomAnimation;
Timer? _scrollToBottomShowTimer;
- bool _userHasScrolled = false;
+ final ScrollOffsetController scrollOffsetController =
+ ScrollOffsetController();
+
+ final ItemScrollController itemScrollController = ItemScrollController();
+
+ final ScrollOffsetListener scrollOffsetListener =
+ ScrollOffsetListener.create();
+
+ final ItemPositionsListener itemPositionsListener =
+ ItemPositionsListener.create();
+
+ int _lastUserMessageIndex = 0;
bool _isScrollingToBottom = false;
- // String _lastInsertedMessageId = '';
@override
void initState() {
@@ -119,20 +131,18 @@ class ChatAnimatedListState extends State<ChatAnimatedList>
curve: Curves.easeInOut,
);
- widget.scrollController.addListener(_handleLoadPreviousMessages);
-
- WidgetsBinding.instance.addPostFrameCallback((_) {
- _handleLoadPreviousMessages();
+ itemPositionsListener.itemPositions.addListener(() {
+ _handleToggleScrollToBottom();
});
}
@override
void dispose() {
super.dispose();
+
_scrollToBottomShowTimer?.cancel();
_scrollToBottomController.dispose();
_operationsSubscription.cancel();
- widget.scrollController.removeListener(_handleLoadPreviousMessages);
}
@override
@@ -140,165 +150,84 @@ class ChatAnimatedListState extends State<ChatAnimatedList>
final builders = context.watch<Builders>();
final height = MediaQuery.of(context).size.height;
- return NotificationListener<Notification>(
- onNotification: (notification) {
- if (notification is UserScrollNotification) {
- // When user scrolls up, save it to `_userHasScrolled`
- if (notification.direction == ScrollDirection.reverse) {
- _userHasScrolled = true;
- } else {
- // When user overscolls to the bottom or stays idle at the bottom, set `_userHasScrolled` to false
- if (notification.metrics.pixels ==
- notification.metrics.maxScrollExtent) {
- _userHasScrolled = false;
+ return Stack(
+ children: [
+ ScrollablePositionedList.builder(
+ scrollOffsetController: scrollOffsetController,
+ itemScrollController: itemScrollController,
+ initialScrollIndex: _chatController.messages.length,
+ initialAlignment: 1,
+ scrollOffsetListener: scrollOffsetListener,
+ itemPositionsListener: itemPositionsListener,
+ physics: ClampingScrollPhysics(),
+ shrinkWrap: true,
+ // the extra item is a vertical padding.
+ itemCount: _chatController.messages.length + 1,
+ itemBuilder: (context, index) {
+ if (index == _chatController.messages.length) {
+ return VSpace(height - 400);
}
- }
- }
-
- if (notification is ScrollUpdateNotification) {
- _handleToggleScrollToBottom();
- }
-
- // Allow other listeners to get the notification
- return false;
- },
- child: Stack(
- children: [
- CustomScrollView(
- controller: widget.scrollController,
- physics: ClampingScrollPhysics(),
- slivers: <Widget>[
- SliverPadding(
- padding: EdgeInsets.only(
- top: widget.bottomPadding ?? 0,
- ),
- ),
- SliverAnimatedList(
- key: _listKey,
- initialItemCount: _chatController.messages.length,
- itemBuilder: (
- BuildContext context,
- int index,
- Animation<double> animation,
- ) {
- final message = _chatController.messages[index];
- final child = widget.itemBuilder(
- context,
- animation,
- message,
- );
- return RepaintBoundary(
- child: child,
- );
- },
- ),
- SliverPadding(
- padding: EdgeInsets.only(
- bottom: max(0, height - widget.scrollBottomPadding),
+
+ final message = _chatController.messages[index];
+ return widget.itemBuilder(
+ context,
+ Tween<double>(begin: 1, end: 1).animate(
+ CurvedAnimation(
+ parent: _scrollToBottomController,
+ curve: Curves.easeInOut,
),
),
- ],
- ),
- builders.scrollToBottomBuilder?.call(
- context,
- _scrollToBottomAnimation,
- _handleScrollToBottom,
- ) ??
- ScrollToBottom(
- animation: _scrollToBottomAnimation,
- onPressed: _handleScrollToBottom,
- ),
- ],
- ),
+ message,
+ );
+ },
+ ),
+ builders.scrollToBottomBuilder?.call(
+ context,
+ _scrollToBottomAnimation,
+ _handleScrollToBottom,
+ ) ??
+ ScrollToBottom(
+ animation: _scrollToBottomAnimation,
+ onPressed: _handleScrollToBottom,
+ ),
+ ],
);
}
- // void _subsequentScrollToEnd(Message data) async {
- // final user = Provider.of<User>(context, listen: false);
-
- // // We only want to scroll to the bottom if user has not scrolled up
- // // or if the message is sent by the current user.
- // if (data.id == _lastInsertedMessageId &&
- // widget.scrollController.offset <
- // widget.scrollController.position.maxScrollExtent &&
- // (user.id != data.author.id && !_userHasScrolled)) {
- // if (widget.scrollToEndAnimationDuration == Duration.zero) {
- // widget.scrollController
- // .jumpTo(widget.scrollController.position.maxScrollExtent);
- // } else {
- // await widget.scrollController.animateTo(
- // widget.scrollController.position.maxScrollExtent,
- // duration: widget.scrollToEndAnimationDuration,
- // curve: Curves.linearToEaseOut,
- // );
- // }
-
- // if (!widget.scrollController.hasClients || !mounted) return;
-
- // // Because of the issue I have opened here https://github.com/flutter/flutter/issues/129768
- // // we need an additional jump to the end. Sometimes Flutter
- // // will not scroll to the very end. Sometimes it will not scroll to the
- // // very end even with this, so this is something that needs to be
- // // addressed by the Flutter team.
- // //
- // // Additionally here we have a check for the message id, because
- // // if new message arrives in the meantime it will trigger another
- // // scroll to the end animation, making this logic redundant.
- // if (data.id == _lastInsertedMessageId &&
- // widget.scrollController.offset <
- // widget.scrollController.position.maxScrollExtent &&
- // (user.id == data.author.id && _userHasScrolled)) {
- // widget.scrollController
- // .jumpTo(widget.scrollController.position.maxScrollExtent);
- // }
- // }
- // }
-
- void _scrollToTop(Message data) {
- WidgetsBinding.instance.addPostFrameCallback(
- (_) {
- if (!widget.scrollController.hasClients || !mounted) return;
-
- final user = Provider.of<User>(context, listen: false);
- final lastMessage = _chatController.messages.last;
- if (lastMessage.author.id == user.id) {
- // scroll the current message to the top
- widget.scrollController.animateTo(
- widget.scrollController.position.maxScrollExtent,
- duration: Durations.medium4,
- curve: Curves.linearToEaseOut,
- );
- }
- },
+ void _scrollLastMessageToTop(Message data) {
+ final user = Provider.of<User>(context, listen: false);
+ final lastUserMessageIndex = _chatController.messages.lastIndexWhere(
+ (message) => message.author.id == user.id,
);
+
+ if (_lastUserMessageIndex != lastUserMessageIndex) {
+ // scroll the current message to the top
+ Log.info('scrolling the last message to the top');
+ itemScrollController.scrollTo(
+ index: lastUserMessageIndex,
+ duration: const Duration(milliseconds: 300),
+ curve: Curves.easeInOut,
+ );
+ }
+
+ _lastUserMessageIndex = lastUserMessageIndex;
}
- void _handleScrollToBottom() {
+ Future<void> _handleScrollToBottom() async {
_isScrollingToBottom = true;
- _scrollToBottomController.reverse();
-
- WidgetsBinding.instance.addPostFrameCallback((_) async {
- if (!widget.scrollController.hasClients || !mounted) return;
-
- final height = MediaQuery.of(context).size.height;
- final paddingHeight = height - widget.scrollBottomPadding;
- final offset =
- widget.scrollController.position.maxScrollExtent - paddingHeight;
-
- if (widget.scrollToEndAnimationDuration == Duration.zero) {
- widget.scrollController.jumpTo(offset);
- } else {
- await widget.scrollController.animateTo(
- offset,
- duration: widget.scrollToEndAnimationDuration,
- curve: Curves.linearToEaseOut,
- );
- }
- if (!widget.scrollController.hasClients || !mounted) return;
+ _scrollToBottomShowTimer?.cancel();
- _isScrollingToBottom = false;
- });
+ await _scrollToBottomController.reverse();
+
+ await itemScrollController.scrollTo(
+ index: _chatController.messages.length + 1,
+ alignment: 1.0,
+ duration: const Duration(milliseconds: 300),
+ curve: Curves.easeInOut,
+ );
+
+ _isScrollingToBottom = false;
}
void _handleToggleScrollToBottom() {
@@ -306,50 +235,28 @@ class ChatAnimatedListState extends State<ChatAnimatedList>
return;
}
- final paddingHeight =
- MediaQuery.of(context).size.height - widget.scrollBottomPadding;
- _scrollToBottomShowTimer?.cancel();
- if (widget.scrollController.offset <
- widget.scrollController.position.maxScrollExtent - paddingHeight) {
- _scrollToBottomShowTimer =
- Timer(widget.scrollToBottomAppearanceDelay, () {
- if (mounted) {
- _scrollToBottomController.forward();
- }
- });
- } else {
- if (_scrollToBottomController.status != AnimationStatus.completed) {
- _scrollToBottomController.stop();
- }
+ // get the max item
+ final sortedItems = itemPositionsListener.itemPositions.value.toList()
+ ..sort((a, b) => a.index.compareTo(b.index));
+ final maxItem = sortedItems.last;
+
+ if (maxItem.index >= _chatController.messages.length - 1) {
+ _scrollToBottomShowTimer?.cancel();
_scrollToBottomController.reverse();
+ return;
}
+
+ _scrollToBottomShowTimer?.cancel();
+ _scrollToBottomShowTimer = Timer(widget.scrollToBottomAppearanceDelay, () {
+ if (mounted) {
+ _scrollToBottomController.forward();
+ }
+ });
}
void _onInserted(final int position, final Message data) {
- // There is a scroll notification listener the controls the
- // `_userHasScrolled` variable.
- //
- // If for some reason `_userHasScrolled` is true and the user is not at the
- // bottom of the list, set `_userHasScrolled` to false so that the scroll
- // animation is triggered.
- if (position == 0 &&
- _userHasScrolled &&
- widget.scrollController.offset <
- widget.scrollController.position.maxScrollExtent) {
- _userHasScrolled = false;
- }
-
- _listKey.currentState!.insertItem(
- 0,
- duration: widget.insertAnimationDuration,
- );
-
- // Used later to trigger scroll to end only for the last inserted message.
- // _lastInsertedMessageId = data.id;
-
if (position == _oldList.length) {
- _scrollToTop(data);
- // _scrollToEnd(data);
+ _scrollLastMessageToTop(data);
}
}
@@ -383,11 +290,4 @@ class ChatAnimatedListState extends State<ChatAnimatedList>
move: (_, __, ___) => throw UnimplementedError('unused'),
);
}
-
- void _handleLoadPreviousMessages() {
- if (widget.scrollController.offset >=
- widget.scrollController.position.maxScrollExtent) {
- widget.onLoadPreviousMessages?.call();
- }
- }
}
diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list_reversed.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list_reversed.dart
index b425192c3e..c775a0d338 100644
--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list_reversed.dart
+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/animated_chat_list_reversed.dart
@@ -168,7 +168,7 @@ class ChatAnimatedListReversedState extends State<ChatAnimatedListReversed>
slivers: <Widget>[
SliverPadding(
padding: EdgeInsets.only(
- top: widget.bottomPadding ?? 0,
+ top: 400,
),
),
SliverAnimatedList(
diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/chat_message_widget.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/chat_message_widget.dart
index e69de29bb2..acab7179fb 100644
--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/chat_message_widget.dart
+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/chat_message_widget.dart
@@ -0,0 +1,33 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_chat_core/flutter_chat_core.dart';
+import 'package:provider/provider.dart';
+
+class ChatMessage extends StatelessWidget {
+ const ChatMessage({
+ super.key,
+ required this.message,
+ required this.child,
+ this.sentMessageAlignment = AlignmentDirectional.centerEnd,
+ this.receivedMessageAlignment = AlignmentDirectional.centerStart,
+ this.padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 1),
+ });
+
+ final Message message;
+ final Widget child;
+ final AlignmentGeometry sentMessageAlignment;
+ final AlignmentGeometry receivedMessageAlignment;
+ final EdgeInsetsGeometry padding;
+
+ @override
+ Widget build(BuildContext context) {
+ final isSentByMe = context.watch<User>().id == message.author.id;
+
+ return Align(
+ alignment: isSentByMe ? sentMessageAlignment : receivedMessageAlignment,
+ child: Padding(
+ padding: padding,
+ child: child,
+ ),
+ );
+ }
+}
diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/load_chat_message_status_ready.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/load_chat_message_status_ready.dart
index 85cac94d6b..aa7f4b97cf 100644
--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/load_chat_message_status_ready.dart
+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_page/load_chat_message_status_ready.dart
@@ -1,13 +1,14 @@
import 'package:appflowy/plugins/ai_chat/presentation/chat_message_selector_banner.dart';
import 'package:appflowy/plugins/ai_chat/presentation/chat_page/chat_animation_list_widget.dart';
import 'package:appflowy/plugins/ai_chat/presentation/chat_page/chat_footer.dart';
+import 'package:appflowy/plugins/ai_chat/presentation/chat_page/chat_message_widget.dart';
import 'package:appflowy/plugins/ai_chat/presentation/chat_page/text_message_widget.dart';
import 'package:appflowy/plugins/ai_chat/presentation/scroll_to_bottom.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter_chat_core/flutter_chat_core.dart';
-import 'package:flutter_chat_ui/flutter_chat_ui.dart';
+import 'package:flutter_chat_ui/flutter_chat_ui.dart' hide ChatMessage;
import 'package:universal_platform/universal_platform.dart';
class LoadChatMessageStatusReady extends StatelessWidget {
@@ -61,20 +62,31 @@ class LoadChatMessageStatusReady extends StatelessWidget {
builders: Builders(
// we have a custom input builder, so we don't need the default one
inputBuilder: (_) => const SizedBox.shrink(),
- textMessageBuilder: (context, message) => TextMessageWidget(
+ textMessageBuilder: (
+ context,
+ message,
+ ) =>
+ TextMessageWidget(
message: message,
userProfile: userProfile,
view: view,
),
- chatMessageBuilder: (context, message, animation, child) =>
+ chatMessageBuilder: (
+ context,
+ message,
+ animation,
+ child,
+ ) =>
ChatMessage(
message: message,
- animation: animation,
padding: const EdgeInsets.symmetric(vertical: 18.0),
- receivedMessageScaleAnimationAlignment: Alignment.center,
child: child,
),
- scrollToBottomBuilder: (context, animation, onPressed) =>
+ scrollToBottomBuilder: (
+ context,
+ animation,
+ onPressed,
+ ) =>
CustomScrollToBottom(
animation: animation,
onPressed: onPressed,
@@ -88,7 +100,6 @@ class LoadChatMessageStatusReady extends StatelessWidget {
userProfile: userProfile,
scrollController: scrollController,
itemBuilder: itemBuilder,
- enableReversedList: true,
),
),
),
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/bulleted_list/bulleted_list_icon.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/bulleted_list/bulleted_list_icon.dart
index 23b73e75a9..af34091645 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/bulleted_list/bulleted_list_icon.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/bulleted_list/bulleted_list_icon.dart
@@ -3,7 +3,7 @@ import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-class BulletedListIcon extends StatelessWidget {
+class BulletedListIcon extends StatefulWidget {
const BulletedListIcon({
super.key,
required this.node,
@@ -17,28 +17,30 @@ class BulletedListIcon extends StatelessWidget {
FlowySvgs.bulleted_list_icon_3_s,
];
- int get level {
- var level = 0;
- var parent = node.parent;
- while (parent != null) {
- if (parent.type == BulletedListBlockKeys.type) {
- level++;
- }
- parent = parent.parent;
- }
- return level;
- }
+ @override
+ State<BulletedListIcon> createState() => _BulletedListIconState();
+}
+
+class _BulletedListIconState extends State<BulletedListIcon> {
+ int index = 0;
+ double size = 0.0;
@override
- Widget build(BuildContext context) {
+ void initState() {
+ super.initState();
+
final textStyle =
context.read<EditorState>().editorStyle.textStyleConfiguration;
final fontSize = textStyle.text.fontSize ?? 16.0;
final height = textStyle.text.height ?? textStyle.lineHeight;
- final size = fontSize * height;
- final index = level % bulletedListIcons.length;
+ index = level % BulletedListIcon.bulletedListIcons.length;
+ size = fontSize * height;
+ }
+
+ @override
+ Widget build(BuildContext context) {
final icon = FlowySvg(
- bulletedListIcons[index],
+ BulletedListIcon.bulletedListIcons[index],
size: Size.square(size * 0.8),
);
return Container(
@@ -49,4 +51,16 @@ class BulletedListIcon extends StatelessWidget {
child: icon,
);
}
+
+ int get level {
+ var level = 0;
+ var parent = widget.node.parent;
+ while (parent != null) {
+ if (parent.type == BulletedListBlockKeys.type) {
+ level++;
+ }
+ parent = parent.parent;
+ }
+ return level;
+ }
}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
index 86bd641a10..98b1b14af2 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart
@@ -8,6 +8,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.da
import 'package:appflowy/plugins/inline_actions/inline_actions_menu.dart';
import 'package:appflowy/shared/google_fonts_extension.dart';
import 'package:appflowy/util/font_family_extension.dart';
+import 'package:appflowy/util/string_extension.dart';
import 'package:appflowy/util/theme_extension.dart';
import 'package:appflowy/workspace/application/appearance_defaults.dart';
import 'package:appflowy/workspace/application/settings/appearance/appearance_cubit.dart';
@@ -198,7 +199,11 @@ class EditorStyleCustomizer {
fontSize = state.fontLayout.fontSize;
fontSizes = state.fontLayout.headingFontSizes;
} else {
- fontFamily = context.read<DocumentAppearanceCubit>().state.fontFamily;
+ fontFamily = context
+ .read<DocumentAppearanceCubit>()
+ .state
+ .fontFamily
+ .orDefault(context.read<AppearanceSettingsCubit>().state.font);
fontSize = context.read<DocumentAppearanceCubit>().state.fontSize;
fontSizes = [
fontSize + 16,
diff --git a/frontend/appflowy_flutter/lib/startup/tasks/app_widget.dart b/frontend/appflowy_flutter/lib/startup/tasks/app_widget.dart
index 1db404e90b..9c066abff1 100644
--- a/frontend/appflowy_flutter/lib/startup/tasks/app_widget.dart
+++ b/frontend/appflowy_flutter/lib/startup/tasks/app_widget.dart
@@ -7,6 +7,7 @@ import 'package:appflowy/shared/feature_flags.dart';
import 'package:appflowy/shared/icon_emoji_picker/icon_picker.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/user/application/user_settings_service.dart';
+import 'package:appflowy/util/font_family_extension.dart';
import 'package:appflowy/util/string_extension.dart';
import 'package:appflowy/workspace/application/action_navigation/action_navigation_bloc.dart';
import 'package:appflowy/workspace/application/action_navigation/navigation_action.dart';
@@ -239,8 +240,9 @@ class _ApplicationWidgetState extends State<ApplicationWidget> {
routerConfig: routerConfig,
builder: (context, child) {
final brightness = Theme.of(context).brightness;
- final fontFamily =
- state.font.orDefault(defaultFontFamily);
+ final fontFamily = state.font
+ .orDefault(defaultFontFamily)
+ .fontFamilyName;
return AppFlowyTheme(
data: brightness == Brightness.light
diff --git a/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart b/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart
index a1d93884c9..f4a98c4096 100644
--- a/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart
+++ b/frontend/appflowy_flutter/lib/user/application/reminder/reminder_bloc.dart
@@ -50,6 +50,7 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {
late final ReminderService _reminderService;
Timer? timer;
late final AppLifecycleListener _listener;
+ final _deepEquality = DeepCollectionEquality();
bool hasReminder(String reminderId) =>
state.allReminders.where((e) => e.id == reminderId).firstOrNull != null;
@@ -75,9 +76,20 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {
(reminders) async {
final availableReminders =
await filterAvailableReminders(reminders);
- Log.info(
- 'Fetched reminders on refresh: ${availableReminders.length}',
+ // only print the reminder ids are not the same as the previous ones
+ final previousReminderIds =
+ state.reminders.map((e) => e.id).toSet();
+ final newReminderIds =
+ availableReminders.map((e) => e.id).toSet();
+ final diff = _deepEquality.equals(
+ previousReminderIds,
+ newReminderIds,
);
+ if (!diff) {
+ Log.info(
+ 'Fetched reminders on refresh: ${availableReminders.length}',
+ );
+ }
if (!isClosed && !emit.isDone) {
emit(
state.copyWith(
diff --git a/frontend/appflowy_flutter/lib/util/font_family_extension.dart b/frontend/appflowy_flutter/lib/util/font_family_extension.dart
index 12fb5aaad0..d06c136526 100644
--- a/frontend/appflowy_flutter/lib/util/font_family_extension.dart
+++ b/frontend/appflowy_flutter/lib/util/font_family_extension.dart
@@ -1,4 +1,5 @@
import 'package:appflowy/generated/locale_keys.g.dart';
+import 'package:appflowy/shared/google_fonts_extension.dart';
import 'package:appflowy/shared/patterns/common_patterns.dart';
import 'package:appflowy/workspace/application/settings/appearance/base_appearance.dart';
import 'package:easy_localization/easy_localization.dart';
@@ -12,4 +13,11 @@ extension FontFamilyExtension on String {
String get fontFamilyDisplayName => isEmpty || this == defaultFontFamily
? LocaleKeys.settings_appearance_fontFamily_defaultFont.tr()
: parseFontFamilyName();
+
+ // the font display name is not the same as the font family name
+ // for example, the display name is "Noto Sans HK"
+ // the font family name is "NotoSansHK_Regular"
+ String get fontFamilyName => isEmpty || this == defaultFontFamily
+ ? defaultFontFamily
+ : getGoogleFontSafely(this).fontFamily ?? defaultFontFamily;
}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/inivitation/inivite_member_by_link.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/inivitation/inivite_member_by_link.dart
index 236651ebfa..9cd20d5236 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/inivitation/inivite_member_by_link.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/inivitation/inivite_member_by_link.dart
@@ -101,9 +101,7 @@ class _Description extends StatelessWidget {
LocaleKeys.settings_appearance_members_inviteFailedDialogTitle.tr(),
description:
LocaleKeys.settings_appearance_members_inviteFailedMemberLimit.tr(),
- confirmLabel: LocaleKeys
- .settings_appearance_members_memberLimitExceededUpgrade
- .tr(),
+ confirmLabel: LocaleKeys.upgradePlanModal_actionButton.tr(),
onConfirm: () => context
.read<WorkspaceMemberBloc>()
.add(const WorkspaceMemberEvent.upgradePlan()),
@@ -182,9 +180,7 @@ class _CopyLinkButtonState extends State<_CopyLinkButton> {
description: LocaleKeys
.settings_appearance_members_inviteFailedMemberLimit
.tr(),
- confirmLabel: LocaleKeys
- .settings_appearance_members_memberLimitExceededUpgrade
- .tr(),
+ confirmLabel: LocaleKeys.upgradePlanModal_actionButton.tr(),
onConfirm: () => context
.read<WorkspaceMemberBloc>()
.add(const WorkspaceMemberEvent.upgradePlan()),
diff --git a/frontend/appflowy_flutter/macos/Podfile.lock b/frontend/appflowy_flutter/macos/Podfile.lock
index 9709711e3b..879f010c46 100644
--- a/frontend/appflowy_flutter/macos/Podfile.lock
+++ b/frontend/appflowy_flutter/macos/Podfile.lock
@@ -135,32 +135,32 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
- app_links: 10e0a0ab602ffaf34d142cd4862f29d34b303b2a
- appflowy_backend: 865496343de667fc8c600e04b9fd05234e130cf9
- auto_updater_macos: 3e3462c418fe4e731917eacd8d28eef7af84086d
- bitsdojo_window_macos: 44e3b8fe3dd463820e0321f6256c5b1c16bb6a00
- connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
- desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
- device_info_plus: 1b14eed9bf95428983aed283a8d51cce3d8c4215
- file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d
- flowy_infra_ui: 03301a39ad118771adbf051a664265c61c507f38
+ app_links: 9028728e32c83a0831d9db8cf91c526d16cc5468
+ appflowy_backend: 464aeb3e5c6966a41641a2111e5ead72ce2695f7
+ auto_updater_macos: 3a42f1a06be6981f1a18be37e6e7bf86aa732118
+ bitsdojo_window_macos: 7959fb0ca65a3ccda30095c181ecb856fae48ea9
+ connectivity_plus: e74b9f74717d2d99d45751750e266e55912baeb5
+ desktop_drop: e0b672a7d84c0a6cbc378595e82cdb15f2970a43
+ device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76
+ file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
+ flowy_infra_ui: 8760ff42a789de40bf5007a5f176b454722a341e
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
HotKey: 400beb7caa29054ea8d864c96f5ba7e5b4852277
- hotkey_manager: c32bf0bfe8f934b7bc17ab4ad5c4c142960b023c
- irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478
- local_notifier: e9506bc66fc70311e8bc7291fb70f743c081e4ff
- package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b
- path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
+ hotkey_manager: b443f35f4d772162937aa73fd8995e579f8ac4e2
+ irondash_engine_context: 893c7d96d20ce361d7e996f39d360c4c2f9869ba
+ local_notifier: ebf072651e35ae5e47280ad52e2707375cb2ae4e
+ package_info_plus: f0052d280d17aa382b932f399edf32507174e870
+ path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
ReachabilitySwift: 32793e867593cfc1177f5d16491e3a197d2fccda
- screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161
- share_plus: 1fa619de8392a4398bfaf176d441853922614e89
- shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
+ screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
+ share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc
+ shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
Sparkle: 9c328bdcfbcaf8f030c4b678eadfd0fcb03822d8
- sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
- super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3
- url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404
- webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4
- window_manager: 990c8e348c4da2a93b81da638245d40554ec9436
+ sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
+ super_native_extensions: c2795d6d9aedf4a79fae25cb6160b71b50549189
+ url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
+ webview_flutter_wkwebview: 44d4dee7d7056d5ad185d25b38404436d56c547c
+ window_manager: e8d0b1431ab6c454f2b5c9ae26004bbfa43469aa
PODFILE CHECKSUM: 0532f3f001ca3110b8be345d6491fff690e95823