Show a chat turn's changed files as a chip that opens its diff
The answer footer shows '3 files changed +9 -2'; tapping opens the turn's files in the sheet (wide) or a full-screen page (narrow), and a file opens the run Changes diff viewer. Patches load through the chat's own gateway.
This commit is contained in:
@@ -15,6 +15,7 @@ import '../domain/chat_notice.dart';
|
||||
import '../domain/chat_attachment_picker.dart';
|
||||
import '../domain/chat_colors.dart';
|
||||
import '../domain/chat_transcript.dart';
|
||||
import '../domain/chat_turn_diffs.dart';
|
||||
import '../ui/sessions/chat_adaptive.dart';
|
||||
import '../ui/sessions/chat_color_picker.dart';
|
||||
import '../ui/sessions/session_actions.dart';
|
||||
@@ -24,6 +25,7 @@ import '../ui/transcript/chat_message_view.dart';
|
||||
import '../ui/transcript/chat_transcript_selection.dart';
|
||||
import '../ui/transcript/chat_injected_rows.dart';
|
||||
import '../ui/transcript/chat_task_notices_group.dart';
|
||||
import '../ui/transcript/chat_turn_diff_chip.dart';
|
||||
import '../../artifacts/actions/artifact_file_bridge.dart';
|
||||
import '../domain/chat_session_handoff.dart';
|
||||
import 'chat_account_usage_section.dart';
|
||||
@@ -977,24 +979,28 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
);
|
||||
// Answered approvals and questions fold into their turn's chips, like
|
||||
// tool calls; only cards still waiting on the operator stay full cards.
|
||||
final allRows = groupSettledQuestions(
|
||||
groupSettledPermissions(
|
||||
transcriptRows(
|
||||
messages,
|
||||
trailing: cards,
|
||||
running:
|
||||
_controller.running &&
|
||||
!_reconnecting &&
|
||||
!_staleTranscript &&
|
||||
!cards.any(chatCardAwaitingOperator),
|
||||
awaitingResponse:
|
||||
_controller.awaitingResponse &&
|
||||
!_reconnecting &&
|
||||
!_staleTranscript &&
|
||||
!cards.any(chatCardAwaitingOperator),
|
||||
liveMessageId: _controller.liveAssistantMessageId,
|
||||
// A turn that changed files carries its summary for the change chip.
|
||||
final allRows = attachChatTurnDiffs(
|
||||
groupSettledQuestions(
|
||||
groupSettledPermissions(
|
||||
transcriptRows(
|
||||
messages,
|
||||
trailing: cards,
|
||||
running:
|
||||
_controller.running &&
|
||||
!_reconnecting &&
|
||||
!_staleTranscript &&
|
||||
!cards.any(chatCardAwaitingOperator),
|
||||
awaitingResponse:
|
||||
_controller.awaitingResponse &&
|
||||
!_reconnecting &&
|
||||
!_staleTranscript &&
|
||||
!cards.any(chatCardAwaitingOperator),
|
||||
liveMessageId: _controller.liveAssistantMessageId,
|
||||
),
|
||||
),
|
||||
),
|
||||
_controller.turnDiffs,
|
||||
);
|
||||
// A transcript held from before a socket gap may still say a compaction is
|
||||
// running even when the repair's read is refused. That running state is
|
||||
@@ -1454,6 +1460,11 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
if (permissions is List<ChatPermissionCardData> && permissions.isNotEmpty)
|
||||
ChatPermissionsChip(permissions: permissions),
|
||||
...chatQuestionChips(row),
|
||||
if (row['turnDiff'] case final Map diff)
|
||||
ChatTurnDiffChip(
|
||||
summary: Map<String, dynamic>.from(diff),
|
||||
load: () => _controller.turnDiff('${diff['turn_id']}'),
|
||||
),
|
||||
];
|
||||
if (kind == 'permissions') {
|
||||
return Align(
|
||||
|
||||
Reference in New Issue
Block a user