Leave an unknown harness out of Send to chat rows
This commit is contained in:
@@ -162,10 +162,7 @@ class _SendToChatSheetState extends State<_SendToChatSheet> {
|
||||
ListTile(
|
||||
leading: const Icon(Icons.chat_bubble_outline),
|
||||
title: Text(chatSessionTitle(row)),
|
||||
subtitle: Text(
|
||||
'${'${row['directory'] ?? ''}'.trim().isEmpty ? 'No folder' : row['directory']}'
|
||||
' · ${chatBackendLabel('${row['backend'] ?? row['harness'] ?? ''}')}',
|
||||
),
|
||||
subtitle: Text(_chatSubtitle(row)),
|
||||
onTap: () => Navigator.of(
|
||||
context,
|
||||
).pop(_ChatChoice.existing('${row['id']}')),
|
||||
@@ -178,3 +175,14 @@ class _SendToChatSheetState extends State<_SendToChatSheet> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// The chat's folder and harness, leaving out whichever is unknown.
|
||||
String _chatSubtitle(Map<String, dynamic> row) {
|
||||
final folder = '${row['directory'] ?? ''}'.trim();
|
||||
final backend = '${row['backend'] ?? row['harness'] ?? ''}'.trim();
|
||||
final harness = backend.isEmpty ? '' : chatBackendLabel(backend).trim();
|
||||
return [
|
||||
folder.isEmpty ? 'No folder' : folder,
|
||||
if (harness.isNotEmpty) harness,
|
||||
].join(' · ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user