Show dismissed commands as an answer footer chip; move Copy to the left gutter
Dismissed shell runs leave the transcript and fold into a "N commands" chip in the footer of the first answer at or after each run (the last answer for newer runs, or a row of its own without any answer). The chip opens the turn sheet (wide) or a full-screen page (narrow) listing the commands; each opens its output read-only with Copy output, Send to agent and Restore. On a wide conversation the answer's Copy button moves out of the footer into a 48 px gutter left of the reading column (chatCopyGutter), shown on hover or focus on desktops and always on touch; narrow widths keep it in the footer.
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
// `?chats=N`): every fixture chat lists four recorded terminal runs
|
||||
// (succeeded, failed, stopped and an interactive login still waiting for a
|
||||
// token), and chat_shell_run/stop/share/input answer as the server does, with
|
||||
// the frames that follow; chat_shell_dismiss/restore hide and bring back runs. The login prompt hides what is typed, as a real
|
||||
// terminal's password prompt does, and finishes on Enter.
|
||||
// the frames that follow; chat_shell_dismiss/restore move runs into and out
|
||||
// of the dismissed list the readback reports (`?shell_dismissed=a,b` starts
|
||||
// with those run ids dismissed). The login prompt hides what is typed, as a
|
||||
// real terminal's password prompt does, and finishes on Enter.
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
@@ -23,7 +25,12 @@ void configureChatShellFixture(Map<String, String> params) {
|
||||
_enabled = params['shell'] == '1';
|
||||
_base = DateTime.now().subtract(const Duration(minutes: 3));
|
||||
_loginEnd = utf8.encode(_loginPrompt).length;
|
||||
_dismissed.clear();
|
||||
_dismissed
|
||||
..clear()
|
||||
..addAll([
|
||||
for (final id in (params['shell_dismissed'] ?? '').split(','))
|
||||
if (id.trim().isNotEmpty) id.trim(),
|
||||
]);
|
||||
}
|
||||
|
||||
const String _loginPrompt =
|
||||
@@ -128,6 +135,11 @@ JsonMap? chatShellReply(JsonMap request) {
|
||||
if (!_dismissed.contains(run['id'])) run,
|
||||
],
|
||||
'chat_shell_dismissed': _dismissed.toList(),
|
||||
'chat_shell_dismissed_runs': [
|
||||
for (final run in _runs(session))
|
||||
if (_dismissed.contains(run['id']))
|
||||
{...run, 'dismissed': true, 'dismissed_at': _at(200)},
|
||||
],
|
||||
};
|
||||
case 'chat_shell_dismiss':
|
||||
final ids = _runIds(body);
|
||||
|
||||
Reference in New Issue
Block a user