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```',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user