Show harness identity beside chat titles and keep only the actionable star
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Harness marks
|
||||
|
||||
`claude.png` and `opencode.png` are transparent monochrome 96px renderings of
|
||||
the corresponding Simple Icons SVGs, retrieved 2026-10-26:
|
||||
|
||||
- https://github.com/simple-icons/simple-icons/blob/develop/icons/claude.svg
|
||||
- https://github.com/simple-icons/simple-icons/blob/develop/icons/opencode.svg
|
||||
|
||||
Simple Icons distributes its icons under CC0-1.0:
|
||||
https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md
|
||||
Brand trademarks remain with their owners. The application tints the bundled
|
||||
marks using the current native theme; no network image requests are made.
|
||||
Codex/Pi and unknown harnesses use native code/function/terminal symbols with
|
||||
an explicit accessible harness name instead of inventing branded artwork.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 576 B |
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../core/api_gateway.dart';
|
||||
import 'chat_adaptive.dart';
|
||||
import 'chat_create_fields.dart';
|
||||
|
||||
/// Harness identity, independent of favorite/activity state. Native icon sizing
|
||||
/// and foreground color keep bundled monochrome marks readable on both hosts.
|
||||
class SessionHarnessIcon extends StatelessWidget {
|
||||
const SessionHarnessIcon({super.key, required this.session, this.color});
|
||||
|
||||
final JsonMap session;
|
||||
final Color? color;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final value = '${session['backend'] ?? ''}'.trim();
|
||||
final backend = value.isEmpty ? 'opencode' : value;
|
||||
final cupertino =
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
final Widget mark = switch (backend) {
|
||||
'opencode' || 'claude' => ImageIcon(
|
||||
AssetImage('assets/harnesses/$backend.png'),
|
||||
color: color,
|
||||
),
|
||||
'codex' => Icon(
|
||||
cupertino
|
||||
? CupertinoIcons.chevron_left_slash_chevron_right
|
||||
: Icons.code,
|
||||
color: color,
|
||||
),
|
||||
'pi' => Icon(
|
||||
cupertino ? CupertinoIcons.function : Icons.functions,
|
||||
color: color,
|
||||
),
|
||||
_ => Icon(
|
||||
cupertino
|
||||
? CupertinoIcons.chevron_left_slash_chevron_right
|
||||
: Icons.terminal,
|
||||
color: color,
|
||||
),
|
||||
};
|
||||
return Semantics(
|
||||
label: '${chatBackendLabel(backend)} harness',
|
||||
image: true,
|
||||
child: ExcludeSemantics(child: mark),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import '../../domain/chat_sessions.dart';
|
||||
import 'chat_adaptive.dart';
|
||||
import 'chat_sessions_body.dart';
|
||||
import 'session_actions.dart';
|
||||
import 'session_harness_icon.dart';
|
||||
import 'session_row_content.dart';
|
||||
import 'session_row_style.dart';
|
||||
|
||||
@@ -169,8 +170,8 @@ class _CupertinoSessionRow extends StatelessWidget {
|
||||
// As on the web: the title with the unread/closed word trailing, then
|
||||
// the muted `recency · directory · model` line.
|
||||
title: ChatSessionRowContent(
|
||||
leading: Icon(
|
||||
sessionCupertinoIcon(session),
|
||||
leading: SessionHarnessIcon(
|
||||
session: session,
|
||||
color: selected ? theme.primaryColor : null,
|
||||
),
|
||||
actions: [
|
||||
|
||||
@@ -7,6 +7,7 @@ import '../../domain/chat_sessions.dart';
|
||||
import 'chat_adaptive.dart';
|
||||
import 'chat_sessions_body.dart';
|
||||
import 'session_actions.dart';
|
||||
import 'session_harness_icon.dart';
|
||||
import 'session_row_content.dart';
|
||||
import 'session_row_style.dart';
|
||||
|
||||
@@ -174,7 +175,7 @@ class _MaterialSessionRow extends StatelessWidget {
|
||||
// As on the web: the title with the unread/closed word trailing, then
|
||||
// the muted `recency · directory · model` line.
|
||||
title: ChatSessionRowContent(
|
||||
leading: Icon(sessionMaterialIcon(session)),
|
||||
leading: SessionHarnessIcon(session: session),
|
||||
actions: [
|
||||
SessionStarButton(
|
||||
key: Key('chat-star-$id'),
|
||||
|
||||
@@ -38,11 +38,19 @@ class ChatSessionRowContent extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: titleStyle,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (leading != null) ...[leading!, const SizedBox(width: 8)],
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: titleStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -70,16 +78,8 @@ class ChatSessionRowContent extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (status != null || leading != null)
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
?leading,
|
||||
if (status != null)
|
||||
_StatusLabel(status: status!, style: statusStyle),
|
||||
],
|
||||
),
|
||||
if (status != null)
|
||||
_StatusLabel(status: status!, style: statusStyle),
|
||||
for (final line in meta)
|
||||
Text(
|
||||
line,
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../core/api_gateway.dart';
|
||||
import '../../domain/chat_sessions.dart';
|
||||
|
||||
@@ -92,15 +89,3 @@ const _shortMonths = [
|
||||
'Nov',
|
||||
'Dec',
|
||||
];
|
||||
|
||||
IconData sessionMaterialIcon(JsonMap session) {
|
||||
if (session['running'] == true) return Icons.sync;
|
||||
if (session['starred'] == true) return Icons.star;
|
||||
return Icons.chat_bubble_outline;
|
||||
}
|
||||
|
||||
IconData sessionCupertinoIcon(JsonMap session) {
|
||||
if (session['running'] == true) return CupertinoIcons.arrow_2_circlepath;
|
||||
if (session['starred'] == true) return CupertinoIcons.star_fill;
|
||||
return CupertinoIcons.chat_bubble;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Harness identity beside chat titles
|
||||
|
||||
- Removed the decorative favorite/activity icon from both native row variants.
|
||||
Harness identity is now independent of favorite state and appears to the left
|
||||
of the title. The right-side native favorite action is the only star.
|
||||
- OpenCode and Claude use bundled monochrome marks with accessible harness names
|
||||
and theme tinting; provenance in `assets/harnesses/README.md`. Other harnesses
|
||||
use native code/function symbols, with an accessible name (no invented logos).
|
||||
- Compact right-side timestamp/actions and selected-row styling remain intact.
|
||||
- New tests cover both host variants with starred/running OpenCode and Claude
|
||||
sessions: correct asset, icon/title geometry, exactly one filled star, and
|
||||
favorite toggling without changing harness identity.
|
||||
- Full suite: **1,968 passed**; clean analysis. Browser acceptance on the actual
|
||||
installer bundle passed for Material 1280/light and Cupertino 840/dark.
|
||||
Starred OpenCode/Claude captures inspected in `build/harness-title-*`.
|
||||
|
||||
## Publication
|
||||
|
||||
- No executing pipeline runs at preparation. No backend change, service restart,
|
||||
real-chat mutation or phone installation. Installer paths used for web/APK.
|
||||
- Rollback: `~/.local/share/pipelines/backups/harness-title-icons-20261026-021548/`.
|
||||
Public web rollback: `build/web-before-harness-title-1792981147/`.
|
||||
- Website published. Authenticated full JS and both bundled image downloads
|
||||
verified on HTTPS 8443/8096. JS SHA256:
|
||||
`8c5f2b4b078e138467f3a3b59edca6f2d12aed0d133fdd4caabedeb9780b77a5`.
|
||||
- APK build underway; prior public feed remains 0.1.29882879 until verification
|
||||
and publication complete.
|
||||
@@ -71,6 +71,10 @@ flutter:
|
||||
# the material Icons class.
|
||||
uses-material-design: true
|
||||
|
||||
assets:
|
||||
- assets/harnesses/claude.png
|
||||
- assets/harnesses/opencode.png
|
||||
|
||||
fonts:
|
||||
- family: RobotoMono
|
||||
fonts:
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/session_harness_icon.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/session_list_cupertino.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/session_list_material.dart';
|
||||
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
for (final backend in ['opencode', 'claude']) {
|
||||
testWidgets(
|
||||
'$backend identity beside title, one actionable star ($cupertino)',
|
||||
(tester) async {
|
||||
var starred = true;
|
||||
final body = StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
final sections = [
|
||||
(
|
||||
title: 'Chats',
|
||||
sessions: [
|
||||
<String, dynamic>{
|
||||
'id': 's',
|
||||
'title': 'Harness chat',
|
||||
'backend': backend,
|
||||
'starred': starred,
|
||||
'running': true,
|
||||
},
|
||||
],
|
||||
),
|
||||
];
|
||||
void star(Map<String, dynamic> _) =>
|
||||
setState(() => starred = !starred);
|
||||
return cupertino
|
||||
? CupertinoSessionList(
|
||||
sections: sections,
|
||||
emptyMessage: null,
|
||||
duplicateTitles: const {},
|
||||
onOpen: (_) {},
|
||||
onRename: (_) {},
|
||||
onClose: (_) {},
|
||||
onReopen: (_) {},
|
||||
onStar: star,
|
||||
onHide: (_) {},
|
||||
onClearSearch: null,
|
||||
isUnseen: (_) => false,
|
||||
errorFor: (_) => null,
|
||||
)
|
||||
: MaterialSessionList(
|
||||
sections: sections,
|
||||
emptyMessage: null,
|
||||
duplicateTitles: const {},
|
||||
onOpen: (_) {},
|
||||
onRename: (_) {},
|
||||
onClose: (_) {},
|
||||
onReopen: (_) {},
|
||||
onStar: star,
|
||||
onHide: (_) {},
|
||||
onClearSearch: null,
|
||||
isUnseen: (_) => false,
|
||||
errorFor: (_) => null,
|
||||
);
|
||||
},
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
cupertino
|
||||
? CupertinoApp(home: CupertinoPageScaffold(child: body))
|
||||
: MaterialApp(home: Scaffold(body: body)),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final mark = find.byType(SessionHarnessIcon);
|
||||
expect(mark, findsOneWidget);
|
||||
expect(
|
||||
tester.widget<ImageIcon>(find.byType(ImageIcon)).image,
|
||||
AssetImage('assets/harnesses/$backend.png'),
|
||||
);
|
||||
final title = tester.getRect(find.text('Harness chat'));
|
||||
final icon = tester.getRect(mark);
|
||||
expect(icon.right, lessThanOrEqualTo(title.left));
|
||||
expect(icon.top, lessThan(title.bottom));
|
||||
expect(icon.bottom, greaterThan(title.top));
|
||||
expect(
|
||||
find.byIcon(cupertino ? CupertinoIcons.star_fill : Icons.star),
|
||||
findsOneWidget,
|
||||
);
|
||||
await tester.tap(find.byKey(const Key('chat-star-s')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(starred, isFalse);
|
||||
expect(
|
||||
find.byIcon(cupertino ? CupertinoIcons.star : Icons.star_border),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.byType(SessionHarnessIcon),
|
||||
findsOneWidget,
|
||||
reason: 'Changing favorite must not change harness identity',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ const output = resolve(process.argv[3] ?? `build/list-detail-${platform}`);
|
||||
await mkdir(output, { recursive: true });
|
||||
const root = resolve(process.argv[2]);
|
||||
const runs = await startFixture({ root, chatMessages: [], chatSessions: [
|
||||
{ id: 'ses_probechat', title: 'First fixture chat', backend: 'claude', model: 'claude-opus', directory:'/srv/probe', updated_at:Date.now()-180000, mode: 'auto', mode_name: 'Auto' },
|
||||
{ id: 'ses_secondchat', title: 'Second fixture chat', backend: 'claude', model: 'claude-opus', directory:'/srv/probe', updated_at:Date.now()-180000, mode: 'auto', mode_name: 'Auto' },
|
||||
{ id: 'ses_probechat', title: 'First fixture chat', backend: 'opencode', starred:true, model: 'claude-opus', directory:'/srv/probe', updated_at:Date.now()-180000, mode: 'auto', mode_name: 'Auto' },
|
||||
{ id: 'ses_secondchat', title: 'Second fixture chat', backend: 'claude', starred:true, model: 'claude-opus', directory:'/srv/probe', updated_at:Date.now()-180000, mode: 'auto', mode_name: 'Auto' },
|
||||
] });
|
||||
const pipelines = await startWiringFixture({ root });
|
||||
const profile = await mkdtemp(join(tmpdir(), 'list-detail-consistency-'));
|
||||
|
||||
Reference in New Issue
Block a user