chore: simplify bot settings (#2325)
This commit is contained in:
parent
4d6f1196ba
commit
1b18810c83
2 changed files with 37 additions and 36 deletions
|
|
@ -131,6 +131,9 @@ class ConversationBotSettingsDialogState
|
|||
? BotOptionsModel.fromJson(widget.room.botOptions?.toJson())
|
||||
: BotOptionsModel();
|
||||
|
||||
botOptions.targetLanguage ??=
|
||||
MatrixState.pangeaController.languageController.userL2?.langCode;
|
||||
|
||||
widget.room.botIsInRoom.then((bool isBotRoom) {
|
||||
setState(() => addBot = isBotRoom);
|
||||
});
|
||||
|
|
@ -297,7 +300,7 @@ class ConversationBotSettingsDialogState
|
|||
return FullWidthDialog(
|
||||
dialogContent: dialogContent,
|
||||
maxWidth: 450,
|
||||
maxHeight: 725,
|
||||
maxHeight: 400,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
||||
import 'package:fluffychat/pangea/chat_settings/models/bot_options_model.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/conversation_bot/conversation_bot_mode_dynamic_zone.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/conversation_bot/conversation_bot_mode_select.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/conversation_bot/conversation_bot_no_permission_dialog.dart';
|
||||
import 'package:fluffychat/pangea/chat_settings/widgets/language_level_dropdown.dart';
|
||||
import 'package:fluffychat/pangea/learning_settings/enums/language_level_type_enum.dart';
|
||||
|
|
@ -76,39 +74,39 @@ class ConversationBotSettingsForm extends StatelessWidget {
|
|||
enabled: enabled,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
L10n.of(context).conversationBotModeSelectDescription,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: hasPermission ? null : () => showNoPermissionDialog(context),
|
||||
child: ConversationBotModeSelect(
|
||||
initialMode: hasUpdatedMode ? botOptions.mode : null,
|
||||
onChanged: hasPermission && enabled ? onUpdateBotMode : null,
|
||||
enabled: enabled,
|
||||
validator: (value) {
|
||||
return value == null && enabled
|
||||
? L10n.of(context).botModeValidation
|
||||
: null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ConversationBotModeDynamicZone(
|
||||
discussionTopicController: discussionTopicController,
|
||||
discussionKeywordsController: discussionKeywordsController,
|
||||
customSystemPromptController: customSystemPromptController,
|
||||
enabled: enabled,
|
||||
hasPermission: hasPermission,
|
||||
mode: hasUpdatedMode ? botOptions.mode : null,
|
||||
),
|
||||
// const SizedBox(height: 12),
|
||||
// Align(
|
||||
// alignment: Alignment.centerLeft,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
// child: Text(
|
||||
// L10n.of(context).conversationBotModeSelectDescription,
|
||||
// style: Theme.of(context).textTheme.titleLarge,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: hasPermission ? null : () => showNoPermissionDialog(context),
|
||||
// child: ConversationBotModeSelect(
|
||||
// initialMode: hasUpdatedMode ? botOptions.mode : null,
|
||||
// onChanged: hasPermission && enabled ? onUpdateBotMode : null,
|
||||
// enabled: enabled,
|
||||
// validator: (value) {
|
||||
// return value == null && enabled
|
||||
// ? L10n.of(context).botModeValidation
|
||||
// : null;
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(height: 12),
|
||||
// ConversationBotModeDynamicZone(
|
||||
// discussionTopicController: discussionTopicController,
|
||||
// discussionKeywordsController: discussionKeywordsController,
|
||||
// customSystemPromptController: customSystemPromptController,
|
||||
// enabled: enabled,
|
||||
// hasPermission: hasPermission,
|
||||
// mode: hasUpdatedMode ? botOptions.mode : null,
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue