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:
@@ -0,0 +1,101 @@
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
|
||||
/// `?cli=1`: a coding exchange shaped like a CLI agent session, for design
|
||||
/// reviews of the transcript's tool rows: an operator request, a turn with
|
||||
/// thinking and several tool calls (a command with output, reads, a search,
|
||||
/// a failed edit and its retry) and a closing answer with a list and code.
|
||||
List<JsonMap> chatCliMessages(String chat) {
|
||||
var minute = 0;
|
||||
int at() => DateTime.utc(2026, 12, 3, 8, minute += 3).millisecondsSinceEpoch;
|
||||
JsonMap tool(
|
||||
String id,
|
||||
String name,
|
||||
JsonMap input, {
|
||||
String output = '',
|
||||
String? error,
|
||||
int millis = 400,
|
||||
}) => {
|
||||
'type': 'tool',
|
||||
'id': '$chat-cli-$id',
|
||||
'name': name,
|
||||
'state': {
|
||||
'status': error == null ? 'completed' : 'error',
|
||||
'input': input,
|
||||
if (output.isNotEmpty)
|
||||
'content': [
|
||||
{'type': 'text', 'text': output},
|
||||
],
|
||||
if (error != null) 'error': {'message': error},
|
||||
},
|
||||
'time': {'created': 1764750000000, 'completed': 1764750000000 + millis},
|
||||
};
|
||||
return [
|
||||
{
|
||||
'id': '$chat-cli-q',
|
||||
'role': 'user',
|
||||
'created_at': at(),
|
||||
'parts': [
|
||||
{
|
||||
'type': 'text',
|
||||
'text':
|
||||
'The release notes job fails on Windows paths. Find the cause '
|
||||
'and fix it.',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
'id': '$chat-cli-a',
|
||||
'role': 'assistant',
|
||||
'created_at': at(),
|
||||
'model': 'claude-opus',
|
||||
'parts': [
|
||||
{
|
||||
'type': 'reasoning',
|
||||
'text': 'Start from the failing job, then read the path helper.',
|
||||
},
|
||||
tool(
|
||||
'bash',
|
||||
'Bash',
|
||||
{'command': 'go test ./internal/notes/...'},
|
||||
output:
|
||||
'--- FAIL: TestNotesPath (0.01s)\n'
|
||||
' notes_test.go:41: got "C:/repo\\\\notes.md"\n'
|
||||
'FAIL',
|
||||
millis: 2300,
|
||||
),
|
||||
tool('read', 'Read', {
|
||||
'file_path': 'internal/notes/path.go',
|
||||
}, output: 'package notes\n\nimport "path"\n…'),
|
||||
tool(
|
||||
'grep',
|
||||
'Grep',
|
||||
{'pattern': 'path.Join'},
|
||||
output: 'internal/notes/path.go:18\ninternal/notes/render.go:52',
|
||||
),
|
||||
tool('edit1', 'Edit', {
|
||||
'file_path': 'internal/notes/path.go',
|
||||
}, error: 'old_string not found in file'),
|
||||
tool('edit2', 'Edit', {
|
||||
'file_path': 'internal/notes/path.go',
|
||||
}, output: 'Updated internal/notes/path.go (2 lines)'),
|
||||
tool(
|
||||
'bash2',
|
||||
'Bash',
|
||||
{'command': 'go test ./internal/notes/...'},
|
||||
output: 'ok \tpipelines/internal/notes\t0.214s',
|
||||
millis: 1900,
|
||||
),
|
||||
{
|
||||
'type': 'text',
|
||||
'text':
|
||||
'Fixed. The notes job joined paths with `path.Join`, which '
|
||||
'always uses forward slashes, so a Windows checkout produced '
|
||||
'mixed separators.\n\n'
|
||||
'- `internal/notes/path.go` now uses `filepath.Join`\n'
|
||||
'- `TestNotesPath` passes on both separators\n\n'
|
||||
'```go\nreturn filepath.Join(root, name+".md")\n```',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -20,11 +20,14 @@
|
||||
// `?tables=1` answers carry a wrapping table, one with a long token and
|
||||
// one too wide for a phone (it scrolls sideways);
|
||||
// `?timestamps=1` messages carry recorded times over two calendar days.
|
||||
// `?cli=1` appends a CLI-agent-shaped exchange with several tool calls
|
||||
// (chat_cli_fixture.dart);
|
||||
// `?followups=1` appends agent follow-ups, auto-continue/switch prompts and
|
||||
// a scheduled operator message (chat_followup_fixture.dart).
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'chat_cli_fixture.dart';
|
||||
import 'chat_followup_fixture.dart';
|
||||
|
||||
Map<String, String> _params = const {};
|
||||
@@ -279,6 +282,7 @@ JsonMap chatScrollHistory(String sessionId, int index, String cursor) {
|
||||
_timed(messages[i], i, messages.length),
|
||||
if (_bgwork) ..._backgroundWork(sessionId),
|
||||
if (_params['followups'] == '1') ...chatFollowupMessages(sessionId),
|
||||
if (_params['cli'] == '1') ...chatCliMessages(sessionId),
|
||||
],
|
||||
'next_cursor': _older ? 'older' : '',
|
||||
'has_more': _older,
|
||||
|
||||
@@ -37,6 +37,8 @@ import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
||||
import 'package:pipelines_app/features/search/ui/search_bar_controls.dart'
|
||||
show searchFieldKey;
|
||||
import 'package:pipelines_app/ui/input/app_search_field.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_design.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_design_controller.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_font.dart';
|
||||
import 'package:pipelines_app/ui/theme/app_font_controller.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -972,6 +974,7 @@ class _FixtureSink implements WebSocketSink {
|
||||
/// kind of popup and a pushed page (tool/capture/window_probe.dart);
|
||||
/// `?speech=fake` reads replies aloud with a scripted engine, one word per
|
||||
/// `?speechStep=` ms (tool/probe_speech_fixture.dart);
|
||||
/// `?design=terminal` chooses that app design (Settings → Design);
|
||||
/// `?theme=dark` / `?theme=light` pins the platform brightness the app's
|
||||
/// `ThemeMode.system` follows (omitted: the browser's color scheme).
|
||||
///
|
||||
@@ -1006,6 +1009,14 @@ Future<void> main() async {
|
||||
? AppFontController.instance.restore()
|
||||
: AppFontController.instance.select(AppFont.fromId(font)),
|
||||
);
|
||||
// `?design=terminal` chooses a design as Settings would; otherwise the
|
||||
// stored one.
|
||||
final design = params['design'];
|
||||
unawaited(
|
||||
design == null
|
||||
? AppDesignController.instance.restore()
|
||||
: AppDesignController.instance.select(AppDesign.fromId(design)),
|
||||
);
|
||||
_fillerRunCount = int.tryParse(params['runs'] ?? '') ?? 0;
|
||||
_fillerStepCount = int.tryParse(params['steps'] ?? '') ?? 0;
|
||||
if (params['running'] == '1') {
|
||||
|
||||
Reference in New Issue
Block a user