fix: match the background task bar to the activity strip
- draw the task bar in the activity strip's capsule (8px margins, 14px padding, 36px min height, stadium radius) so the two read as one stack - drop the stop button from the bar: its padding pushed the clock off the right edge shared with the strip above; the row opens the sheet instead - in the sheet, show only the clock while running, a stop button with a stop icon, and "已结束" once the command ends; no "运行中" label and no close x (the drag handle and the scrim already close it) - say "读取输出…" while the first page loads instead of claiming the command has printed nothing - rest the pet's feet on the status capsule's edge (4px top margin) instead of sinking 2px into it
This commit is contained in:
1 parent
c4de5e84d8
commit
9564019a91
7 files changed
+142
-86
No files matched your search
@@ -250,7 +250,8 @@ void main() {
|
||||
startedAt: DateTime.now().millisecondsSinceEpoch - 65000,
|
||||
);
|
||||
|
||||
Future<void> pump(WidgetTester tester, List<ShellTask> tasks) async {
|
||||
Future<void> pump(WidgetTester tester, List<ShellTask> tasks,
|
||||
{void Function(ShellTask)? onOpen}) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Column(
|
||||
@@ -258,8 +259,7 @@ void main() {
|
||||
ShellTaskBar(
|
||||
tasks: tasks,
|
||||
sessionId: 'ses_a',
|
||||
onOpen: (_) {},
|
||||
onStop: (_) {},
|
||||
onOpen: onOpen ?? (_) {},
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -267,13 +267,17 @@ void main() {
|
||||
));
|
||||
}
|
||||
|
||||
testWidgets('one command is its own row, with stop and clock',
|
||||
(tester) async {
|
||||
await pump(tester, [task('sh_1', command: 'pnpm dev')]);
|
||||
testWidgets('one command is its own row, with its clock', (tester) async {
|
||||
ShellTask? opened;
|
||||
await pump(tester, [task('sh_1', command: 'pnpm dev')],
|
||||
onOpen: (t) => opened = t);
|
||||
expect(find.text('pnpm dev'), findsOneWidget);
|
||||
expect(find.text('停止'), findsOneWidget);
|
||||
expect(find.text('1分05秒'), findsOneWidget);
|
||||
expect(find.textContaining('正在执行'), findsNothing);
|
||||
// Stopping is in the sheet the row opens, not a button on the bar.
|
||||
expect(find.text('停止'), findsNothing);
|
||||
await tester.tap(find.text('pnpm dev'));
|
||||
expect(opened?.id, 'sh_1');
|
||||
});
|
||||
|
||||
testWidgets('two commands share a count header and both show',
|
||||
@@ -286,7 +290,7 @@ void main() {
|
||||
expect(find.text('pnpm dev'), findsOneWidget);
|
||||
expect(find.text('pnpm test'), findsOneWidget);
|
||||
expect(find.text('子代理'), findsOneWidget);
|
||||
expect(find.text('停止'), findsNWidgets(2));
|
||||
expect(find.text('停止'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('a long list folds until asked', (tester) async {
|
||||
|
||||
Reference in new issue
Block a user