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.
|
||||
|
||||
Reference in New Issue
Block a user