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:
2026-12-03 16:43:59 +00:00
parent 9a6363b80e
commit ca2f7eee32
45 changed files with 1961 additions and 95 deletions
+101
View File
@@ -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```',
},
],
},
];
}
+4
View File
@@ -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,