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: display ai model desc on setting page

Nathanf6f19a0a078c
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart
index 3df5ad3987..2c4c4fa920 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart
@@ -46,6 +46,8 @@ class AIModelSelection extends StatelessWidget {
context,
value: model,
label: model.i18n,
+ subLabel: model.desc,
+ maximumHeight: 49,
),
)
.toList(),
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/af_dropdown_menu_entry.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/af_dropdown_menu_entry.dart
index d005901cff..1d1e58626c 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/af_dropdown_menu_entry.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/af_dropdown_menu_entry.dart
@@ -9,14 +9,40 @@ DropdownMenuEntry<T> buildDropdownMenuEntry<T>(
BuildContext context, {
required T value,
required String label,
+ String? subLabel,
T? selectedValue,
Widget? leadingWidget,
Widget? trailingWidget,
String? fontFamily,
+ double maximumHeight = 29,
}) {
final fontFamilyUsed = fontFamily != null
? getGoogleFontSafely(fontFamily).fontFamily ?? defaultFontFamily
: defaultFontFamily;
+ Widget? labelWidget;
+ if (subLabel != null) {
+ labelWidget = Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ FlowyText.regular(
+ label,
+ fontSize: 14,
+ ),
+ const VSpace(4),
+ FlowyText.regular(
+ subLabel,
+ fontSize: 10,
+ ),
+ ],
+ );
+ } else {
+ labelWidget = FlowyText.regular(
+ label,
+ fontSize: 14,
+ textAlign: TextAlign.start,
+ fontFamily: fontFamilyUsed,
+ );
+ }
return DropdownMenuEntry<T>(
style: ButtonStyle(
@@ -26,17 +52,12 @@ DropdownMenuEntry<T> buildDropdownMenuEntry<T>(
const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
),
minimumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
- maximumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
+ maximumSize: WidgetStatePropertyAll(Size(double.infinity, maximumHeight)),
),
value: value,
label: label,
leadingIcon: leadingWidget,
- labelWidget: FlowyText.regular(
- label,
- fontSize: 14,
- textAlign: TextAlign.start,
- fontFamily: fontFamilyUsed,
- ),
+ labelWidget: labelWidget,
trailingIcon: Row(
children: [
if (trailingWidget != null) ...[
diff --git a/frontend/rust-lib/flowy-ai/src/entities.rs b/frontend/rust-lib/flowy-ai/src/entities.rs
index a0116a3388..353ff9d0a6 100644
--- a/frontend/rust-lib/flowy-ai/src/entities.rs
+++ b/frontend/rust-lib/flowy-ai/src/entities.rs
@@ -3,7 +3,6 @@ use std::collections::HashMap;
use crate::local_ai::controller::LocalAISetting;
use crate::local_ai::resource::PendingResource;
-use flowy_ai_pub::cloud::ai_dto::AvailableModel;
use flowy_ai_pub::cloud::{
AIModel, ChatMessage, ChatMessageMetadata, ChatMessageType, CompletionMessage, LLMModel,
OutputContent, OutputLayout, RelatedQuestion, RepeatedChatMessage, RepeatedRelatedQuestion,