feat(app): structure chat session row information

This commit is contained in:
2026-10-25 21:48:52 +00:00
parent 9c9888c0b6
commit bd256ad163
5 changed files with 107 additions and 107 deletions
@@ -177,10 +177,12 @@ void main() {
expect(find.text('opencode'), findsNWidgets(2));
expect(find.text('/work'), findsNWidgets(2));
expect(
(tester.getCenter(find.text('Starred chat')).dy -
tester.getCenter(find.text('New')).dy)
.abs(),
lessThan(4),
tester.getCenter(find.text('New')).dy,
greaterThan(tester.getCenter(find.text('Starred chat')).dy),
);
expect(
tester.getCenter(find.text('5 min ago')).dx,
greaterThan(tester.getCenter(find.text('Starred chat')).dx),
);
// The meta line keeps `CupertinoListTile`'s native 12pt subtitle style; it
@@ -234,7 +236,7 @@ void main() {
final titleParagraph = tester.renderObject<RenderParagraph>(
find.text(title),
);
expect(titleParagraph.maxLines, 1);
expect(titleParagraph.maxLines, 2);
expect(titleParagraph.didExceedMaxLines, isTrue);
final metaParagraph = tester.renderObject<RenderParagraph>(
find.descendant(
@@ -242,7 +244,7 @@ void main() {
matching: find.text(meta),
),
);
expect(metaParagraph.maxLines, 1);
expect(metaParagraph.maxLines, 2);
expect(metaParagraph.didExceedMaxLines, isTrue);
// The state word is the row's only unread marker: at the smallest supported
@@ -263,12 +265,9 @@ void main() {
);
}
// The word shares the title's line, as on the web.
expect(
(tester.getCenter(find.text(title)).dy -
tester.getCenter(find.text('New')).dy)
.abs(),
lessThan(20),
tester.getCenter(find.text('New')).dy,
greaterThan(tester.getCenter(find.text(title)).dy),
);
});
}
@@ -80,12 +80,13 @@ void main() {
expect(find.text('/work'), findsNWidgets(2));
expect(find.text('New'), findsOneWidget);
expect(find.text('2 hr ago'), findsOneWidget);
// As on the web, the unread word shares the title's line.
expect(
(tester.getCenter(find.text('Starred chat')).dy -
tester.getCenter(find.text('New')).dy)
.abs(),
lessThan(4),
tester.getCenter(find.text('New')).dy,
greaterThan(tester.getCenter(find.text('Starred chat')).dy),
);
expect(
tester.getCenter(find.text('5 min ago')).dx,
greaterThan(tester.getCenter(find.text('Starred chat')).dx),
);
// The meta line is the theme's muted colour, not the title colour.
@@ -158,7 +159,7 @@ void main() {
final titleParagraph = tester.renderObject<RenderParagraph>(
find.text(title),
);
expect(titleParagraph.maxLines, 1);
expect(titleParagraph.maxLines, 2);
expect(titleParagraph.didExceedMaxLines, isTrue);
final metaParagraph = tester.renderObject<RenderParagraph>(
find.descendant(
@@ -166,7 +167,7 @@ void main() {
matching: find.text(meta),
),
);
expect(metaParagraph.maxLines, 1);
expect(metaParagraph.maxLines, 2);
expect(metaParagraph.didExceedMaxLines, isTrue);
// `New`/`Closed` is the row's only unread marker; it stays whole at the
@@ -188,12 +189,14 @@ void main() {
// The title/state and every metadata field occupy distinct lines.
expect(
tester.getCenter(
find.descendant(
of: find.byKey(const Key('chat-row-s1')),
matching: find.text(meta).last,
),
).dy,
tester
.getCenter(
find.descendant(
of: find.byKey(const Key('chat-row-s1')),
matching: find.text(meta).last,
),
)
.dy,
greaterThan(tester.getCenter(find.text(title)).dy),
);
});