Dismiss finished shell command cards with Undo
Finished command cards get a Dismiss button and the chat's More menu a Dismiss all finished commands entry. Dismissal applies to every client of the chat; a SnackBar (Material) or transient notice (Cupertino) offers Undo for 5 s. Running commands cannot be dismissed until they end.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -6,6 +8,7 @@ import '../../../ui/theme/app_theme.dart';
|
||||
import '../conversation/chat_card_styles.dart';
|
||||
import '../ui/sessions/chat_adaptive.dart';
|
||||
import 'chat_shell_card_actions.dart';
|
||||
import 'chat_shell_dismiss.dart';
|
||||
import 'chat_shell_output_view.dart';
|
||||
import 'chat_shell_run.dart';
|
||||
import 'chat_shell_runs_controller.dart';
|
||||
@@ -15,7 +18,9 @@ import 'chat_shell_terminal_page.dart';
|
||||
/// One operator command in the transcript, as a terminal card in the reading
|
||||
/// column: the command and folder, its terminal (typed into while it runs),
|
||||
/// a spinner and Stop while it runs, then its exit status, Copy output and
|
||||
/// Send to agent. Full screen opens the same terminal over the whole window.
|
||||
/// Send to agent, and Dismiss (for every client of the chat, with Undo). A
|
||||
/// running command has no Dismiss: Stop it first. Full screen opens the same
|
||||
/// terminal over the whole window.
|
||||
///
|
||||
/// It listens to [controller] itself, so streamed output rebuilds only this
|
||||
/// card, never the transcript.
|
||||
@@ -126,6 +131,16 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ChatShellStatus(run: run, cupertino: cupertino),
|
||||
if (!run.running)
|
||||
ChatShellDismissButton(
|
||||
cupertino: cupertino,
|
||||
onPressed: () => unawaited(
|
||||
// A refusal brings the card back with the server's reason.
|
||||
dismissChatShellRuns(context, controller, [
|
||||
run.id,
|
||||
], cupertino: cupertino),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Reference in New Issue
Block a user