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.

fix: don't allow selection of text in related questions or loading (#7500)

Richard Shiueeb0ed1ad86fc
diff --git a/frontend/appflowy_flutter/lib/ai/widgets/loading_indicator.dart b/frontend/appflowy_flutter/lib/ai/widgets/loading_indicator.dart
index e21ea95ac1..3a9c96b255 100644
--- a/frontend/appflowy_flutter/lib/ai/widgets/loading_indicator.dart
+++ b/frontend/appflowy_flutter/lib/ai/widgets/loading_indicator.dart
@@ -16,48 +16,50 @@ class AILoadingIndicator extends StatelessWidget {
@override
Widget build(BuildContext context) {
final slice = Duration(milliseconds: duration.inMilliseconds ~/ 5);
- return SizedBox(
- height: 20,
- child: SeparatedRow(
- separatorBuilder: () => const HSpace(4),
- children: [
- Padding(
- padding: const EdgeInsetsDirectional.only(end: 4.0),
- child: FlowyText(
- text,
- color: Theme.of(context).hintColor,
+ return SelectionContainer.disabled(
+ child: SizedBox(
+ height: 20,
+ child: SeparatedRow(
+ separatorBuilder: () => const HSpace(4),
+ children: [
+ Padding(
+ padding: const EdgeInsetsDirectional.only(end: 4.0),
+ child: FlowyText(
+ text,
+ color: Theme.of(context).hintColor,
+ ),
),
- ),
- buildDot(const Color(0xFF9327FF))
- .animate(onPlay: (controller) => controller.repeat())
- .slideY(duration: slice, begin: 0, end: -1)
- .then()
- .slideY(begin: -1, end: 1)
- .then()
- .slideY(begin: 1, end: 0)
- .then()
- .slideY(duration: slice * 2, begin: 0, end: 0),
- buildDot(const Color(0xFFFB006D))
- .animate(onPlay: (controller) => controller.repeat())
- .slideY(duration: slice, begin: 0, end: 0)
- .then()
- .slideY(begin: 0, end: -1)
- .then()
- .slideY(begin: -1, end: 1)
- .then()
- .slideY(begin: 1, end: 0)
- .then()
- .slideY(begin: 0, end: 0),
- buildDot(const Color(0xFFFFCE00))
- .animate(onPlay: (controller) => controller.repeat())
- .slideY(duration: slice * 2, begin: 0, end: 0)
- .then()
- .slideY(duration: slice, begin: 0, end: -1)
- .then()
- .slideY(begin: -1, end: 1)
- .then()
- .slideY(begin: 1, end: 0),
- ],
+ buildDot(const Color(0xFF9327FF))
+ .animate(onPlay: (controller) => controller.repeat())
+ .slideY(duration: slice, begin: 0, end: -1)
+ .then()
+ .slideY(begin: -1, end: 1)
+ .then()
+ .slideY(begin: 1, end: 0)
+ .then()
+ .slideY(duration: slice * 2, begin: 0, end: 0),
+ buildDot(const Color(0xFFFB006D))
+ .animate(onPlay: (controller) => controller.repeat())
+ .slideY(duration: slice, begin: 0, end: 0)
+ .then()
+ .slideY(begin: 0, end: -1)
+ .then()
+ .slideY(begin: -1, end: 1)
+ .then()
+ .slideY(begin: 1, end: 0)
+ .then()
+ .slideY(begin: 0, end: 0),
+ buildDot(const Color(0xFFFFCE00))
+ .animate(onPlay: (controller) => controller.repeat())
+ .slideY(duration: slice * 2, begin: 0, end: 0)
+ .then()
+ .slideY(duration: slice, begin: 0, end: -1)
+ .then()
+ .slideY(begin: -1, end: 1)
+ .then()
+ .slideY(begin: 1, end: 0),
+ ],
+ ),
),
);
}
diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_related_question.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_related_question.dart
index 9e4cc603b0..cc21cfc80e 100644
--- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_related_question.dart
+++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/chat_related_question.dart
@@ -21,33 +21,35 @@ class RelatedQuestionList extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return ListView.separated(
- shrinkWrap: true,
- physics: const NeverScrollableScrollPhysics(),
- itemCount: relatedQuestions.length + 1,
- padding:
- const EdgeInsets.only(bottom: 8.0) + AIChatUILayout.messageMargin,
- separatorBuilder: (context, index) => const VSpace(4.0),
- itemBuilder: (context, index) {
- if (index == 0) {
- return Padding(
- padding: const EdgeInsets.only(bottom: 4.0),
- child: FlowyText(
- LocaleKeys.chat_relatedQuestion.tr(),
- color: Theme.of(context).hintColor,
- fontWeight: FontWeight.w600,
- ),
- );
- } else {
- return Align(
- alignment: AlignmentDirectional.centerStart,
- child: RelatedQuestionItem(
- question: relatedQuestions[index - 1],
- onQuestionSelected: onQuestionSelected,
- ),
- );
- }
- },
+ return SelectionContainer.disabled(
+ child: ListView.separated(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: relatedQuestions.length + 1,
+ padding:
+ const EdgeInsets.only(bottom: 8.0) + AIChatUILayout.messageMargin,
+ separatorBuilder: (context, index) => const VSpace(4.0),
+ itemBuilder: (context, index) {
+ if (index == 0) {
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 4.0),
+ child: FlowyText(
+ LocaleKeys.chat_relatedQuestion.tr(),
+ color: Theme.of(context).hintColor,
+ fontWeight: FontWeight.w600,
+ ),
+ );
+ } else {
+ return Align(
+ alignment: AlignmentDirectional.centerStart,
+ child: RelatedQuestionItem(
+ question: relatedQuestions[index - 1],
+ onQuestionSelected: onQuestionSelected,
+ ),
+ );
+ }
+ },
+ ),
);
}
}