Merge commit 'a823a6e8a398ab1327ff22f9c393d970e52a6f4b' into pipelines/run-20261111-1947-use-desktop-dialogs-for-remaining-sheets-4d07
This commit is contained in:
@@ -23,19 +23,3 @@ ButtonStyle chatBarTextButtonStyle(
|
||||
|
||||
/// Horizontal padding inside the bar's text buttons (model, mode).
|
||||
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12);
|
||||
|
||||
/// Puts [content] (a button's child) in the bar's foreground colour: the
|
||||
/// chat's tint if it has one, else `onSurfaceVariant`. Kept for existing
|
||||
/// callers; the Material path colours buttons with [chatBarTextButtonStyle].
|
||||
Widget chatBarCupertinoContent(BuildContext context, Widget content) {
|
||||
final color =
|
||||
ChatBarTintScope.foregroundOf(context) ??
|
||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
return IconTheme.merge(
|
||||
data: IconThemeData(color: color),
|
||||
child: DefaultTextStyle.merge(
|
||||
style: TextStyle(color: color),
|
||||
child: content,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -831,8 +831,7 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
||||
// inside the glass with the field, as one floating composer; only the
|
||||
// command palette, a separate menu, floats above it.
|
||||
final extras = <Widget>[
|
||||
if (chatDraftIsShell(composer.draft))
|
||||
ChatShellModeIndicator(cupertino: false),
|
||||
if (chatDraftIsShell(composer.draft)) ChatShellModeIndicator(),
|
||||
if (!_attachments.isEmpty) _attachmentStrip(context),
|
||||
if (_uploading)
|
||||
_notice(
|
||||
|
||||
@@ -3,10 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import '../domain/chat_task_metadata.dart';
|
||||
import '../../../ui/text/monospace.dart';
|
||||
|
||||
/// Always false: the app is Material-only. Kept so existing callers compile;
|
||||
/// a later run removes it with its callers.
|
||||
bool taskCupertino(BuildContext context) => false;
|
||||
|
||||
Color taskSecondary(BuildContext context) =>
|
||||
Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import '../../../shell/windows/window_scope.dart';
|
||||
import '../../terminal/terminal_open_action.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
@@ -1408,9 +1407,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
identifier: 'chat-files-toggle',
|
||||
onPressed: _toggleFiles,
|
||||
materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined,
|
||||
cupertinoIcon: _filesVisible
|
||||
? CupertinoIcons.folder_fill
|
||||
: CupertinoIcons.folder,
|
||||
),
|
||||
],
|
||||
moreActions: [
|
||||
@@ -1422,7 +1418,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
label: 'Chat details',
|
||||
onPressed: _openInfo,
|
||||
materialIcon: Icons.info_outline,
|
||||
cupertinoIcon: CupertinoIcons.info,
|
||||
),
|
||||
...widget.paneControls,
|
||||
chatShellRunMenuAction(onPressed: _runShellFromMenu),
|
||||
@@ -1475,12 +1470,7 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
);
|
||||
|
||||
void _runShellFromMenu() => unawaited(
|
||||
runChatShellFromMenu(
|
||||
context,
|
||||
_shellRuns,
|
||||
cupertino: false,
|
||||
showNotice: _showCommandNotice,
|
||||
),
|
||||
runChatShellFromMenu(context, _shellRuns, showNotice: _showCommandNotice),
|
||||
);
|
||||
|
||||
void _dismissFinishedShellRuns() => unawaited(
|
||||
@@ -1488,7 +1478,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
context,
|
||||
_shellRuns,
|
||||
_shellRuns.finishedIds,
|
||||
cupertino: false,
|
||||
onRefused: (refusal) => _showCommandNotice(
|
||||
"Couldn't dismiss the commands: $refusal",
|
||||
failed: true,
|
||||
|
||||
@@ -22,13 +22,11 @@ class ChatShellCardActions extends StatefulWidget {
|
||||
super.key,
|
||||
required this.run,
|
||||
required this.controller,
|
||||
required this.cupertino,
|
||||
required this.onFullScreen,
|
||||
});
|
||||
|
||||
final ChatShellRun run;
|
||||
final ChatShellRunsController controller;
|
||||
final bool cupertino;
|
||||
final VoidCallback onFullScreen;
|
||||
|
||||
@override
|
||||
|
||||
@@ -10,13 +10,8 @@ const String chatShellDismissAllLabel = 'Dismiss all finished commands';
|
||||
|
||||
/// The card's Dismiss button, offered once the command has finished.
|
||||
class ChatShellDismissButton extends StatelessWidget {
|
||||
const ChatShellDismissButton({
|
||||
super.key,
|
||||
required this.cupertino,
|
||||
required this.onPressed,
|
||||
});
|
||||
const ChatShellDismissButton({super.key, required this.onPressed});
|
||||
|
||||
final bool cupertino;
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@override
|
||||
@@ -48,7 +43,6 @@ Future<void> dismissChatShellRuns(
|
||||
BuildContext context,
|
||||
ChatShellRunsController controller,
|
||||
List<String> ids, {
|
||||
required bool cupertino,
|
||||
void Function(String refusal)? onRefused,
|
||||
}) async {
|
||||
if (ids.isEmpty) return;
|
||||
|
||||
@@ -36,7 +36,7 @@ class ChatShellHistoryChip extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _open(BuildContext context, bool cupertino) {
|
||||
Future<void> _open(BuildContext context, bool _) {
|
||||
// A dialog in the tiled app on a wide layout. A phone keeps the
|
||||
// full-screen page, and a floating window opens it as a page of that
|
||||
// window, so what it opens next (a diff, a command's output) stays in
|
||||
|
||||
@@ -17,13 +17,9 @@ Future<void> openChatShellHistoryOutput(
|
||||
BuildContext context, {
|
||||
required ChatShellRunsController controller,
|
||||
required String runId,
|
||||
required bool cupertino,
|
||||
}) {
|
||||
Widget page(BuildContext _) => ChatShellHistoryOutputPage(
|
||||
controller: controller,
|
||||
runId: runId,
|
||||
cupertino: cupertino,
|
||||
);
|
||||
Widget page(BuildContext _) =>
|
||||
ChatShellHistoryOutputPage(controller: controller, runId: runId);
|
||||
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
||||
}
|
||||
|
||||
@@ -35,12 +31,10 @@ class ChatShellHistoryOutputPage extends StatefulWidget {
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.runId,
|
||||
required this.cupertino,
|
||||
});
|
||||
|
||||
final ChatShellRunsController controller;
|
||||
final String runId;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
State<ChatShellHistoryOutputPage> createState() =>
|
||||
@@ -138,7 +132,7 @@ class _ChatShellHistoryOutputPageState
|
||||
runSpacing: 4,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ChatShellStatus(run: full, cupertino: false),
|
||||
ChatShellStatus(run: full),
|
||||
if (full.directory.isNotEmpty)
|
||||
Text(
|
||||
full.directory,
|
||||
@@ -154,11 +148,7 @@ class _ChatShellHistoryOutputPageState
|
||||
key: const Key('chat-shell-output-empty'),
|
||||
style: chatCardSecondaryStyle(context, false),
|
||||
)
|
||||
: ChatShellTerminalView(
|
||||
session: session,
|
||||
cupertino: false,
|
||||
fill: true,
|
||||
),
|
||||
: ChatShellTerminalView(session: session, fill: true),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
ListenableBuilder(
|
||||
|
||||
@@ -118,7 +118,7 @@ class _ChatShellHistoryViewState extends State<ChatShellHistoryView> {
|
||||
runSpacing: 4,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
ChatShellStatus(run: run, cupertino: false),
|
||||
ChatShellStatus(run: run),
|
||||
Text(chatShellRunTime(context, run.startedAt), style: secondary),
|
||||
if (run.purged) Text(chatShellOutputNotKept, style: secondary),
|
||||
if (refusal != null)
|
||||
@@ -151,7 +151,6 @@ class _ChatShellHistoryViewState extends State<ChatShellHistoryView> {
|
||||
context,
|
||||
controller: widget.controller,
|
||||
runId: run.id,
|
||||
cupertino: false,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -6,9 +6,7 @@ import 'chat_shell_command.dart';
|
||||
/// Shown inside the composer while its draft starts with `!`: the draft is a
|
||||
/// shell command for this chat's folder, not a message to the agent.
|
||||
class ChatShellModeIndicator extends StatelessWidget {
|
||||
const ChatShellModeIndicator({super.key, required this.cupertino});
|
||||
|
||||
final bool cupertino;
|
||||
const ChatShellModeIndicator({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -14,14 +14,12 @@ class ChatShellOutputView extends StatelessWidget {
|
||||
super.key,
|
||||
required this.run,
|
||||
required this.controller,
|
||||
required this.cupertino,
|
||||
required this.viewKey,
|
||||
required this.fullScreen,
|
||||
});
|
||||
|
||||
final ChatShellRun run;
|
||||
final ChatShellRunsController controller;
|
||||
final bool cupertino;
|
||||
|
||||
/// Replaced when the full-screen view closes, so the card's view sizes the
|
||||
/// terminal to itself again.
|
||||
@@ -47,7 +45,6 @@ class ChatShellOutputView extends StatelessWidget {
|
||||
ChatShellTerminalView(
|
||||
key: viewKey,
|
||||
session: session,
|
||||
cupertino: false,
|
||||
autoResize: !fullScreen,
|
||||
),
|
||||
if (session.live && !fullScreen)
|
||||
@@ -55,7 +52,6 @@ class ChatShellOutputView extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: ChatShellTerminalKeys(
|
||||
session: session,
|
||||
cupertino: false,
|
||||
field: chatShellTouchFirst(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -46,7 +46,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
||||
context,
|
||||
controller: widget.controller,
|
||||
runId: widget.runId,
|
||||
cupertino: false,
|
||||
);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
@@ -113,15 +112,12 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ChatShellStatus(run: run, cupertino: false),
|
||||
ChatShellStatus(run: run),
|
||||
if (!run.running)
|
||||
ChatShellDismissButton(
|
||||
cupertino: false,
|
||||
onPressed: () => unawaited(
|
||||
// A refusal brings the card back with the server's reason.
|
||||
dismissChatShellRuns(context, controller, [
|
||||
run.id,
|
||||
], cupertino: false),
|
||||
dismissChatShellRuns(context, controller, [run.id]),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -130,7 +126,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
||||
ChatShellOutputView(
|
||||
run: run,
|
||||
controller: controller,
|
||||
cupertino: false,
|
||||
viewKey: ValueKey<int>(_viewGeneration),
|
||||
fullScreen: _fullScreen,
|
||||
),
|
||||
@@ -146,7 +141,6 @@ class _ChatShellRunCardState extends State<ChatShellRunCard> {
|
||||
ChatShellCardActions(
|
||||
run: run,
|
||||
controller: controller,
|
||||
cupertino: false,
|
||||
onFullScreen: () => _openFullScreen(),
|
||||
),
|
||||
if (error != null)
|
||||
|
||||
@@ -5,18 +5,14 @@ import 'chat_shell_command.dart';
|
||||
|
||||
/// The chat actions menu's "Run command…": a small host dialog with one
|
||||
/// command field. Returns the trimmed command, or null when cancelled.
|
||||
Future<String?> showChatShellRunDialog(
|
||||
BuildContext context, {
|
||||
required bool cupertino,
|
||||
}) => showDialog<String>(
|
||||
context: context,
|
||||
builder: (_) => const ChatShellRunDialog(cupertino: false),
|
||||
);
|
||||
Future<String?> showChatShellRunDialog(BuildContext context) =>
|
||||
showDialog<String>(
|
||||
context: context,
|
||||
builder: (_) => const ChatShellRunDialog(),
|
||||
);
|
||||
|
||||
class ChatShellRunDialog extends StatefulWidget {
|
||||
const ChatShellRunDialog({super.key, required this.cupertino});
|
||||
|
||||
final bool cupertino;
|
||||
const ChatShellRunDialog({super.key});
|
||||
|
||||
@override
|
||||
State<ChatShellRunDialog> createState() => _ChatShellRunDialogState();
|
||||
|
||||
@@ -8,14 +8,9 @@ import 'chat_shell_run.dart';
|
||||
/// while it runs, then a status chip (exit code, stopped, interrupted) with
|
||||
/// how long it ran. The words carry the state; colour only repeats it.
|
||||
class ChatShellStatus extends StatelessWidget {
|
||||
const ChatShellStatus({
|
||||
super.key,
|
||||
required this.run,
|
||||
required this.cupertino,
|
||||
});
|
||||
const ChatShellStatus({super.key, required this.run});
|
||||
|
||||
final ChatShellRun run;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -71,12 +71,10 @@ class ChatShellTerminalKeys extends StatefulWidget {
|
||||
const ChatShellTerminalKeys({
|
||||
super.key,
|
||||
required this.session,
|
||||
required this.cupertino,
|
||||
required this.field,
|
||||
});
|
||||
|
||||
final ChatShellTerminalSession session;
|
||||
final bool cupertino;
|
||||
final bool field;
|
||||
|
||||
@override
|
||||
|
||||
@@ -12,13 +12,9 @@ Future<void> openChatShellTerminalPage(
|
||||
BuildContext context, {
|
||||
required ChatShellRunsController controller,
|
||||
required String runId,
|
||||
required bool cupertino,
|
||||
}) {
|
||||
Widget page(BuildContext _) => ChatShellTerminalPage(
|
||||
controller: controller,
|
||||
runId: runId,
|
||||
cupertino: cupertino,
|
||||
);
|
||||
Widget page(BuildContext _) =>
|
||||
ChatShellTerminalPage(controller: controller, runId: runId);
|
||||
return Navigator.push<void>(context, MaterialPageRoute<void>(builder: page));
|
||||
}
|
||||
|
||||
@@ -27,12 +23,10 @@ class ChatShellTerminalPage extends StatelessWidget {
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.runId,
|
||||
required this.cupertino,
|
||||
});
|
||||
|
||||
final ChatShellRunsController controller;
|
||||
final String runId;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -58,7 +52,6 @@ class ChatShellTerminalPage extends StatelessWidget {
|
||||
Expanded(
|
||||
child: ChatShellTerminalView(
|
||||
session: session,
|
||||
cupertino: false,
|
||||
fill: true,
|
||||
autofocus: true,
|
||||
),
|
||||
@@ -68,7 +61,6 @@ class ChatShellTerminalPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: ChatShellTerminalKeys(
|
||||
session: session,
|
||||
cupertino: false,
|
||||
field: chatShellTouchFirst(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,7 +10,7 @@ import '../conversation/chat_card_styles.dart';
|
||||
/// background, the body text colour as foreground, the accent as cursor and
|
||||
/// selection. The sixteen ANSI colours are the emulator's standard palette,
|
||||
/// darkened on a light surface so coloured output stays readable.
|
||||
TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) {
|
||||
TerminalTheme chatShellTerminalTheme(BuildContext context) {
|
||||
final dark = Theme.of(context).brightness == Brightness.dark;
|
||||
final background = chatCardFillColor(context, false);
|
||||
final foreground = Theme.of(context).colorScheme.onSurface;
|
||||
@@ -54,7 +54,7 @@ TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) {
|
||||
}
|
||||
|
||||
/// The terminal's text: the host's monospace family at the card body size.
|
||||
TerminalStyle chatShellTerminalStyle(BuildContext context, bool cupertino) {
|
||||
TerminalStyle chatShellTerminalStyle(BuildContext context) {
|
||||
final body = chatCardBodyStyle(context, false) ?? const TextStyle();
|
||||
return TerminalStyle(
|
||||
fontFamily: appMonospaceFamily,
|
||||
|
||||
@@ -74,14 +74,12 @@ class ChatShellTerminalView extends StatefulWidget {
|
||||
const ChatShellTerminalView({
|
||||
super.key,
|
||||
required this.session,
|
||||
required this.cupertino,
|
||||
this.fill = false,
|
||||
this.autofocus = false,
|
||||
this.autoResize = true,
|
||||
});
|
||||
|
||||
final ChatShellTerminalSession session;
|
||||
final bool cupertino;
|
||||
final bool fill;
|
||||
final bool autofocus;
|
||||
|
||||
@@ -155,7 +153,7 @@ class _ChatShellTerminalViewState extends State<ChatShellTerminalView> {
|
||||
Widget build(BuildContext context) {
|
||||
final session = widget.session;
|
||||
final live = session.live;
|
||||
final style = chatShellTerminalStyle(context, false);
|
||||
final style = chatShellTerminalStyle(context);
|
||||
const padding = EdgeInsets.all(8);
|
||||
Widget view = Semantics(
|
||||
identifier: 'chat-shell-terminal',
|
||||
@@ -168,7 +166,7 @@ class _ChatShellTerminalViewState extends State<ChatShellTerminalView> {
|
||||
focusNode: _focus,
|
||||
autofocus: widget.autofocus && live,
|
||||
autoResize: widget.autoResize,
|
||||
theme: chatShellTerminalTheme(context, false),
|
||||
theme: chatShellTerminalTheme(context),
|
||||
textStyle: style,
|
||||
padding: padding,
|
||||
readOnly: !live,
|
||||
|
||||
@@ -22,10 +22,9 @@ Widget chatShellRunMenuAction({required VoidCallback onPressed}) =>
|
||||
Future<void> runChatShellFromMenu(
|
||||
BuildContext context,
|
||||
ChatShellRunsController controller, {
|
||||
required bool cupertino,
|
||||
required void Function(String text, {bool failed}) showNotice,
|
||||
}) async {
|
||||
final command = await showChatShellRunDialog(context, cupertino: cupertino);
|
||||
final command = await showChatShellRunDialog(context);
|
||||
if (command == null) return;
|
||||
final refusal = await controller.start(command);
|
||||
if (refusal != null) {
|
||||
|
||||
@@ -15,7 +15,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
|
||||
required this.label,
|
||||
required this.onPressed,
|
||||
required this.materialIcon,
|
||||
required this.cupertinoIcon,
|
||||
this.cupertinoIcon,
|
||||
this.identifier,
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
|
||||
final IconData materialIcon;
|
||||
|
||||
/// Kept for callers; the Material toolbar always draws [materialIcon].
|
||||
final IconData cupertinoIcon;
|
||||
final IconData? cupertinoIcon;
|
||||
final String? identifier;
|
||||
|
||||
/// A narrow bar moves it into its More menu, under the bar's host's icon.
|
||||
|
||||
@@ -16,7 +16,7 @@ class ChatCodeHover {
|
||||
Object token,
|
||||
String text,
|
||||
Offset pointer, {
|
||||
required bool cupertino,
|
||||
bool? cupertino,
|
||||
}) {
|
||||
if (_disposed) return;
|
||||
hide();
|
||||
@@ -64,11 +64,7 @@ class ChatCodeHover {
|
||||
child: Material(
|
||||
elevation: 3,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: ChatCopyButton(
|
||||
text: text,
|
||||
cupertino: false,
|
||||
showLabel: true,
|
||||
),
|
||||
child: ChatCopyButton(text: text, showLabel: true),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -132,12 +128,12 @@ class ChatCodeCopyRegion extends StatefulWidget {
|
||||
const ChatCodeCopyRegion({
|
||||
super.key,
|
||||
required this.code,
|
||||
required this.cupertino,
|
||||
this.cupertino,
|
||||
required this.label,
|
||||
required this.child,
|
||||
});
|
||||
final String code;
|
||||
final bool cupertino;
|
||||
final bool? cupertino;
|
||||
final Widget label, child;
|
||||
@override
|
||||
State<ChatCodeCopyRegion> createState() => _ChatCodeCopyRegionState();
|
||||
@@ -170,7 +166,6 @@ class _ChatCodeCopyRegionState extends State<ChatCodeCopyRegion> {
|
||||
child: SelectionContainer.disabled(
|
||||
child: ChatCopyButton(
|
||||
text: widget.code,
|
||||
cupertino: widget.cupertino,
|
||||
showLabel: true,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -12,15 +12,9 @@ const String chatCopiedLabel = 'Copied';
|
||||
/// the clipboard. It shows a check for a moment after copying, so the operator
|
||||
/// sees the copy landed without a separate toast.
|
||||
class ChatCopyButton extends StatefulWidget {
|
||||
const ChatCopyButton({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.cupertino,
|
||||
this.showLabel = false,
|
||||
});
|
||||
const ChatCopyButton({super.key, required this.text, this.showLabel = false});
|
||||
|
||||
final String text;
|
||||
final bool cupertino;
|
||||
final bool showLabel;
|
||||
|
||||
@override
|
||||
|
||||
@@ -202,7 +202,6 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
||||
);
|
||||
return ChatCodeCopyRegion(
|
||||
code: code,
|
||||
cupertino: false,
|
||||
label: Text(markdownCodeLabel(language), style: labelStyle),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(color: _codeFill(context)),
|
||||
@@ -274,13 +273,7 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
||||
),
|
||||
onEnter: (event) {
|
||||
if (_route?.isCurrent != false) {
|
||||
_codeHover.show(
|
||||
context,
|
||||
token,
|
||||
text,
|
||||
event.position,
|
||||
cupertino: false,
|
||||
);
|
||||
_codeHover.show(context, token, text, event.position);
|
||||
}
|
||||
},
|
||||
onExit: (_) => _codeHover.scheduleHide(token),
|
||||
|
||||
@@ -31,13 +31,8 @@ Color chatBubbleFill(BuildContext context, Color base) {
|
||||
/// in the host's own surface roles. The agent's turn has no bubble at all; its
|
||||
/// text sits on the page, so only the operator's words are enclosed.
|
||||
class ChatUserBubble extends StatelessWidget {
|
||||
const ChatUserBubble({
|
||||
super.key,
|
||||
required this.cupertino,
|
||||
required this.child,
|
||||
});
|
||||
const ChatUserBubble({super.key, required this.child});
|
||||
|
||||
final bool cupertino;
|
||||
final Widget child;
|
||||
|
||||
static const BorderRadius _radius = BorderRadius.all(Radius.circular(20));
|
||||
@@ -65,13 +60,8 @@ class ChatUserBubble extends StatelessWidget {
|
||||
/// The agent's answer drawn straight on the page. Material keeps a transparent
|
||||
/// surface so disclosure ListTiles still paint their ink.
|
||||
class ChatAgentSurface extends StatelessWidget {
|
||||
const ChatAgentSurface({
|
||||
super.key,
|
||||
required this.cupertino,
|
||||
required this.child,
|
||||
});
|
||||
const ChatAgentSurface({super.key, required this.child});
|
||||
|
||||
final bool cupertino;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
@@ -81,7 +71,7 @@ class ChatAgentSurface extends StatelessWidget {
|
||||
|
||||
/// The transcript's reading text: the host's large body role, so answers read
|
||||
/// at a comfortable size and still follow the operator's text scaling.
|
||||
TextStyle? chatMessageTextStyle(BuildContext context, bool cupertino) =>
|
||||
TextStyle? chatMessageTextStyle(BuildContext context, [bool? cupertino]) =>
|
||||
Theme.of(context).textTheme.bodyLarge;
|
||||
|
||||
/// The empty-line gap between two paragraphs of a reply: about one line of
|
||||
|
||||
@@ -87,7 +87,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
: _agentRow(
|
||||
context,
|
||||
content,
|
||||
ChatAgentSurface(cupertino: false, child: body),
|
||||
ChatAgentSurface(child: body),
|
||||
gutter,
|
||||
),
|
||||
),
|
||||
@@ -117,7 +117,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
);
|
||||
final hasTimestamp = chatMessageCreatedAt(_userMessage) != null;
|
||||
if (thumbnails.isEmpty && footer.isEmpty && !hasTimestamp) {
|
||||
return ChatUserBubble(cupertino: false, child: body);
|
||||
return ChatUserBubble(child: body);
|
||||
}
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -132,7 +132,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
if (thumbnails.isNotEmpty && content.isNotEmpty)
|
||||
const SizedBox(height: 6),
|
||||
if (content.isNotEmpty || thumbnails.isEmpty)
|
||||
ChatUserBubble(cupertino: false, child: body),
|
||||
ChatUserBubble(child: body),
|
||||
if (footer.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
Wrap(
|
||||
@@ -181,9 +181,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
double gutter,
|
||||
) {
|
||||
final copyText = row['streaming'] == true ? '' : _answerText(_partsOf(row));
|
||||
final copy = copyText.isEmpty
|
||||
? null
|
||||
: ChatCopyButton(text: copyText, cupertino: false);
|
||||
final copy = copyText.isEmpty ? null : ChatCopyButton(text: copyText);
|
||||
if (gutter <= 0) return _agentTurn(context, content, answer, copy);
|
||||
return ChatCopyGutterRow(
|
||||
width: gutter,
|
||||
|
||||
Reference in New Issue
Block a user