diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1a62eb4..645a13d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -381,7 +381,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 266; + CURRENT_PROJECT_VERSION = 267; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -512,7 +512,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 266; + CURRENT_PROJECT_VERSION = 267; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -537,7 +537,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 266; + CURRENT_PROJECT_VERSION = 267; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; diff --git a/lib/data/res/build.dart b/lib/data/res/build.dart index dd7dbae..4ba24cd 100644 --- a/lib/data/res/build.dart +++ b/lib/data/res/build.dart @@ -2,5 +2,5 @@ class Build { static const String name = "GPTBox"; - static const int build = 266; + static const int build = 267; } diff --git a/lib/view/page/home/bottom.dart b/lib/view/page/home/bottom.dart index 522ce2a..b4cce97 100644 --- a/lib/view/page/home/bottom.dart +++ b/lib/view/page/home/bottom.dart @@ -296,6 +296,10 @@ final class _ChatSettingsState extends State<_ChatSettings> { settings.value = settings.value.copyWith( ignoreContextConstraint: !val.ignoreContextConstraint, ); + if (settings.value.headTailMode && + settings.value.ignoreContextConstraint) { + settings.value = settings.value.copyWith(headTailMode: false); + } _save(); }, ); @@ -340,6 +344,11 @@ final class _ChatSettingsState extends State<_ChatSettings> { onChanged: (_) { settings.value = settings.value.copyWith(headTailMode: !val.headTailMode); + if (settings.value.headTailMode && + settings.value.ignoreContextConstraint) { + settings.value = + settings.value.copyWith(ignoreContextConstraint: false); + } _save(); }, ); diff --git a/lib/view/page/home/ctrl.dart b/lib/view/page/home/ctrl.dart index b5c1414..ba7e70b 100644 --- a/lib/view/page/home/ctrl.dart +++ b/lib/view/page/home/ctrl.dart @@ -417,7 +417,6 @@ void _onTapEditMsg(BuildContext context, ChatHistoryItem chatItem) async { minLines: 1, autoCorrect: true, autoFocus: true, - suggestion: true, action: TextInputAction.send, onSubmitted: (p0) { chatItem.content.clear(); diff --git a/lib/view/page/profile.dart b/lib/view/page/profile.dart index 5ceeba4..d5a0209 100644 --- a/lib/view/page/profile.dart +++ b/lib/view/page/profile.dart @@ -149,7 +149,11 @@ final class _ProfilePageState extends State { final ctrl = TextEditingController(text: cfg.name); context.showRoundDialog( title: l10n.edit, - child: Input(controller: ctrl, label: l10n.name), + child: Input( + controller: ctrl, + label: l10n.name, + autoFocus: true, + ), actions: Btns.oks( onTap: () { final name = ctrl.text; @@ -190,7 +194,11 @@ final class _ProfilePageState extends State { final ctrl = TextEditingController(); final ok = await context.showRoundDialog( title: l10n.add, - child: Input(controller: ctrl, label: l10n.name), + child: Input( + controller: ctrl, + label: l10n.name, + autoFocus: true, + ), actions: Btns.oks(onTap: () => context.pop(true)), ); if (ok != true) return; @@ -240,6 +248,7 @@ final class _ProfilePageState extends State { controller: ctrl, hint: 'sk-xxx', maxLines: 3, + autoFocus: true, ), actions: Btns.oks( onTap: () => context.pop(ctrl.text), @@ -270,6 +279,7 @@ final class _ProfilePageState extends State { controller: ctrl, hint: 'https://api.openai.com', maxLines: 3, + autoFocus: true, ), actions: Btns.oks( onTap: () => context.pop(ctrl.text), @@ -351,6 +361,7 @@ final class _ProfilePageState extends State { child: Input( controller: ctrl, hint: kChatModel, + autoFocus: true, onSubmitted: (s) => onSave(s), ), actions: Btns.oks(onTap: () => onSave(ctrl.text)), @@ -454,6 +465,7 @@ final class _ProfilePageState extends State { child: Input( controller: ctrl, maxLines: 3, + autoFocus: true, ), actions: Btns.oks(onTap: () => context.pop(ctrl.text)), ); @@ -480,6 +492,7 @@ final class _ProfilePageState extends State { child: Input( controller: ctrl, hint: '7', + autoFocus: true, type: TextInputType.number, ), actions: Btns.oks( diff --git a/lib/view/page/setting.dart b/lib/view/page/setting.dart index d386cff..cfb2513 100644 --- a/lib/view/page/setting.dart +++ b/lib/view/page/setting.dart @@ -139,6 +139,7 @@ class _SettingPageState extends State { controller: ctrl, hint: '#8b2252', icon: Icons.colorize, + autoFocus: true, ), ColorPicker( color: primaryColor, @@ -405,6 +406,7 @@ class _SettingPageState extends State { controller: ctrl, type: TextInputType.name, maxLength: 7, + autoFocus: true, onSubmitted: (s) => onSave(s), ), actions: Btns.oks(onTap: () => onSave(ctrl.text)), diff --git a/lib/view/page/tool.dart b/lib/view/page/tool.dart index 0e9b9d9..7a56805 100644 --- a/lib/view/page/tool.dart +++ b/lib/view/page/tool.dart @@ -87,6 +87,7 @@ class _ToolPageState extends State { child: Input( controller: ctrl, maxLines: 3, + autoFocus: true, onSubmitted: onSave, ), actions: Btns.oks(onTap: () => onSave(ctrl.text)), diff --git a/pubspec.lock b/pubspec.lock index a9de95d..457571d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -407,8 +407,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.0.78" - resolved-ref: "552c4095eb6074bed55724d2a04be0596e2d2ea7" + ref: "v1.0.79" + resolved-ref: f1bc7dd5ec2af84813b33a9e2149e117dfea3cd0 url: "https://github.com/lppcg/fl_lib" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index a6e55e7..39688e6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: gpt_box description: "A third-party GPT Client for OpenAI API." publish_to: 'none' -version: 1.0.266+266 +version: 1.0.267+267 environment: sdk: '>=3.3.0 <4.0.0' @@ -36,7 +36,7 @@ dependencies: fl_lib: git: url: https://github.com/lppcg/fl_lib - ref: v1.0.78 + ref: v1.0.79 dependency_overrides: # fl_lib: