Chat colours: the tint and bar span the divider; a stronger top wash; capture fixture

?colors=1 (with ?chats=N) names, stars and colours the fixture chats and
keeps colours picked with chat_color, for capture review.
This commit is contained in:
2026-11-03 11:12:31 +00:00
parent f7b5958d64
commit 56e78ef940
4 changed files with 98 additions and 39 deletions
@@ -18,10 +18,10 @@ class ChatColorWash extends StatelessWidget {
Widget build(BuildContext context) {
final color = chatColorShade(context, chatSessionColor(session));
if (color == null) return const SizedBox.shrink();
final strength = chatColorDarkSurface(context) ? 0.20 : 0.14;
final strength = chatColorDarkSurface(context) ? 0.24 : 0.2;
// The bar's height arrives as top padding; the wash reaches a little
// past it so the fade reads under the bar, not as an edge at it.
final height = MediaQuery.paddingOf(context).top + 72;
final height = MediaQuery.paddingOf(context).top + 96;
return Positioned(
top: 0,
left: 0,
+39 -30
View File
@@ -157,7 +157,7 @@ class AppListRow extends StatelessWidget {
final tint = accent?.withValues(
alpha: _darkSurface(context, cupertino) ? 0.12 : 0.07,
);
Widget surface = cupertino
final surface = cupertino
? _CupertinoRowSurface(
tapKey: tapKey,
onTap: onTap,
@@ -178,40 +178,49 @@ class AppListRow extends StatelessWidget {
child: content,
),
);
if (accent case final accent?) {
surface = DecoratedBox(
key: appListRowAccentKey,
position: DecorationPosition.foreground,
decoration: BoxDecoration(
border: BorderDirectional(
start: BorderSide(color: accent, width: 4),
),
),
child: surface,
);
}
if (!divider) return surface;
// The colour bar runs the row's whole height, divider included, and
// the tint fills the divider's inset too, so coloured rows read as
// one band each.
Widget marked(Widget row) => accent == null
? row
: DecoratedBox(
key: appListRowAccentKey,
position: DecorationPosition.foreground,
decoration: BoxDecoration(
border: BorderDirectional(
start: BorderSide(color: accent!, width: 4),
),
),
child: row,
);
if (!divider) return marked(surface);
// The divider stays under the text column; a checkbox's width is
// not known here, so a selectable row's divider starts at the inset.
final textStart = selectionControl != null
? start
: start + (showLeading ? kAppListAvatarSize + _avatarGap : 0);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
surface,
Padding(
padding: EdgeInsetsDirectional.only(start: textStart),
child: SizedBox(
key: appListRowDividerKey,
height: cupertino
? 1 / MediaQuery.devicePixelRatioOf(context)
: 1,
child: ColoredBox(color: styles.divider),
),
),
],
final line = Padding(
padding: EdgeInsetsDirectional.only(start: textStart),
child: SizedBox(
key: appListRowDividerKey,
height: cupertino
? 1 / MediaQuery.devicePixelRatioOf(context)
: 1,
child: ColoredBox(color: styles.divider),
),
);
return marked(
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
surface,
if (tint != null && !selected)
ColoredBox(color: tint, child: line)
else
line,
],
),
);
},
),
@@ -164,7 +164,7 @@ void main() {
);
final gradient =
(box.decoration as BoxDecoration).gradient! as LinearGradient;
expect(gradient.colors.first.a, lessThanOrEqualTo(0.2));
expect(gradient.colors.first.a, lessThanOrEqualTo(0.25));
expect(gradient.colors.last.a, 0);
// A plain chat has none.
+56 -6
View File
@@ -8,6 +8,8 @@
// `?graph=1` run 7 carries its pinned graph (plan -> build);
// `?quota=claude|opencode` (with `?chats=N`) pushes a usage frame with
// that harness's account quota after a chat subscribes.
// `?colors=1` (with `?chats=N`) names the chats, stars and colours some of
// them, and keeps colours picked with chat_color;
// `?msgs=`, `?rich=1`, `?older=1`, `?live=N` vary the chat transcripts for
// scroll captures (tool/perf/chat_scroll_fixture.dart).
import 'package:pipelines_app/core/api_gateway.dart';
@@ -25,6 +27,46 @@ void configurePerfFixture(Map<String, String> params) {
int get _hits => int.tryParse(_params['hits'] ?? '') ?? 0;
int get _chats => int.tryParse(_params['chats'] ?? '') ?? 0;
bool get perfRunGraph => _params['graph'] == '1';
bool get _colors => _params['colors'] == '1';
/// `?colors=1`: titles, directories, stars and colours per chat index.
const _colorTitles = [
'Release notes',
'api refactor',
'Billing bug',
'Docs pass',
'Flaky test',
'Onboarding',
'Perf sweep',
'Search UX',
];
const _colorStarred = {0, 1, 3};
const _colorNames = ['teal', 'purple', null, 'amber', 'red', null, 'blue'];
final Map<String, String?> _pickedColors = {};
JsonMap _chatRow(int i) {
final id = 'perf-chat-$i';
if (!_colors) {
return {
'id': id,
'title': 'Fixture chat ${i + 1}',
'directory': '/workspace/demo',
};
}
final color = _pickedColors.containsKey(id)
? _pickedColors[id]
: _colorNames[i % _colorNames.length];
return {
'id': id,
'title': _colorTitles[i % _colorTitles.length],
'directory': i.isEven ? '/workspace/demo' : '/workspace/site',
'model': 'claude-opus',
'backend': 'claude',
'updated_at': DateTime.now().millisecondsSinceEpoch - (i + 1) * 600000,
if (_colorStarred.contains(i)) 'starred': true,
'color': ?color,
};
}
/// Whether a chat scroll option (tool/perf/chat_scroll_fixture.dart) shapes
/// the transcripts instead of the bench's short markdown history.
@@ -137,14 +179,22 @@ JsonMap? perfChatReply(JsonMap request) {
'id': id,
'type': 'chat_sessions',
'chat_sessions': [
for (var i = 0; i < _chats; i++)
{
'id': 'perf-chat-$i',
'title': 'Fixture chat ${i + 1}',
'directory': '/workspace/demo',
},
for (var i = 0; i < _chats; i++) _chatRow(i),
],
};
case 'chat_color':
final query = request['chat_query'];
final session = query is Map ? '${query['session_id'] ?? ''}' : '';
final color = query is Map ? query['color'] as String? : null;
_pickedColors[session] = color;
final index = int.tryParse(session.replaceFirst('perf-chat-', '')) ?? 0;
final row = _chatRow(index);
return {
'id': id,
'type': 'chat_color',
'chat_session': row,
'chat_sessions': [row],
};
case 'chat_subscribe':
return {'id': id, 'type': 'chat_subscribed'};
case 'chat_shells':