feat(app): chat reasoning is a chip beside the tool chip, opening its own sheet

This commit is contained in:
2026-10-23 16:22:31 +01:00
parent 7539a7a552
commit f2aa559d0e
5 changed files with 202 additions and 174 deletions
@@ -188,8 +188,8 @@ class ChatMessageView extends StatelessWidget {
return widgets;
}
/// The agent turn as the web lays it out: its reasoning as a quiet line
/// above the answer, the answer in the bubble, and one tool chip below.
/// The agent turn: the answer in the bubble, then one row with its reasoning
/// and tool-call chips, each opening its own sheet.
Widget _agentTurn(BuildContext context, List<Widget> content, Widget bubble) {
final parts = _partsOf(row);
final reasoning = [
@@ -206,16 +206,16 @@ class ChatMessageView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (reasoning.isNotEmpty)
NativeDisclosure(
key: const Key('chat-reasoning'),
label: reasoning.length == 1
? 'Reasoning'
: 'Reasoning · ${reasoning.length} steps',
childBuilder: (context) => SelectableText(reasoning.join('\n\n')),
),
if (content.isNotEmpty) bubble,
if (tools.isNotEmpty) ChatToolCallsChip(calls: tools),
// Reasoning and tool calls share one quiet row below the answer.
if (reasoning.isNotEmpty || tools.isNotEmpty)
Wrap(
spacing: 8,
children: [
if (reasoning.isNotEmpty) ChatReasoningChip(steps: reasoning),
if (tools.isNotEmpty) ChatToolCallsChip(calls: tools),
],
),
],
);
}