App: add a selectable app design with a Terminal look
AppDesign builds each design's light and dark ThemeData with an AppDesignTokens extension (corner radius, flat surfaces, frame colour, ANSI accents, prompt glyph). Settings gains a Design picker stored per device; the theme hosts rebuild live. Terminal is monospace (bundled RobotoMono), near-black or paper, flat 1px frames with 3px corners, and draws the chat transcript as prompt lines, tool dot/result lines and bracketed follow-up lines. Default keeps its exact themes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import 'composer_focus_request.dart';
|
||||
import 'composer_focus_restore.dart';
|
||||
import 'chat_bar_tint.dart';
|
||||
import 'composer_focus_ring.dart';
|
||||
import '../../../ui/theme/app_design_tokens.dart';
|
||||
import 'composer_running_border.dart';
|
||||
import '../shell/chat_shell_command.dart';
|
||||
import '../shell/chat_shell_mode_indicator.dart';
|
||||
@@ -1107,15 +1108,16 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
||||
/// ([ComposerRunningBorder]); it is mounted only for that time.
|
||||
Widget _pill(BuildContext context, Widget child) {
|
||||
final accent = chatFocusRingColor(context, widget.chatColor);
|
||||
final shape = AppDesignTokens.of(context).shape(_pillShape);
|
||||
return Stack(
|
||||
children: [
|
||||
ComposerFocusRing(
|
||||
focus: _focus,
|
||||
accent: accent,
|
||||
shape: _pillShape,
|
||||
shape: shape,
|
||||
child: GlassPill(
|
||||
key: const Key('chat-composer-pill'),
|
||||
shape: _pillShape,
|
||||
shape: shape,
|
||||
// The end controls keep the same gap from the pill's sides as from
|
||||
// its bottom (and its top while the field is one line).
|
||||
child: Padding(
|
||||
@@ -1130,7 +1132,7 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
||||
child: ListenableBuilder(
|
||||
listenable: _focus,
|
||||
builder: (context, _) => ComposerRunningBorder(
|
||||
shape: _pillShape,
|
||||
shape: shape,
|
||||
primary: accent,
|
||||
tertiary: Theme.of(context).colorScheme.tertiary,
|
||||
focused: _focus.hasFocus,
|
||||
@@ -1312,6 +1314,10 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
||||
// Let a long folder name wrap when the attach and primary controls
|
||||
// leave little horizontal room.
|
||||
hintMaxLines: 2,
|
||||
// A terminal design's prompt glyph leads the field, as a CLI's
|
||||
// input line does.
|
||||
prefixIcon: _promptGlyph(context),
|
||||
prefixIconConstraints: const BoxConstraints(),
|
||||
// The pill draws the field's surface; the field adds no border.
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
@@ -1320,6 +1326,26 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
|
||||
);
|
||||
}
|
||||
|
||||
/// The prompt glyph before the field under a terminal design; null under
|
||||
/// the Default design.
|
||||
Widget? _promptGlyph(BuildContext context) {
|
||||
final tokens = AppDesignTokens.of(context);
|
||||
if (!tokens.terminal) return null;
|
||||
return ExcludeSemantics(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 4, end: 10),
|
||||
child: Text(
|
||||
tokens.promptGlyph,
|
||||
key: const Key('chat-composer-prompt-glyph'),
|
||||
style: TextStyle(
|
||||
color: chatFocusRingColor(context, widget.chatColor),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// The single primary control: Send (or Run command for a `!` draft). A
|
||||
/// prompt sent while a turn runs takes the server's queued-prompt path; the
|
||||
/// running turn is stopped by Escape twice, `/stop`, or the More menu.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
|
||||
import '../../conversation/chat_schedule_time.dart';
|
||||
import '../../domain/chat_prompt_origin.dart';
|
||||
import 'chat_copy_button.dart';
|
||||
import 'chat_hover_actions.dart';
|
||||
import 'terminal/terminal_glyphs.dart';
|
||||
|
||||
/// The header words of an automated prompt.
|
||||
String chatAutomatedPromptLabel(ChatPromptOrigin origin) => switch (origin) {
|
||||
@@ -64,35 +67,40 @@ class ChatAutomatedPromptCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
);
|
||||
final card = Material(
|
||||
key: const Key('chat-automated-prompt'),
|
||||
color: scheme.surfaceContainerLow,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
side: BorderSide(color: scheme.outlineVariant),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(14, 8, 14, 10),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
header,
|
||||
if (prompt.body.trim().isNotEmpty) ...[
|
||||
const SizedBox(height: 4),
|
||||
DefaultTextStyle.merge(
|
||||
style: theme.textTheme.bodyMedium,
|
||||
child: body,
|
||||
final card = AppDesignTokens.of(context).terminal
|
||||
? _terminalLine(context, label, detail)
|
||||
: Material(
|
||||
key: const Key('chat-automated-prompt'),
|
||||
color: scheme.surfaceContainerLow,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
side: BorderSide(color: scheme.outlineVariant),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(14, 8, 14, 10),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
header,
|
||||
if (prompt.body.trim().isNotEmpty) ...[
|
||||
const SizedBox(height: 4),
|
||||
DefaultTextStyle.merge(
|
||||
style: theme.textTheme.bodyMedium,
|
||||
child: body,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
final copy = prompt.body.trim().isEmpty
|
||||
? null
|
||||
: ChatHoverReveal(child: ChatCopyButton(text: prompt.body.trim()));
|
||||
final footerInset = AppDesignTokens.of(context).terminal
|
||||
? 8 + terminalGlyphColumn(context)
|
||||
: 14.0;
|
||||
return ChatHoverRegion(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -101,7 +109,7 @@ class ChatAutomatedPromptCard extends StatelessWidget {
|
||||
card,
|
||||
if (footer.isNotEmpty || timestamp != null || copy != null)
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 14, top: 2),
|
||||
padding: EdgeInsetsDirectional.only(start: footerInset, top: 2),
|
||||
child: Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
@@ -115,6 +123,90 @@ class ChatAutomatedPromptCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
extension on ChatAutomatedPromptCard {
|
||||
/// Under a terminal design the prompt is not a card but dim bracketed
|
||||
/// lines, as a CLI prints a message it injected: `[Follow-up from agent ·
|
||||
/// scheduled …]`, then the prompt behind a dim rule.
|
||||
Widget _terminalLine(BuildContext context, String label, String? detail) {
|
||||
final theme = Theme.of(context);
|
||||
final dim = theme.textTheme.bodyMedium?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
final header = SelectionContainer.disabled(
|
||||
child: Text.rich(
|
||||
key: const Key('chat-automated-prompt-header'),
|
||||
TextSpan(
|
||||
style: dim,
|
||||
children: [
|
||||
const TextSpan(text: '['),
|
||||
TextSpan(
|
||||
text: label,
|
||||
style: const TextStyle(fontWeight: FontWeight.w700),
|
||||
),
|
||||
if (detail != null) TextSpan(text: ' · $detail'),
|
||||
const TextSpan(text: ']'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
// Inset like the answer's text, so the bracket starts in the same
|
||||
// column as the agent's dots.
|
||||
return Material(
|
||||
key: const Key('chat-automated-prompt'),
|
||||
type: MaterialType.transparency,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 8),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
header,
|
||||
if (prompt.body.trim().isNotEmpty)
|
||||
IntrinsicHeight(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: terminalGlyphColumn(context),
|
||||
child: CustomPaint(
|
||||
painter: _RulePainter(theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: DefaultTextStyle.merge(style: dim, child: body),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// The dim vertical rule beside an injected prompt's text.
|
||||
class _RulePainter extends CustomPainter {
|
||||
const _RulePainter(this.color);
|
||||
|
||||
final Color color;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final x = size.width * 0.25;
|
||||
canvas.drawLine(
|
||||
Offset(x, 2),
|
||||
Offset(x, size.height - 2),
|
||||
Paint()
|
||||
..color = color
|
||||
..strokeWidth = 1,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(_RulePainter old) => old.color != color;
|
||||
}
|
||||
|
||||
/// The small "Scheduled" mark under the operator's own message they had
|
||||
/// scheduled to send later, once it is no longer waiting.
|
||||
class ChatScheduledMark extends StatelessWidget {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'chat_copy_button.dart';
|
||||
|
||||
@@ -151,6 +152,9 @@ class ChatCodeCopyRegion extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final corners = AppDesignTokens.of(
|
||||
context,
|
||||
).corners(BorderRadius.circular(radius));
|
||||
final header = ColoredBox(
|
||||
key: const Key('chat-code-header'),
|
||||
color: headerFill(context),
|
||||
@@ -170,10 +174,10 @@ class ChatCodeCopyRegion extends StatelessWidget {
|
||||
position: DecorationPosition.foreground,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: scheme.outlineVariant),
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
borderRadius: corners,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(radius),
|
||||
borderRadius: corners,
|
||||
child: ColoredBox(
|
||||
key: const Key('chat-code-body'),
|
||||
color: fill(context),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
import 'chat_transcript_selection.dart';
|
||||
@@ -521,6 +523,17 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
|
||||
/// heading never reads like a paragraph.
|
||||
TextStyle? _headingStyle(BuildContext context, int level) {
|
||||
final text = Theme.of(context).textTheme;
|
||||
// A terminal prints headings at the text's own size, in bold; the top
|
||||
// level takes the accent colour.
|
||||
if (AppDesignTokens.of(context).terminal) {
|
||||
return _roleStyle(
|
||||
context,
|
||||
text.bodyLarge?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: level == 1 ? Theme.of(context).colorScheme.primary : null,
|
||||
),
|
||||
);
|
||||
}
|
||||
final role = switch (level) {
|
||||
1 => text.headlineSmall,
|
||||
2 => text.titleLarge,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
import '../sessions/chat_color_palette.dart';
|
||||
import 'terminal/terminal_prompt_line.dart';
|
||||
|
||||
/// How strongly a coloured chat's shade washes the operator's bubbles over
|
||||
/// the host's neutral bubble fill. Text keeps the host's colours.
|
||||
@@ -43,6 +45,9 @@ class ChatUserBubble extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (AppDesignTokens.of(context).terminal) {
|
||||
return TerminalPromptLine(child: child);
|
||||
}
|
||||
// A Material surface (not a bare DecoratedBox) so a disclosure ListTile
|
||||
// inside the bubble keeps its ink and background.
|
||||
return Material(
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
|
||||
import '../../../../core/api_gateway.dart';
|
||||
import '../../data/chat_attachment_images.dart';
|
||||
import 'chat_attachment_gallery.dart';
|
||||
@@ -16,6 +18,7 @@ import 'chat_link_text.dart';
|
||||
import 'chat_message_bubble.dart';
|
||||
import 'chat_turn_activity_view.dart';
|
||||
import 'native_disclosure.dart';
|
||||
import 'terminal/terminal_glyphs.dart';
|
||||
import 'chat_message_timestamp.dart';
|
||||
import 'chat_read_aloud_button.dart';
|
||||
import '../../speech/speech_controller.dart';
|
||||
@@ -76,6 +79,11 @@ class ChatMessageView extends StatelessWidget {
|
||||
// A wide window draws an answer's Copy in the gutter left of the reading
|
||||
// column; without room it trails the time in the answer's footer.
|
||||
final gutter = user ? 0.0 : ChatCopyGutter.of(context);
|
||||
// A terminal design reads top to bottom like a CLI: the operator's
|
||||
// prompt line starts at the same edge as the answer and spans its
|
||||
// column.
|
||||
final terminal = AppDesignTokens.of(context).terminal;
|
||||
final trailingUser = user && !automated && !terminal;
|
||||
// No visible role label: side and surface say who spoke and the row's
|
||||
// semantics label names the role. The operator's turn is a neutral bubble
|
||||
// that shrinks to its content; the agent's answer sits on the page with no
|
||||
@@ -96,7 +104,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) => Align(
|
||||
alignment: user && !automated
|
||||
alignment: trailingUser
|
||||
? AlignmentDirectional.centerEnd
|
||||
: AlignmentDirectional.centerStart,
|
||||
child: ConstrainedBox(
|
||||
@@ -104,14 +112,14 @@ class ChatMessageView extends StatelessWidget {
|
||||
// sides read as a conversation; the answer keeps a readable
|
||||
// measure on a wide pane.
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: user
|
||||
maxWidth: trailingUser
|
||||
? (constraints.maxWidth * 0.85).clamp(0, 560).toDouble()
|
||||
: 720 + gutter,
|
||||
),
|
||||
child: automated
|
||||
? _automatedTurn(origin, content)
|
||||
: user
|
||||
? _userTurn(content, body, origin)
|
||||
? _userTurn(content, body, origin, terminal: terminal)
|
||||
: _agentRow(
|
||||
context,
|
||||
content,
|
||||
@@ -135,7 +143,12 @@ class ChatMessageView extends StatelessWidget {
|
||||
/// Attached images sit above the operator's bubble, as their own thumbnails;
|
||||
/// an images-only turn draws no empty bubble. The footer (the delivery line)
|
||||
/// sits under the bubble's trailing corner.
|
||||
Widget _userTurn(List<Widget> content, Widget body, ChatPromptOrigin origin) {
|
||||
Widget _userTurn(
|
||||
List<Widget> content,
|
||||
Widget body,
|
||||
ChatPromptOrigin origin, {
|
||||
required bool terminal,
|
||||
}) {
|
||||
final thumbnails = [
|
||||
for (final part in _partsOf(_userMessage))
|
||||
if (_isFile(part) && chatPartIsThumbnail(part)) part,
|
||||
@@ -150,7 +163,9 @@ class ChatMessageView extends StatelessWidget {
|
||||
}
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
crossAxisAlignment: terminal
|
||||
? CrossAxisAlignment.stretch
|
||||
: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (thumbnails.isNotEmpty)
|
||||
ChatAttachmentGallery(
|
||||
@@ -167,7 +182,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
alignment: WrapAlignment.end,
|
||||
alignment: terminal ? WrapAlignment.start : WrapAlignment.end,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
...footer,
|
||||
@@ -307,6 +322,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
for (final part in parts)
|
||||
if (isChatToolPart(part)) part,
|
||||
];
|
||||
final terminal = AppDesignTokens.of(context).terminal;
|
||||
final model = '${row['model'] ?? ''}'.trim();
|
||||
// The metadata line: the model that answered and the time, muted; the
|
||||
// actions (when not in the gutter) trail it.
|
||||
@@ -345,7 +361,7 @@ class ChatMessageView extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: chatAgentContentInset,
|
||||
),
|
||||
child: answer,
|
||||
child: terminal ? _terminalAnswer(context, answer) : answer,
|
||||
),
|
||||
// Settled permissions, questions and changes: meta rows that, like
|
||||
// the activity line, sit at the row edge with their content inset to
|
||||
@@ -363,7 +379,10 @@ class ChatMessageView extends StatelessWidget {
|
||||
// trail it, so hidden actions leave no gap before it. Without
|
||||
// metadata the buttons' own inset aligns their icons instead.
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: meta.isEmpty ? 0 : chatAgentContentInset,
|
||||
start: meta.isEmpty
|
||||
? 0
|
||||
: chatAgentContentInset +
|
||||
(terminal ? terminalGlyphColumn(context) : 0),
|
||||
end: chatAgentContentInset,
|
||||
),
|
||||
child: Wrap(
|
||||
@@ -377,6 +396,18 @@ class ChatMessageView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// The answer under a terminal design: a dot in the glyph column, as a
|
||||
/// CLI agent marks its reply, then the text.
|
||||
Widget _terminalAnswer(BuildContext context, Widget answer) =>
|
||||
TerminalGlyphRow(
|
||||
glyph: TerminalGlyph(
|
||||
TerminalGlyphKind.dot,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
style: chatMessageTextStyle(context),
|
||||
),
|
||||
child: answer,
|
||||
);
|
||||
|
||||
/// The answer as the operator reads it: the turn's text parts in order,
|
||||
/// without reasoning, tools or attachments.
|
||||
List<String> _answerParts(List<JsonMap> parts) => [
|
||||
|
||||
@@ -5,9 +5,11 @@ import 'package:flutter/material.dart';
|
||||
import '../../../../core/api_gateway.dart';
|
||||
import '../../domain/chat_turn_activity.dart';
|
||||
import '../../../../ui/adaptive/platform.dart';
|
||||
import '../../../../ui/theme/app_design_tokens.dart';
|
||||
import 'chat_response_pending.dart';
|
||||
import 'chat_turn_activity_details.dart';
|
||||
import 'chat_turn_chip.dart';
|
||||
import 'terminal/terminal_activity_rows.dart';
|
||||
|
||||
/// The activity control's content inset is shared with the rest of the reply.
|
||||
const chatAgentContentInset = 8.0;
|
||||
@@ -120,6 +122,15 @@ class _ChatTurnActivityViewState extends State<ChatTurnActivityView> {
|
||||
: DateTime.now().difference(started);
|
||||
final seconds = duration.inSeconds.clamp(0, 2147483647);
|
||||
final label = '${data.label}${widget.streaming ? ' ${seconds}s' : ''}';
|
||||
if (AppDesignTokens.of(context).terminal) {
|
||||
return TerminalActivityRows(
|
||||
data: data,
|
||||
status: label,
|
||||
streaming: widget.streaming,
|
||||
seconds: seconds,
|
||||
onOpen: _open,
|
||||
);
|
||||
}
|
||||
// Desktop hover hugs the label; phones keep the full-width touch row.
|
||||
final compact = prefersCompactHitTargets(context);
|
||||
final content = ConstrainedBox(
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../core/api_gateway.dart';
|
||||
import '../../../../../ui/theme/app_design_tokens.dart';
|
||||
import '../../../domain/chat_tool_calls.dart';
|
||||
import '../../../domain/chat_turn_activity.dart';
|
||||
import '../chat_response_pending.dart';
|
||||
import 'terminal_glyphs.dart';
|
||||
|
||||
/// How many of a turn's calls the transcript lists; earlier ones fold into
|
||||
/// one "earlier" line (every call stays in the details dialog).
|
||||
const int terminalActivityMaxCalls = 6;
|
||||
|
||||
/// A turn's activity under a terminal design, as a CLI agent prints it: one
|
||||
/// `● Tool(detail)` line per call, its status in the dot's colour, with a
|
||||
/// `⎿ result` line beneath, and while the turn runs a live status line.
|
||||
/// The block is one button that opens the activity details, like the
|
||||
/// Default design's one-line status.
|
||||
class TerminalActivityRows extends StatelessWidget {
|
||||
const TerminalActivityRows({
|
||||
super.key,
|
||||
required this.data,
|
||||
required this.status,
|
||||
required this.streaming,
|
||||
required this.onOpen,
|
||||
this.seconds = 0,
|
||||
});
|
||||
|
||||
final ChatTurnActivityData data;
|
||||
|
||||
/// The turn's one-line status (with its running seconds while streaming).
|
||||
final String status;
|
||||
final bool streaming;
|
||||
final VoidCallback onOpen;
|
||||
|
||||
/// How long the running turn has been doing what it does now.
|
||||
final int seconds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final scheme = theme.colorScheme;
|
||||
final ansi = AppDesignTokens.of(context).ansi;
|
||||
final style = theme.textTheme.bodyMedium!;
|
||||
final dim = style.copyWith(color: scheme.onSurfaceVariant);
|
||||
final calls = data.tools;
|
||||
final shown = calls.length > terminalActivityMaxCalls
|
||||
? calls.sublist(calls.length - terminalActivityMaxCalls)
|
||||
: calls;
|
||||
final hidden = calls.length - shown.length;
|
||||
final lines = <Widget>[
|
||||
if (data.reasoning.isNotEmpty && calls.isEmpty && !streaming)
|
||||
_line(context, TerminalGlyphKind.dot, scheme.onSurfaceVariant, [
|
||||
TextSpan(text: 'Thought', style: dim),
|
||||
]),
|
||||
if (hidden > 0)
|
||||
_line(context, null, scheme.onSurfaceVariant, [
|
||||
TextSpan(
|
||||
text: '… +$hidden earlier tool ${hidden == 1 ? 'use' : 'uses'}',
|
||||
style: dim,
|
||||
),
|
||||
]),
|
||||
for (final call in shown) ..._call(context, call, style, dim, ansi),
|
||||
if (calls.isEmpty && data.reasoning.isEmpty && !streaming)
|
||||
_line(context, TerminalGlyphKind.dot, scheme.onSurfaceVariant, [
|
||||
TextSpan(text: status, style: dim),
|
||||
]),
|
||||
if (streaming) _live(context, style),
|
||||
];
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: '$status, expand for details',
|
||||
excludeSemantics: true,
|
||||
onTap: onOpen,
|
||||
child: InkWell(
|
||||
key: const Key('chat-turn-activity'),
|
||||
onTap: onOpen,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: 40),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: DefaultTextStyle.merge(
|
||||
style: style,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: lines,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> _call(
|
||||
BuildContext context,
|
||||
JsonMap call,
|
||||
TextStyle style,
|
||||
TextStyle dim,
|
||||
AnsiAccents? ansi,
|
||||
) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final failed = chatToolFailed(call);
|
||||
final running = chatToolRunning(call);
|
||||
final color = failed
|
||||
? ansi?.red ?? scheme.error
|
||||
: running
|
||||
? ansi?.yellow ?? scheme.tertiary
|
||||
: ansi?.green ?? scheme.primary;
|
||||
final detail = chatToolDetail(call);
|
||||
final head = [
|
||||
TextSpan(
|
||||
text: chatToolLabel(call),
|
||||
style: style.copyWith(fontWeight: FontWeight.w700),
|
||||
),
|
||||
if (detail != null) TextSpan(text: '($detail)', style: dim),
|
||||
];
|
||||
final duration = chatToolDurationMillis(call);
|
||||
final String result;
|
||||
if (running) {
|
||||
result = 'running…';
|
||||
} else {
|
||||
final text = failed ? chatToolErrorText(call) : chatToolOutputText(call);
|
||||
final first = text
|
||||
.split('\n')
|
||||
.map((line) => line.trim())
|
||||
.firstWhere((line) => line.isNotEmpty, orElse: () => '');
|
||||
final more = text.trim().split('\n').length - 1;
|
||||
result = [
|
||||
if (first.isNotEmpty) first,
|
||||
if (more > 0) '+$more lines',
|
||||
if (duration != null) formatChatToolDuration(duration),
|
||||
].join(' · ');
|
||||
}
|
||||
return [
|
||||
_line(context, TerminalGlyphKind.dot, color, head),
|
||||
if (result.isNotEmpty)
|
||||
_line(context, TerminalGlyphKind.elbow, scheme.outline, [
|
||||
TextSpan(
|
||||
text: result,
|
||||
style: failed ? dim.copyWith(color: color) : dim,
|
||||
),
|
||||
], indent: true),
|
||||
];
|
||||
}
|
||||
|
||||
/// The running status: the pending dots, then what the turn is doing and
|
||||
/// for how long, in the accent colour.
|
||||
Widget _live(BuildContext context, TextStyle style) {
|
||||
final accent =
|
||||
AppDesignTokens.of(context).ansi?.yellow ??
|
||||
Theme.of(context).colorScheme.primary;
|
||||
return Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: terminalGlyphColumn(context),
|
||||
child: ExcludeSemantics(
|
||||
child: DefaultTextStyle.merge(
|
||||
style: TextStyle(color: accent),
|
||||
child: const Align(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: ChatResponsePending(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Text(
|
||||
'${data.label}… (${seconds}s)',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: style.copyWith(color: accent),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _line(
|
||||
BuildContext context,
|
||||
TerminalGlyphKind? glyph,
|
||||
Color glyphColor,
|
||||
List<TextSpan> spans, {
|
||||
bool indent = false,
|
||||
}) {
|
||||
final column = terminalGlyphColumn(context);
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: indent ? column * 0.5 : 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (glyph == null)
|
||||
SizedBox(width: column)
|
||||
else
|
||||
TerminalGlyph(glyph, color: glyphColor),
|
||||
Flexible(
|
||||
child: Text.rich(
|
||||
TextSpan(children: spans),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// The width of a terminal transcript's glyph column: about two monospace
|
||||
/// cells of the ambient text, so lines after a glyph align like a CLI's.
|
||||
double terminalGlyphColumn(BuildContext context) {
|
||||
final style = DefaultTextStyle.of(context).style;
|
||||
final size = MediaQuery.textScalerOf(context).scale(style.fontSize ?? 14);
|
||||
return size * 1.3;
|
||||
}
|
||||
|
||||
/// The height of one line of the ambient text, so a painted glyph centres on
|
||||
/// the first line of the text beside it.
|
||||
double terminalLineHeight(BuildContext context, [TextStyle? style]) {
|
||||
final ambient = style ?? DefaultTextStyle.of(context).style;
|
||||
final size = MediaQuery.textScalerOf(context).scale(ambient.fontSize ?? 14);
|
||||
return size * (ambient.height ?? 1.35);
|
||||
}
|
||||
|
||||
/// The kind of mark a terminal transcript draws in its glyph column. They
|
||||
/// are painted rather than typed: the bundled monospace family has no
|
||||
/// record (U+25CF) or bracket corner (U+23BF), and the web engine would
|
||||
/// otherwise fetch a fallback font for them.
|
||||
enum TerminalGlyphKind {
|
||||
/// A filled dot: an answer, or a tool call (its colour gives the status).
|
||||
dot,
|
||||
|
||||
/// A bracket corner under a call: its result line.
|
||||
elbow,
|
||||
}
|
||||
|
||||
/// One painted terminal glyph, a glyph column wide and one text line tall,
|
||||
/// in [color].
|
||||
class TerminalGlyph extends StatelessWidget {
|
||||
const TerminalGlyph(this.kind, {super.key, required this.color, this.style});
|
||||
|
||||
final TerminalGlyphKind kind;
|
||||
final Color color;
|
||||
|
||||
/// The text the glyph sits beside; the ambient style when null.
|
||||
final TextStyle? style;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ExcludeSemantics(
|
||||
child: SizedBox(
|
||||
width: terminalGlyphColumn(context),
|
||||
height: terminalLineHeight(context, style),
|
||||
child: CustomPaint(painter: _GlyphPainter(kind, color)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class _GlyphPainter extends CustomPainter {
|
||||
const _GlyphPainter(this.kind, this.color);
|
||||
|
||||
final TerminalGlyphKind kind;
|
||||
final Color color;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final h = size.height;
|
||||
final paint = Paint()
|
||||
..color = color
|
||||
..isAntiAlias = true;
|
||||
switch (kind) {
|
||||
case TerminalGlyphKind.dot:
|
||||
canvas.drawCircle(Offset(h * 0.3, h / 2), h * 0.17, paint);
|
||||
case TerminalGlyphKind.elbow:
|
||||
paint
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1;
|
||||
final x = h * 0.3;
|
||||
final path = Path()
|
||||
..moveTo(x, 0)
|
||||
..lineTo(x, h * 0.55)
|
||||
..lineTo(size.width * 0.95, h * 0.55);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(_GlyphPainter old) =>
|
||||
old.kind != kind || old.color != color;
|
||||
}
|
||||
|
||||
/// [child] after a [glyph] in the glyph column, the glyph centred on the
|
||||
/// child's first line.
|
||||
class TerminalGlyphRow extends StatelessWidget {
|
||||
const TerminalGlyphRow({super.key, required this.glyph, required this.child});
|
||||
|
||||
final Widget glyph;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
glyph,
|
||||
Expanded(child: child),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../ui/theme/app_design_tokens.dart';
|
||||
import '../../sessions/chat_color_palette.dart';
|
||||
import '../chat_message_bubble.dart';
|
||||
|
||||
/// How strongly a coloured chat's shade washes a prompt line's band.
|
||||
const double terminalPromptTint = 0.1;
|
||||
|
||||
/// The operator's turn under a terminal design: a prompt line, the prompt
|
||||
/// glyph then the message, over a faint band with a dim gutter on its
|
||||
/// leading edge (in the chat's colour when it has one). It spans the reading
|
||||
/// column instead of shrinking into a bubble.
|
||||
class TerminalPromptLine extends StatelessWidget {
|
||||
const TerminalPromptLine({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = AppDesignTokens.of(context);
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final shade = chatColorShade(context, ChatBubbleColor.of(context));
|
||||
final gutter = shade ?? scheme.outline;
|
||||
final glyph = shade ?? scheme.primary;
|
||||
return Material(
|
||||
key: const Key('chat-terminal-prompt-line'),
|
||||
// A faint wash of the chat's colour: its gutter and glyph carry it.
|
||||
color: shade == null
|
||||
? scheme.surfaceContainerLow
|
||||
: Color.alphaBlend(
|
||||
shade.withValues(alpha: terminalPromptTint),
|
||||
scheme.surfaceContainerLow,
|
||||
),
|
||||
shape: BorderDirectional(start: BorderSide(color: gutter, width: 2)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(10, 6, 12, 6),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ExcludeSemantics(
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.only(end: 10),
|
||||
child: Text(
|
||||
tokens.promptGlyph,
|
||||
style: chatMessageTextStyle(
|
||||
context,
|
||||
)?.copyWith(color: glyph, fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(child: child),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -105,10 +105,7 @@ class GraphStageNode extends StatelessWidget {
|
||||
// coloured, smaller text in the status's own hue.
|
||||
final color = status == null
|
||||
? null
|
||||
: runStatusColor(
|
||||
graphStatusState(status),
|
||||
Theme.of(context).colorScheme,
|
||||
);
|
||||
: runStatusColorOf(context, graphStatusState(status));
|
||||
final caption = node.kindCaption;
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -278,10 +278,7 @@ class PipelineListPanel extends StatelessWidget {
|
||||
? null
|
||||
: AppListStatusDot(
|
||||
key: Key('pipeline-status-${pipeline.id}'),
|
||||
color: runStatusColor(
|
||||
badge.state,
|
||||
Theme.of(context).colorScheme,
|
||||
),
|
||||
color: runStatusColorOf(context, badge.state),
|
||||
semanticLabel: runStateLabel(badge.state),
|
||||
),
|
||||
subtitle: Text(
|
||||
|
||||
@@ -74,7 +74,7 @@ class RunCheckCommandRow extends StatelessWidget {
|
||||
final mono = (theme.textTheme.bodyMedium ?? const TextStyle()).copyWith(
|
||||
fontFamily: appMonospaceFamily,
|
||||
);
|
||||
final color = runStatusColor(_state(check.status), theme.colorScheme);
|
||||
final color = runStatusColorOf(context, _state(check.status));
|
||||
final meta = check.meta;
|
||||
return ExpansionTile(
|
||||
tilePadding: EdgeInsets.zero,
|
||||
|
||||
@@ -111,7 +111,7 @@ class RunTimelineRow extends StatelessWidget {
|
||||
context,
|
||||
visit.outcome,
|
||||
)
|
||||
: runStatusColor(_state, Theme.of(context).colorScheme);
|
||||
: runStatusColorOf(context, _state);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
@@ -139,7 +139,7 @@ class RunTimelineRow extends StatelessWidget {
|
||||
divider: divider,
|
||||
onTap: onTap,
|
||||
leading: AppListAvatar(
|
||||
foreground: runStatusColor(state, Theme.of(context).colorScheme),
|
||||
foreground: runStatusColorOf(context, state),
|
||||
child: RunStatusIcon(
|
||||
state: state,
|
||||
label: visit.status.isEmpty ? 'Status unavailable' : visit.status,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../ui/theme/app_design_tokens.dart';
|
||||
|
||||
import '../../../core/api_gateway.dart';
|
||||
import '../../../ui/status/run_status_icon.dart';
|
||||
@@ -116,11 +117,11 @@ class _FactGrid extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _pill(BuildContext context, VisitFact fact) {
|
||||
final color = runStatusColor(_stateOf(fact), Theme.of(context).colorScheme);
|
||||
final color = runStatusColorOf(context, _stateOf(fact));
|
||||
return DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: color.withValues(alpha: 0.16),
|
||||
shape: const StadiumBorder(),
|
||||
shape: AppDesignTokens.of(context).shape(const StadiumBorder()),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../ui/theme/app_design_tokens.dart';
|
||||
|
||||
import '../../../ui/adaptive/segmented_bar.dart';
|
||||
import '../../../core/api_gateway.dart';
|
||||
@@ -46,6 +47,9 @@ class RunGraphPreview extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
final border = Theme.of(context).colorScheme.outlineVariant;
|
||||
final corners = AppDesignTokens.of(
|
||||
context,
|
||||
).corners(BorderRadius.circular(12));
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 0),
|
||||
child: Semantics(
|
||||
@@ -60,10 +64,10 @@ class RunGraphPreview extends StatelessWidget {
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: border),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: corners,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: corners,
|
||||
child: SizedBox(
|
||||
height: height,
|
||||
child: Stack(
|
||||
|
||||
@@ -136,7 +136,7 @@ class RunListRow extends StatelessWidget {
|
||||
onLongPress: selecting ? null : onLongPress,
|
||||
selectionControl: selecting ? _checkbox(context) : null,
|
||||
leading: AppListAvatar(
|
||||
foreground: runStatusColor(state, Theme.of(context).colorScheme),
|
||||
foreground: runStatusColorOf(context, state),
|
||||
child: RunStatusIcon(state: state, label: runStatusLabel(run)),
|
||||
),
|
||||
title: Text(title),
|
||||
|
||||
@@ -59,7 +59,7 @@ class RunPathMini extends StatelessWidget {
|
||||
width: 14,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: runStatusColor(stage.state, Theme.of(context).colorScheme),
|
||||
color: runStatusColorOf(context, stage.state),
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
);
|
||||
@@ -81,9 +81,9 @@ class RunPathMini extends StatelessWidget {
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: runStatusColor(
|
||||
color: runStatusColorOf(
|
||||
context,
|
||||
end == '#success' ? 'succeeded' : 'failed',
|
||||
Theme.of(context).colorScheme,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -91,13 +91,7 @@ class RunsStatsPage extends StatelessWidget {
|
||||
key: const ValueKey('runs.stats.pie'),
|
||||
painter: _PiePainter([
|
||||
for (final entry in byState.entries)
|
||||
(
|
||||
runStatusColor(
|
||||
entry.key,
|
||||
Theme.of(context).colorScheme,
|
||||
),
|
||||
entry.value,
|
||||
),
|
||||
(runStatusColorOf(context, entry.key), entry.value),
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../ui/theme/app_design.dart';
|
||||
import '../../ui/theme/app_design_controller.dart';
|
||||
import 'settings_group.dart';
|
||||
import 'settings_theme.dart';
|
||||
|
||||
const designSectionTitle = 'Design';
|
||||
const designSectionFooter =
|
||||
'Saved on this device only and applied at once. Light and dark follow '
|
||||
'the system under every design; Terminal uses its monospace font '
|
||||
'instead of the Font choice below.';
|
||||
const designSaveFailedText =
|
||||
'Not saved on this device; it applies until reload.';
|
||||
|
||||
ValueKey<String> settingsDesignKey(AppDesign design) =>
|
||||
ValueKey<String>('settings-design-${design.id}');
|
||||
|
||||
/// The device's app-wide design: one radio row per [AppDesign], each with a
|
||||
/// one-line summary. A choice applies at once, without a restart.
|
||||
class SettingsDesignSection extends StatelessWidget {
|
||||
const SettingsDesignSection({super.key, required this.controller});
|
||||
|
||||
final AppDesignController controller;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ListenableBuilder(
|
||||
listenable: controller,
|
||||
builder: (context, _) => RadioGroup<AppDesign>(
|
||||
groupValue: controller.design,
|
||||
onChanged: (design) {
|
||||
if (design != null) unawaited(controller.select(design));
|
||||
},
|
||||
child: SettingsGroup(
|
||||
title: designSectionTitle,
|
||||
footer: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Text(designSectionFooter),
|
||||
if (controller.saveFailed)
|
||||
Text(
|
||||
designSaveFailedText,
|
||||
style: TextStyle(color: settingsErrorColor(context)),
|
||||
),
|
||||
],
|
||||
),
|
||||
children: [
|
||||
for (final design in AppDesign.values)
|
||||
RadioListTile<AppDesign>(
|
||||
key: settingsDesignKey(design),
|
||||
value: design,
|
||||
title: Text(design.label),
|
||||
subtitle: Text(design.description),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../ui/theme/app_design_tokens.dart';
|
||||
|
||||
import 'settings_layout.dart';
|
||||
|
||||
@@ -31,6 +32,7 @@ class SettingsGroup extends StatelessWidget {
|
||||
final title = this.title;
|
||||
final footer = this.footer;
|
||||
final theme = Theme.of(context);
|
||||
final tokens = AppDesignTokens.of(context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
@@ -50,10 +52,17 @@ class SettingsGroup extends StatelessWidget {
|
||||
if (children.isNotEmpty)
|
||||
Material(
|
||||
type: MaterialType.card,
|
||||
color: theme.colorScheme.surfaceContainer,
|
||||
color: tokens.flat
|
||||
? theme.colorScheme.surfaceContainerLow
|
||||
: theme.colorScheme.surfaceContainer,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(settingsGroupRadius),
|
||||
borderRadius: tokens.corners(
|
||||
BorderRadius.circular(settingsGroupRadius),
|
||||
),
|
||||
side: tokens.frame == null
|
||||
? BorderSide.none
|
||||
: BorderSide(color: tokens.frame!),
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
|
||||
@@ -28,6 +28,14 @@ extension _SettingsPageSections on _SettingsScreenState {
|
||||
widget.animationSpeed ?? AnimationSpeedController.instance,
|
||||
),
|
||||
),
|
||||
SettingsSection(
|
||||
id: 'design',
|
||||
title: designSectionTitle,
|
||||
keywords: 'design theme look style terminal monospace appearance',
|
||||
builder: (_) => SettingsDesignSection(
|
||||
controller: widget.designs ?? AppDesignController.instance,
|
||||
),
|
||||
),
|
||||
SettingsSection(
|
||||
id: 'font',
|
||||
title: fontSectionTitle,
|
||||
|
||||
@@ -11,10 +11,12 @@ import '../attention/notify/notification_controller.dart';
|
||||
import '../attention/notify/notification_models.dart';
|
||||
import 'default_endpoint.dart';
|
||||
import 'settings_controller.dart';
|
||||
import 'settings_design_section.dart';
|
||||
import 'settings_font_section.dart';
|
||||
import 'settings_animation_section.dart';
|
||||
import 'settings_scale_section.dart';
|
||||
import '../../ui/motion/animation_speed.dart';
|
||||
import '../../ui/theme/app_design_controller.dart';
|
||||
import '../../ui/theme/app_font_controller.dart';
|
||||
import 'settings_group.dart';
|
||||
import 'storage/settings_storage_section.dart';
|
||||
@@ -72,6 +74,7 @@ class SettingsScreen extends StatefulWidget {
|
||||
this.deliveryService,
|
||||
this.deliveryServiceController,
|
||||
this.fonts,
|
||||
this.designs,
|
||||
this.animationSpeed,
|
||||
this.terminalLayout,
|
||||
this.onShowWalkthrough,
|
||||
@@ -83,6 +86,9 @@ class SettingsScreen extends StatefulWidget {
|
||||
|
||||
/// The device's interface font; defaults to the app's shared controller.
|
||||
final AppFontController? fonts;
|
||||
|
||||
/// The device's app-wide design; defaults to the app's shared controller.
|
||||
final AppDesignController? designs;
|
||||
final AnimationSpeedController? animationSpeed;
|
||||
|
||||
/// The terminal surface's layout (its mode is chosen here); null is the
|
||||
|
||||
Reference in New Issue
Block a user