ui: one row height and one trailing line in the sidebar, and a dsh-Go activity cap
- The project header is a ListTile now, like a session row: both are 72 high (title + subtitle). A Material 3 list tile ends at 24, so the band's 8px inset gets 16 more, putting the project + and the session ⋮ on one line (a widget test asserts both the heights and the x centres). - The running status is a full-width stadium like dsh-Go's activity strip: title and current-step summary on the left, a tabular m:ss clock on the right, translucent surface, 36 minimum height. The spinner inside is gone; the cap's top edge is where the future input-box pet will perch. - 0.3.20 (320).
This commit is contained in:
1 parent
6ced914757
commit
73af9d851b
6 files changed
+200
-132
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:openchamber/api/models.dart';
|
||||
import 'package:openchamber/screens/sessions_screen.dart';
|
||||
import 'package:openchamber/state.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('the project band matches a session row and keeps the keys in line',
|
||||
(tester) async {
|
||||
final app = AppState();
|
||||
final now = DateTime.now().millisecondsSinceEpoch;
|
||||
app.sessions = [
|
||||
Session(
|
||||
id: 's1',
|
||||
title: '标签页拖拽与分屏',
|
||||
agent: 'build',
|
||||
location: Location(r'C:\msys64\home\Gary\Sources\pineapple-notepad'),
|
||||
created: now,
|
||||
updated: now,
|
||||
),
|
||||
];
|
||||
addTearDown(app.dispose);
|
||||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(body: SessionListPane(app: app)),
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// A Windows path names the folder, not the whole path.
|
||||
expect(find.text('pineapple-notepad'), findsOneWidget);
|
||||
|
||||
final header = find.ancestor(
|
||||
of: find.text('pineapple-notepad'),
|
||||
matching: find.byType(ListTile),
|
||||
);
|
||||
final row = find.ancestor(
|
||||
of: find.text('标签页拖拽与分屏'),
|
||||
matching: find.byType(ListTile),
|
||||
);
|
||||
expect(tester.getSize(header).height, tester.getSize(row).height);
|
||||
|
||||
// The project's + and the session's ⋮ share one vertical line.
|
||||
final add = tester.getCenter(find.byTooltip('在此项目新会话'));
|
||||
final menu = tester.getCenter(find.byIcon(Icons.more_vert));
|
||||
expect(add.dx, closeTo(menu.dx, 0.5));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user