Quieter transcript metadata: day dividers, time-only rows, muted meta rows
- Date once per calendar day: a muted centred divider above each day's
first timed row (chatDayDividers); rows show only their time ("10:16"),
with the full date and time kept in the tooltip and semantics. The user's
time shares the delivery line; a harness notice's time trails its line.
- Activity line and turn chips are secondary: bodyMedium, regular weight,
onSurfaceVariant (error colour kept for failures), a small chevron_right
that turns down while its details are open (replaces expand_less).
- Copy / Read aloud: 18 px muted icons; on pointer devices shown only while
the reply is hovered or an action is focused (also without the gutter);
touch keeps them visible with a full tap target. The time leads the
footer so hidden actions leave no gap.
- Settled questions: the question on one line, the operator's answer in
full on its own line beneath it.
- Meta rows (activity, chips, notices, compaction line) start at the reply
text's leading edge; turn chips sit in their own column under the answer.
- Scroll fixture: ?timestamps=1 spreads messages over two days.
Row keys are unchanged; the divider joins a row without replacing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,10 +53,18 @@ void main() {
|
||||
expect(chatCopyGutter(560), 0);
|
||||
});
|
||||
|
||||
testWidgets('without a gutter Copy starts the footer', (tester) async {
|
||||
testWidgets('without a gutter Copy trails the footer\'s time', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(_host(0));
|
||||
expect(find.descendant(of: _footer, matching: _copy), findsOneWidget);
|
||||
expect(_gutter, findsNothing);
|
||||
// The time starts at the answer's text edge, so hidden actions never
|
||||
// leave a gap before it.
|
||||
final model = tester.getRect(find.text('gpt-test'));
|
||||
final text = tester.getRect(find.text('The answer text'));
|
||||
expect(model.left, text.left);
|
||||
expect(tester.getRect(_copy).left, greaterThan(model.right));
|
||||
});
|
||||
|
||||
testWidgets('with a gutter Copy sits left of the answer, not in it', (
|
||||
@@ -107,6 +115,63 @@ void main() {
|
||||
variant: TargetPlatformVariant.only(TargetPlatform.macOS),
|
||||
);
|
||||
|
||||
double footerOpacity(WidgetTester tester) => tester
|
||||
.widget<AnimatedOpacity>(
|
||||
find.byKey(const Key('chat-message-actions-visibility')),
|
||||
)
|
||||
.opacity;
|
||||
|
||||
testWidgets(
|
||||
'without a gutter a desktop shows the footer actions on hover and focus',
|
||||
(tester) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
await tester.pumpWidget(_host(0));
|
||||
expect(footerOpacity(tester), 0);
|
||||
// The time and model stay visible; only the actions wait for hover.
|
||||
expect(find.text('gpt-test'), findsOneWidget);
|
||||
expect(
|
||||
tester.getSemantics(_copy),
|
||||
isSemantics(tooltip: 'Copy', isButton: true, isFocusable: true),
|
||||
);
|
||||
|
||||
final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);
|
||||
addTearDown(mouse.removePointer);
|
||||
await mouse.addPointer(location: Offset.zero);
|
||||
await mouse.moveTo(tester.getCenter(find.text('The answer text')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(footerOpacity(tester), 1);
|
||||
await mouse.moveTo(const Offset(5, 590));
|
||||
await tester.pumpAndSettle();
|
||||
expect(footerOpacity(tester), 0);
|
||||
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.tab);
|
||||
await tester.pumpAndSettle();
|
||||
expect(footerOpacity(tester), 1);
|
||||
semantics.dispose();
|
||||
},
|
||||
variant: TargetPlatformVariant.only(TargetPlatform.macOS),
|
||||
);
|
||||
|
||||
testWidgets('touch keeps the footer actions shown, with small muted icons', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(_host(0));
|
||||
expect(footerOpacity(tester), 1);
|
||||
final context = tester.element(_copy);
|
||||
final icon = tester.getSize(
|
||||
find.descendant(of: _copy, matching: find.byType(Icon)),
|
||||
);
|
||||
// Smaller than the reply's body text line and the default 24 px icon.
|
||||
expect(icon.height, 18);
|
||||
final style = tester.widget<IconButton>(_copy).style!;
|
||||
expect(
|
||||
style.foregroundColor!.resolve({}),
|
||||
Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
);
|
||||
// A touch target still meets the platform minimum.
|
||||
expect(tester.getSize(_copy).height, greaterThanOrEqualTo(48));
|
||||
});
|
||||
|
||||
for (final (width, inGutter) in [(1400.0, true), (560.0, false)]) {
|
||||
testWidgets('a ${width.toInt()} px conversation puts Copy '
|
||||
'${inGutter ? 'in the gutter' : 'in the footer'}', (tester) async {
|
||||
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
testWidgets('shows a local dated timestamp but keeps it out of copy', (
|
||||
testWidgets('shows a local time-only timestamp but keeps it out of copy', (
|
||||
tester,
|
||||
) async {
|
||||
_phone(tester);
|
||||
@@ -122,9 +122,20 @@ void main() {
|
||||
final context = tester.element(find.byType(ChatMessageTimestamp).first);
|
||||
final local = DateTime.utc(2026, 10, 20, 8, 12).toLocal();
|
||||
final l10n = MaterialLocalizations.of(context);
|
||||
final expected =
|
||||
'${local.day} ${l10n.formatMonthYear(local)} · ${l10n.formatTimeOfDay(TimeOfDay.fromDateTime(local), alwaysUse24HourFormat: true)}';
|
||||
expect(find.text(expected), findsOneWidget);
|
||||
final time = l10n.formatTimeOfDay(
|
||||
TimeOfDay.fromDateTime(local),
|
||||
alwaysUse24HourFormat: true,
|
||||
);
|
||||
// The row shows only its time; the date is the day divider's, and the
|
||||
// full date and time stay in the tooltip and the accessible name.
|
||||
final full = '${local.day} ${l10n.formatMonthYear(local)}, $time';
|
||||
expect(find.text(time), findsOneWidget);
|
||||
expect(find.textContaining('2026'), findsNothing);
|
||||
expect(
|
||||
find.byWidgetPredicate((w) => w is Tooltip && w.message == full),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.bySemanticsLabel('Sent $full'), findsOneWidget);
|
||||
|
||||
final copy = tester.widget<ChatCopyButton>(find.byType(ChatCopyButton));
|
||||
expect(copy.text, 'Answer');
|
||||
|
||||
Reference in New Issue
Block a user