Files
pipelines/app/lib/features/chat/conversation/chat_reading_width.dart
T
alan cf9f71f27c 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.
2026-11-09 23:47:14 +00:00

22 lines
946 B
Dart

import 'dart:math' as math;
/// The widest the conversation's reading column grows: transcript rows and
/// the floating composer share it, centred, so a wide window keeps a
/// comfortable line length instead of stretching messages edge to edge.
const double kChatReadingWidth = 760;
/// The space on each side of the centred reading column in [width].
double chatReadingInset(double width) =>
math.max(0, (width - kChatReadingWidth) / 2);
/// The strip left of the reading column that holds an answer's Copy button,
/// outside the answer itself.
const double kChatCopyGutterWidth = 48;
/// The copy gutter a transcript [width] wide gives each answer:
/// [kChatCopyGutterWidth] when the margin left of the centred reading column
/// fits it, else 0, and Copy stays in the answer's footer (phones, narrow
/// panes).
double chatCopyGutter(double width) =>
chatReadingInset(width) >= kChatCopyGutterWidth ? kChatCopyGutterWidth : 0;