feat: write the UI in English, select only conversation content

- source strings are English again; Chinese comes from lib/l10n/zh.dart
  through tr()/trArgs() and AppText, and a language without a table
  (Spanish, ...) reads English instead of Chinese
- server and user data (titles, messages, file names, notes, task names)
  is drawn with plain Text, so it is never looked up in the table
- SelectionArea moved from the whole message list to the messages, the
  answer text, an opened tool call's details and the turn footer; status
  lines and folded tool rows no longer start a selection
- a message the transcript does not know (its start event was lost while
  the stream was down) fetches the tail once, so a turn continued from
  another client comes in with its prompt
- bump to 0.5.3
This commit is contained in:
blumia committed 2026-11-26 11:48:16 +08:00
1 parent 7b5bccf28f
commit 511c3b006b
43 files changed
+1620 -1791

No files matched your search

+26 -26
View File
@@ -87,8 +87,8 @@ class _ShellTaskBarState extends State<ShellTaskBar> {
Icon(Icons.terminal, size: 15, color: theme.hintColor),
const SizedBox(width: 8),
Expanded(
child: AppText(
trArgs('正在执行 {0} 条命令', [count]),
child: Text(
trArgs('Running {0} commands', [count]),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@@ -131,7 +131,7 @@ class _ShellTaskRow extends StatelessWidget {
Icon(Icons.terminal, size: 15, color: theme.hintColor),
const SizedBox(width: 8),
Expanded(
child: AppText(
child: Text(
task.command.replaceAll(RegExp(r'\s+'), ' ').trim(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
@@ -141,7 +141,7 @@ class _ShellTaskRow extends StatelessWidget {
),
if (subagent) ...[
const SizedBox(width: 6),
AppText('子代理',
AppText('Subagent',
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.onSurfaceVariant,
@@ -195,7 +195,7 @@ class _ShellElapsedState extends State<ShellElapsed> {
if (widget.startedAt <= 0 || !widget.running) return const SizedBox.shrink();
final label =
formatElapsed(DateTime.now().millisecondsSinceEpoch - widget.startedAt);
return AppText(
return Text(
label,
style: TextStyle(
fontSize: 12,
@@ -338,7 +338,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
Icon(Icons.terminal, size: 18, color: theme.hintColor),
const SizedBox(width: 10),
Expanded(
child: AppText(
child: Text(
widget.task.command,
maxLines: 2,
overflow: TextOverflow.ellipsis,
@@ -362,7 +362,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
Icon(Icons.check_circle_outline,
size: 15, color: theme.hintColor),
const SizedBox(width: 6),
AppText('已结束',
AppText('Ended',
style:
TextStyle(fontSize: 12, color: theme.hintColor)),
],
@@ -371,7 +371,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
TextButton.icon(
onPressed: _stopping ? null : _stop,
icon: const Icon(Icons.stop_rounded, size: 17),
label: AppText(_stopping ? '停止中…' : '停止'),
label: AppText(_stopping ? 'Stopping…' : 'Stop'),
style: TextButton.styleFrom(
foregroundColor: theme.colorScheme.error,
minimumSize: const Size(0, 32),
@@ -381,7 +381,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
TextButton.icon(
onPressed: _text.isEmpty ? null : _copy,
icon: const Icon(Icons.copy, size: 15),
label: const AppText('复制'),
label: const AppText('Copy'),
style: TextButton.styleFrom(
minimumSize: const Size(0, 32),
padding: const EdgeInsets.symmetric(horizontal: 10),
@@ -412,10 +412,10 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
AppText(
_feed.error ??
(!_feed.loaded
? '读取输出…'
? 'Reading output…'
: running
? '等待输出…'
: '没有输出'),
? 'Waiting for output…'
: 'No output'),
style: TextStyle(
fontSize: 13, color: theme.hintColor),
),
@@ -447,7 +447,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
_onFeed();
},
icon: const Icon(Icons.arrow_downward, size: 15),
label: const AppText('回到最新'),
label: const AppText('Jump to latest'),
style: FilledButton.styleFrom(
visualDensity: VisualDensity.compact,
),
@@ -465,7 +465,7 @@ class _ShellOutputSheetState extends State<ShellOutputSheet> {
await Clipboard.setData(ClipboardData(text: _text));
if (mounted) {
ScaffoldMessenger.of(context)
.showSnackBar(const SnackBar(content: AppText('已复制输出')));
.showSnackBar(const SnackBar(content: AppText('Output copied')));
}
}
}
@@ -542,15 +542,15 @@ class _ShellOutputInlineState extends State<ShellOutputInline> {
children: [
Icon(Icons.terminal, size: 15, color: theme.hintColor),
const SizedBox(width: 8),
AppText('后台输出',
AppText('Background output',
style: TextStyle(fontSize: 12, color: theme.hintColor)),
const SizedBox(width: 8),
if (!ended)
AppText('运行中',
AppText('Running',
style: TextStyle(
fontSize: 12, color: theme.colorScheme.primary)),
if (ended && text.isEmpty)
AppText('已结束',
AppText('Ended',
style:
TextStyle(fontSize: 12, color: theme.hintColor)),
const Spacer(),
@@ -563,7 +563,7 @@ class _ShellOutputInlineState extends State<ShellOutputInline> {
padding: const EdgeInsets.symmetric(horizontal: 8),
textStyle: const TextStyle(fontSize: 12.5),
),
child: const AppText('停止'),
child: const AppText('Stop'),
),
TextButton(
onPressed: widget.onOpen,
@@ -572,7 +572,7 @@ class _ShellOutputInlineState extends State<ShellOutputInline> {
padding: const EdgeInsets.symmetric(horizontal: 8),
textStyle: const TextStyle(fontSize: 12.5),
),
child: const AppText('查看全部'),
child: const AppText('View all'),
),
],
),
@@ -580,7 +580,7 @@ class _ShellOutputInlineState extends State<ShellOutputInline> {
Padding(
padding: const EdgeInsets.only(bottom: 6),
child: AppText(
_feed.error ?? (ended ? '没有输出' : '等待输出…'),
_feed.error ?? (ended ? 'No output' : 'Waiting for output…'),
style: TextStyle(fontSize: 12, color: theme.hintColor)),
)
else
@@ -615,8 +615,8 @@ Future<bool?> confirmStopShell(BuildContext context, String command) {
return showDialog<bool>(
context: context,
builder: (dialog) => AlertDialog(
title: const AppText('停止这个任务?'),
content: AppText(
title: const AppText('Stop this task?'),
content: Text(
command,
maxLines: 4,
overflow: TextOverflow.ellipsis,
@@ -625,14 +625,14 @@ Future<bool?> confirmStopShell(BuildContext context, String command) {
actions: [
TextButton(
onPressed: () => Navigator.pop(dialog, false),
child: const AppText('取消')),
child: const AppText('Cancel')),
FilledButton(
style: FilledButton.styleFrom(
backgroundColor: Theme.of(dialog).colorScheme.error,
foregroundColor: Theme.of(dialog).colorScheme.onError,
),
onPressed: () => Navigator.pop(dialog, true),
child: const AppText('停止'),
child: const AppText('Stop'),
),
],
),
@@ -728,11 +728,11 @@ class ShellOutputFeed {
_timer?.cancel();
_timer = null;
} else {
error = trArgs('读取输出失败:{0}', [e.message]);
error = trArgs('Could not read output: {0}', [e.message]);
}
_onUpdate?.call();
} catch (e) {
error = trArgs('读取输出失败:{0}', ['$e']);
error = trArgs('Could not read output: {0}', ['$e']);
_onUpdate?.call();
} finally {
_busy = false;