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.

chore: improve empty ai prompt list placeholder (#7917)

Richard Shiue5e99eeb16797
diff --git a/frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart b/frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart
index 3f5fba16b7..26f91d2c48 100644
--- a/frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart
+++ b/frontend/appflowy_flutter/lib/ai/widgets/ai_prompt_modal/ai_prompt_visible_list.dart
@@ -128,14 +128,7 @@ class _AiPromptVisibleListState extends State<AiPromptVisibleList> {
return state.maybeMap(
ready: (readyState) {
if (readyState.visiblePrompts.isEmpty) {
- return Center(
- child: Text(
- LocaleKeys.ai_customPrompt_noResults.tr(),
- style: theme.textStyle.body.standard(
- color: theme.textColorScheme.primary,
- ),
- ),
- );
+ return buildEmptyPrompts();
}
return buildPromptList();
},
@@ -185,6 +178,31 @@ class _AiPromptVisibleListState extends State<AiPromptVisibleList> {
);
}
+ Widget buildEmptyPrompts() {
+ final theme = AppFlowyTheme.of(context);
+
+ return Center(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ FlowySvg(
+ FlowySvgs.m_home_search_icon_m,
+ color: theme.iconColorScheme.secondary,
+ size: Size.square(24),
+ ),
+ VSpace(theme.spacing.m),
+ Text(
+ LocaleKeys.ai_customPrompt_noResults.tr(),
+ style: theme.textStyle.body
+ .standard(color: theme.textColorScheme.secondary),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ],
+ ),
+ );
+ }
+
Widget buildPromptList() {
final theme = AppFlowyTheme.of(context);