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:
@@ -9,6 +9,7 @@ import '../../domain/chat_tool_calls.dart';
|
||||
import '../../domain/chat_transcript.dart';
|
||||
import 'chat_copy_button.dart';
|
||||
import 'chat_copy_gutter.dart';
|
||||
import 'chat_hover_actions.dart';
|
||||
import 'chat_link_text.dart';
|
||||
import 'chat_message_bubble.dart';
|
||||
import 'chat_turn_activity_view.dart';
|
||||
@@ -55,7 +56,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
final role = user ? 'User' : 'Assistant';
|
||||
final content = user ? _userParts(context) : _agentParts(context);
|
||||
// A wide window draws an answer's Copy in the gutter left of the reading
|
||||
// column; without room it stays at the start of the answer's footer.
|
||||
// column; without room it trails the time in the answer's footer.
|
||||
final gutter = user ? 0.0 : ChatCopyGutter.of(context);
|
||||
// No visible role label: side and surface say who spoke and the row's
|
||||
// semantics label names the role. The operator's turn is a neutral bubble
|
||||
@@ -139,17 +140,17 @@ class ChatMessageView extends StatelessWidget {
|
||||
const SizedBox(height: 6),
|
||||
if (content.isNotEmpty || thumbnails.isEmpty)
|
||||
ChatUserBubble(child: body),
|
||||
if (footer.isNotEmpty) ...[
|
||||
// The delivery line and the time share one line under the bubble.
|
||||
if (footer.isNotEmpty || hasTimestamp) ...[
|
||||
const SizedBox(height: 2),
|
||||
Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
alignment: WrapAlignment.end,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: footer,
|
||||
children: [...footer, if (hasTimestamp) timestamp],
|
||||
),
|
||||
],
|
||||
if (hasTimestamp) ...[const SizedBox(height: 2), timestamp],
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -179,7 +180,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// The answer, with its Copy button in the [gutter] to its left when there
|
||||
/// is one, or else first in its footer.
|
||||
/// is one, or else after the time in its footer.
|
||||
Widget _agentRow(
|
||||
BuildContext context,
|
||||
List<Widget> content,
|
||||
@@ -207,7 +208,23 @@ class ChatMessageView extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
if (gutter <= 0) {
|
||||
return _agentTurn(context, content, answer, actions(Axis.horizontal));
|
||||
// Without a gutter the actions trail the footer line; a pointer device
|
||||
// shows them while the answer is hovered or one has focus.
|
||||
final row = actions(Axis.horizontal);
|
||||
final reveal = row == null
|
||||
? null
|
||||
: ListenableBuilder(
|
||||
listenable: speechController,
|
||||
child: row,
|
||||
builder: (context, child) => ChatHoverReveal(
|
||||
visibilityKey: const Key('chat-message-actions-visibility'),
|
||||
pinned: speechController.messageId == id,
|
||||
child: child!,
|
||||
),
|
||||
);
|
||||
return ChatHoverRegion(
|
||||
child: _agentTurn(context, content, answer, reveal),
|
||||
);
|
||||
}
|
||||
// The gutter is one button wide: Read aloud stacks above Copy, and stays
|
||||
// shown on a desktop while this reply reads.
|
||||
@@ -244,14 +261,14 @@ class ChatMessageView extends StatelessWidget {
|
||||
if (isChatToolPart(part)) part,
|
||||
];
|
||||
final model = '${row['model'] ?? ''}'.trim();
|
||||
final footer = <Widget>[
|
||||
?copy,
|
||||
...this.footer,
|
||||
// The metadata line: the model that answered and the time, muted; the
|
||||
// actions (when not in the gutter) trail it.
|
||||
final meta = <Widget>[
|
||||
if (model.isNotEmpty)
|
||||
Text(
|
||||
model,
|
||||
key: const Key('chat-reply-model'),
|
||||
style: TextStyle(fontSize: 12, color: _secondaryColor(context)),
|
||||
style: chatMetaTextStyle(context),
|
||||
),
|
||||
if (chatMessageCreatedAt(row) case final time?)
|
||||
ChatMessageTimestamp(createdAt: time),
|
||||
@@ -276,24 +293,37 @@ class ChatMessageView extends StatelessWidget {
|
||||
),
|
||||
// A little air between the one-line turn status and the answer.
|
||||
if (content.isNotEmpty) const SizedBox(height: 6),
|
||||
if (content.isNotEmpty || footer.isNotEmpty)
|
||||
if (content.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: chatAgentContentInset,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (content.isNotEmpty) answer,
|
||||
if (footer.isNotEmpty)
|
||||
Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: footer,
|
||||
),
|
||||
],
|
||||
child: answer,
|
||||
),
|
||||
// Settled permissions, questions and changes: meta rows that, like
|
||||
// the activity line, sit at the row edge with their content inset to
|
||||
// the answer's text.
|
||||
if (footer.isNotEmpty)
|
||||
Column(
|
||||
key: const Key('chat-turn-chips'),
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: footer,
|
||||
),
|
||||
if (copy != null || meta.isNotEmpty)
|
||||
Padding(
|
||||
// The time starts at the answer's text edge and the actions
|
||||
// trail it, so hidden actions leave no gap before it. Without
|
||||
// metadata the buttons' own inset aligns their icons instead.
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: meta.isEmpty ? 0 : chatAgentContentInset,
|
||||
end: chatAgentContentInset,
|
||||
),
|
||||
child: Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [...meta, ?copy],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user