App: dark-aware HTML views, run cards, changed/missing file notes, one card width, dense diff rows

show_html documents that declare dark support follow the app theme; others
stay light. Tool description and skill docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 19:54:58 +00:00
parent d204ce3187
commit f02ff56dfe
27 changed files with 1086 additions and 61 deletions
@@ -12,6 +12,8 @@ class ChatShownDiff {
required this.base,
required this.baseCommit,
required this.head,
this.headRevision = '',
this.paths = const [],
required this.committedOnly,
required this.files,
required this.additions,
@@ -29,6 +31,12 @@ class ChatShownDiff {
base: _text(body['base']),
baseCommit: _text(body['base_commit']),
head: _text(body['head']),
headRevision: _text(body['head_revision']),
paths: [
if (body['paths'] case final List paths)
for (final path in paths)
if (_text(path).isNotEmpty) _text(path),
],
committedOnly: body['committed_only'] == true,
files: _count(body['files']),
additions: _count(body['additions']),
@@ -43,6 +51,13 @@ class ChatShownDiff {
final String base;
final String baseCommit;
final String head;
/// The revision compared instead of the work tree (`show_diff` head), or
/// empty.
final String headRevision;
/// The paths or globs the comparison is limited to; empty for all.
final List<String> paths;
final bool committedOnly;
final int files;
final int additions;
@@ -57,14 +72,25 @@ class ChatShownDiff {
return parts.isEmpty ? repo : parts.last;
}
/// What was compared, in words: the branch against its base and whether
/// uncommitted work is included.
/// What was compared, in words: the branch (or the given revision) against
/// its base, whether uncommitted work is included, and the paths it is
/// limited to.
String get comparison {
final limited = paths.isEmpty
? ''
: ' · ${paths.length <= 3 ? paths.join(', ') : '${paths.take(3).join(', ')} +${paths.length - 3}'}';
return '${_compared()}$limited';
}
String _compared() {
final where = repoName.isEmpty ? '' : '$repoName · ';
if (headRevision.isNotEmpty) {
return '$where$headRevision vs ${base.isEmpty ? 'HEAD' : base}';
}
final head = this.head.isEmpty ? 'HEAD' : this.head;
final against = base.isEmpty
? (baseCommit.isEmpty ? 'no commits yet' : 'uncommitted changes')
: '$head vs $base${committedOnly ? ' · committed only' : ' · with uncommitted work'}';
final where = repoName.isEmpty ? '' : '$repoName · ';
return base.isEmpty ? '$where$head · $against' : '$where$against';
}