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:
2026-11-25 11:10:51 +00:00
parent 33874005c4
commit a3a59adb30
23 changed files with 993 additions and 180 deletions
@@ -78,9 +78,10 @@ List<JsonMap> chatRowQuestions(JsonMap row) {
];
}
/// The collapsed line for one settled question: the question and its outcome,
/// `Which database? · Postgres`, `… · +1 more` when several were answered.
String chatQuestionSummary(JsonMap form) {
/// One settled question's two lines: the question, and its outcome (the
/// operator's answer, `Postgres · +1 more` when several were answered, or
/// `Expired`, `Closed`, `Answered`).
({String question, String outcome}) chatQuestionSummaryParts(JsonMap form) {
final fields = chatFormFields(form);
final answers = form['answers'] is Map
? Map<String, dynamic>.from(form['answers'] as Map)
@@ -93,25 +94,38 @@ String chatQuestionSummary(JsonMap form) {
'${fields.first['key'] ?? ''}'.trim(),
);
}
if (form['cancelled'] == true) return '$question · Expired';
if (form['cancelled'] == true) {
return (question: question, outcome: 'Expired');
}
final answered = [
for (final field in fields)
if (answers.containsKey('${field['key'] ?? ''}'.trim())) field,
];
if (answered.isEmpty) {
return answers.isEmpty ? '$question · Closed' : '$question · Answered';
final outcome = answers.isEmpty ? 'Closed' : 'Answered';
return (question: question, outcome: outcome);
}
final first = answered.first;
final key = '${first['key'] ?? ''}'.trim();
final more = answers.length - 1;
return [
chatQuestionFieldLabel(first, key),
chatQuestionAnswerText(first, answers[key]),
if (more > 0) '+$more more',
].join(' · ');
return (
question: chatQuestionFieldLabel(first, key),
outcome: [
chatQuestionAnswerText(first, answers[key]),
if (more > 0) '+$more more',
].join(' · '),
);
}
/// One settled question as the quiet chip a turn's tools use. It opens a
/// One settled question on one line, `Which database? · Postgres`: the
/// chip's accessible name.
String chatQuestionSummary(JsonMap form) {
final parts = chatQuestionSummaryParts(form);
return '${parts.question} · ${parts.outcome}';
}
/// One settled question as the quiet chip a turn's tools use: the question
/// on one line and the operator's answer in full beneath it. It opens a
/// native sheet with the full question and the recorded answers.
class ChatQuestionChip extends StatelessWidget {
const ChatQuestionChip({super.key, required this.form});
@@ -120,16 +134,25 @@ class ChatQuestionChip extends StatelessWidget {
@override
Widget build(BuildContext context) {
final color = Theme.of(context).colorScheme.onSurfaceVariant;
final theme = Theme.of(context);
final color = theme.colorScheme.onSurfaceVariant;
final parts = chatQuestionSummaryParts(form);
final label = chatQuestionSummary(form);
return ChatTurnChip(
chipKey: ValueKey<String>('chat-question-chip-${form['id']}'),
leading: Icon(Icons.help_outline, size: 14, color: color),
label: label,
label: parts.question,
color: color,
ellipsizeLabel: true,
semanticsLabel: 'Question: $label, expand for details',
sheet: _QuestionSheet(form: form),
detail: Text(
parts.outcome,
key: ValueKey<String>('chat-question-answer-${form['id']}'),
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurface,
),
),
);
}
}
@@ -28,6 +28,9 @@ import '../ui/sessions/chat_adaptive.dart';
import '../ui/transcript/chat_markdown_view.dart';
import '../ui/transcript/chat_message_bubble.dart';
import '../ui/transcript/chat_message_view.dart';
import '../ui/transcript/chat_message_timestamp.dart';
import '../ui/transcript/chat_turn_activity_view.dart';
import '../domain/chat_transcript_days.dart';
import '../ui/transcript/chat_transcript_selection.dart';
import '../ui/transcript/chat_injected_rows.dart';
import '../ui/transcript/shown/chat_shown_card.dart';
@@ -1271,6 +1274,9 @@ class _ChatThreadViewState extends State<ChatThreadView> {
// other row keeps to the column by insetting past it.
final gutter = chatCopyGutter(constraints.maxWidth);
final media = MediaQuery.paddingOf(context);
// The date shows once per calendar day, above that day's
// first row; each row itself shows only its time.
final days = chatDayDividers(rows);
final transcript = [
for (var index = 0; index < rows.length; index++)
Padding(
@@ -1286,25 +1292,33 @@ class _ChatThreadViewState extends State<ChatThreadView> {
// Slivers mount only visible rows. Defer constructing
// their chips and checking cached widgets until then,
// rather than visiting the entire history per delta.
child: ChatTranscriptRowSelection(
child: ChatCopyGutter(
width: rows[index]['kind'] == 'assistant'
? gutter
: 0,
child: Builder(
builder: (_) => _entering(
rows[index],
_transcriptRow(
child: ChatDayDivided(
day: days[index],
// An answer row starts at the gutter; the divider
// keeps to the reading column.
inset: rows[index]['kind'] == 'assistant'
? gutter
: 0,
child: ChatTranscriptRowSelection(
child: ChatCopyGutter(
width: rows[index]['kind'] == 'assistant'
? gutter
: 0,
child: Builder(
builder: (_) => _entering(
rows[index],
keys[index],
onDismissCompaction:
compactionNotice != null &&
chatNoticeActivityCondition(
rows[index],
) ==
compactionNotice.condition
? () => _dismiss(compactionNotice)
: null,
_transcriptRow(
rows[index],
keys[index],
onDismissCompaction:
compactionNotice != null &&
chatNoticeActivityCondition(
rows[index],
) ==
compactionNotice.condition
? () => _dismiss(compactionNotice)
: null,
),
),
),
),
@@ -2249,8 +2263,13 @@ class _ChatActivityLineState extends State<_ChatActivityLine> {
? Icons.check_circle_outline
: Icons.circle_outlined;
final label = '${widget.row['label'] ?? ''}'.trim();
// The icon starts at the reply text's edge, like the turn's activity line.
return Padding(
padding: const EdgeInsets.symmetric(vertical: 6),
padding: const EdgeInsetsDirectional.only(
start: chatAgentContentInset,
top: 6,
bottom: 6,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,