diff --git a/app/lib/features/chat/conversation/chat_color_wash.dart b/app/lib/features/chat/conversation/chat_color_wash.dart index da01507a..6daf4553 100644 --- a/app/lib/features/chat/conversation/chat_color_wash.dart +++ b/app/lib/features/chat/conversation/chat_color_wash.dart @@ -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, diff --git a/app/lib/ui/layout/app_list_row.dart b/app/lib/ui/layout/app_list_row.dart index 1a39ab8d..1579d11d 100644 --- a/app/lib/ui/layout/app_list_row.dart +++ b/app/lib/ui/layout/app_list_row.dart @@ -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, + ], + ), ); }, ), diff --git a/app/test/features/chat/chat_list_shortcuts_test.dart b/app/test/features/chat/chat_list_shortcuts_test.dart index 1eb70ecd..1d11ff10 100644 --- a/app/test/features/chat/chat_list_shortcuts_test.dart +++ b/app/test/features/chat/chat_list_shortcuts_test.dart @@ -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. diff --git a/app/tool/perf/perf_fixture.dart b/app/tool/perf/perf_fixture.dart index 08da392c..c90964fa 100644 --- a/app/tool/perf/perf_fixture.dart +++ b/app/tool/perf/perf_fixture.dart @@ -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 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 _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':