Skip to content

Commit f6f19a0

Browse files
committed
chore: display ai model desc on setting page
1 parent b83b964 commit f6f19a0

3 files changed

Lines changed: 30 additions & 8 deletions

File tree

frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/model_selection.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class AIModelSelection extends StatelessWidget {
4646
context,
4747
value: model,
4848
label: model.i18n,
49+
subLabel: model.desc,
50+
maximumHeight: 49,
4951
),
5052
)
5153
.toList(),

frontend/appflowy_flutter/lib/workspace/presentation/settings/shared/af_dropdown_menu_entry.dart

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,40 @@ DropdownMenuEntry<T> buildDropdownMenuEntry<T>(
99
BuildContext context, {
1010
required T value,
1111
required String label,
12+
String? subLabel,
1213
T? selectedValue,
1314
Widget? leadingWidget,
1415
Widget? trailingWidget,
1516
String? fontFamily,
17+
double maximumHeight = 29,
1618
}) {
1719
final fontFamilyUsed = fontFamily != null
1820
? getGoogleFontSafely(fontFamily).fontFamily ?? defaultFontFamily
1921
: defaultFontFamily;
22+
Widget? labelWidget;
23+
if (subLabel != null) {
24+
labelWidget = Column(
25+
crossAxisAlignment: CrossAxisAlignment.start,
26+
children: [
27+
FlowyText.regular(
28+
label,
29+
fontSize: 14,
30+
),
31+
const VSpace(4),
32+
FlowyText.regular(
33+
subLabel,
34+
fontSize: 10,
35+
),
36+
],
37+
);
38+
} else {
39+
labelWidget = FlowyText.regular(
40+
label,
41+
fontSize: 14,
42+
textAlign: TextAlign.start,
43+
fontFamily: fontFamilyUsed,
44+
);
45+
}
2046

2147
return DropdownMenuEntry<T>(
2248
style: ButtonStyle(
@@ -26,17 +52,12 @@ DropdownMenuEntry<T> buildDropdownMenuEntry<T>(
2652
const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
2753
),
2854
minimumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
29-
maximumSize: const WidgetStatePropertyAll(Size(double.infinity, 29)),
55+
maximumSize: WidgetStatePropertyAll(Size(double.infinity, maximumHeight)),
3056
),
3157
value: value,
3258
label: label,
3359
leadingIcon: leadingWidget,
34-
labelWidget: FlowyText.regular(
35-
label,
36-
fontSize: 14,
37-
textAlign: TextAlign.start,
38-
fontFamily: fontFamilyUsed,
39-
),
60+
labelWidget: labelWidget,
4061
trailingIcon: Row(
4162
children: [
4263
if (trailingWidget != null) ...[

frontend/rust-lib/flowy-ai/src/entities.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::collections::HashMap;
33

44
use crate::local_ai::controller::LocalAISetting;
55
use crate::local_ai::resource::PendingResource;
6-
use flowy_ai_pub::cloud::ai_dto::AvailableModel;
76
use flowy_ai_pub::cloud::{
87
AIModel, ChatMessage, ChatMessageMetadata, ChatMessageType, CompletionMessage, LLMModel,
98
OutputContent, OutputLayout, RelatedQuestion, RepeatedChatMessage, RepeatedRelatedQuestion,

0 commit comments

Comments
 (0)