Files
pipelines/app/lib/features/chat/ui/sessions/session_harness_icon.dart
T
alan ae208699d8 Remove Cupertino chat session branches
Keep the Material-only session UI and narrow its tests to the supported host. Preserve public Cupertino parameters for callers while removing unreachable Cupertino widgets and variants.
2026-11-11 14:18:04 +00:00

34 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../../../../core/api_gateway.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 Widget mark = switch (backend) {
'opencode' || 'claude' => ImageIcon(
AssetImage('assets/harnesses/$backend.png'),
color: color,
),
'codex' => Icon(Icons.code, color: color),
'pi' => Icon(Icons.functions, color: color),
_ => Icon(Icons.terminal, color: color),
};
return Semantics(
label: '${chatBackendLabel(backend)} harness',
image: true,
child: ExcludeSemantics(child: mark),
);
}
}