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
+25 -3
View File
@@ -13,7 +13,8 @@
// `?tasks=N` the history ends with N consecutive background-task notices
// in the server's wording (every third one failed);
// `?links=1` answers and operator turns carry a markdown link, an
// autolink, a bare URL and URLs inside code (never linkified).
// autolink, a bare URL and URLs inside code (never linkified);
// `?timestamps=1` messages carry recorded times over two calendar days.
import 'dart:async';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -31,6 +32,7 @@ bool get _links => _params['links'] == '1';
bool get _older => _params['older'] == '1';
int get _live => int.tryParse(_params['live'] ?? '') ?? 0;
int get _tasks => int.tryParse(_params['tasks'] ?? '') ?? 0;
bool get _timestamps => _params['timestamps'] == '1';
/// Background task [i]'s notice, as the server records a Claude Code task
/// notification.
@@ -154,6 +156,22 @@ JsonMap _message(String chat, int i) {
};
}
/// With `?timestamps=1`, message [i] of [count] carries a recorded time: the
/// first half on 24 November 2026 and the rest on the 25th (local time), a
/// few minutes apart, so the transcript shows two day dividers.
JsonMap _timed(JsonMap message, int i, int count) {
if (!_timestamps) return message;
final secondDay = i >= count ~/ 2;
final at = DateTime(
2026,
11,
secondDay ? 25 : 24,
10,
0,
).add(Duration(minutes: 3 * i));
return {...message, 'created_at': at.millisecondsSinceEpoch};
}
/// One history page for chat [index]: the newest messages, or with `?older=1`
/// and a cursor, the 20 messages before them.
JsonMap chatScrollHistory(String sessionId, int index, String cursor) {
@@ -165,10 +183,14 @@ JsonMap chatScrollHistory(String sessionId, int index, String cursor) {
'has_more': false,
};
}
final messages = [
for (var i = 0; i < count; i++) _message(sessionId, i),
for (var i = 0; i < _tasks; i++) _taskNotice(sessionId, i),
];
return {
'messages': [
for (var i = 0; i < count; i++) _message(sessionId, i),
for (var i = 0; i < _tasks; i++) _taskNotice(sessionId, i),
for (var i = 0; i < messages.length; i++)
_timed(messages[i], i, messages.length),
],
'next_cursor': _older ? 'older' : '',
'has_more': _older,