feat: refine AI navigation and accessibility recovery

This commit is contained in:
2026-08-26 22:58:26 +08:00
parent c6f98b5445
commit 9ccbdfead4
15 changed files with 521 additions and 203 deletions
+54 -34
View File
@@ -743,7 +743,8 @@ class _ChatPageState extends State<ChatPage> {
}
Widget _inputBar(BuildContext context) {
final sendEnabled = _ctrl.text.trim().isNotEmpty && !_sending;
final hasText = _ctrl.text.trim().isNotEmpty;
final sendEnabled = hasText && !_sending;
final accent = widget.aiMode ? AppTheme.ai : AppTheme.primary;
return Container(
color: context.jz.card,
@@ -866,23 +867,59 @@ class _ChatPageState extends State<ChatPage> {
),
SizedBox(width: 6),
],
SizedBox(
width: 50,
height: 38,
child: FilledButton(
onPressed: sendEnabled ? _send : null,
style: FilledButton.styleFrom(
padding: EdgeInsets.zero,
backgroundColor: accent,
disabledBackgroundColor: context.jz.line,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(11),
AnimatedSize(
duration: const Duration(milliseconds: 180),
curve: Curves.easeOutCubic,
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 160),
transitionBuilder: (child, animation) => FadeTransition(
opacity: animation,
child: ScaleTransition(
scale: Tween<double>(begin: 0.9, end: 1).animate(animation),
child: child,
),
),
child: Text(
'发送',
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.w700),
),
child: hasText
? SizedBox(
key: const ValueKey('send-message'),
width: 50,
height: 38,
child: FilledButton(
onPressed: sendEnabled ? _send : null,
style: FilledButton.styleFrom(
padding: EdgeInsets.zero,
backgroundColor: accent,
disabledBackgroundColor: context.jz.line,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(11),
),
),
child: Text(
'发送',
style: TextStyle(
fontSize: 12.5,
fontWeight: FontWeight.w700,
),
),
),
)
: PublicConfigApi.imageEnabled
? SizedBox(
key: const ValueKey('add-attachment'),
width: 42,
height: 42,
child: IconButton(
tooltip: '添加附件',
onPressed: _sending ? null : _openAttachment,
icon: AppIcons.icon(
AppIcons.plus,
size: 22,
color: _sending ? context.jz.text3 : context.jz.text2,
),
padding: EdgeInsets.zero,
),
)
: const SizedBox.shrink(key: ValueKey('no-composer-action')),
),
),
],
@@ -948,24 +985,6 @@ class _ChatPageState extends State<ChatPage> {
),
),
),
if (PublicConfigApi.imageEnabled)
Padding(
padding: const EdgeInsets.only(right: 8),
child: ActionChip(
avatar: AppIcons.icon(
AppIcons.camera,
size: 16,
color: AppTheme.ai,
),
label: Text(
'附件',
style: TextStyle(fontSize: 11, color: context.jz.text2),
),
backgroundColor: context.jz.background,
side: BorderSide.none,
onPressed: _openAttachment,
),
),
],
),
),
@@ -1280,6 +1299,7 @@ class _ChatTabPageState extends State<ChatTabPage> {
final status = switch (accessState) {
AiAccessState.guest => '登录后可用',
AiAccessState.reauthenticate => '需要重新登录',
AiAccessState.aiDisabled => 'AI 功能已关闭',
AiAccessState.cloudDisabled => '云连接已关闭',
null => '在线',
};