Remove Cupertino chat transcript branches
Keep the existing Material transcript path while preserving public Cupertino parameters for callers. Narrow transcript tests to the Material-only behavior and remove Cupertino-only fixtures.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../sessions/chat_adaptive.dart';
|
||||
import 'chat_turn_chip.dart';
|
||||
|
||||
/// `Reasoning` / `Reasoning · N steps`.
|
||||
@@ -61,21 +59,13 @@ class _ChatReasoningChipState extends State<ChatReasoningChip> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino =
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
final color = cupertino
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
final color = Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
final label = chatReasoningLabel(widget.steps.length);
|
||||
return ChatTurnChip(
|
||||
chipKey: const Key('chat-reasoning-chip'),
|
||||
leading: widget.streaming
|
||||
? _spinner(cupertino)
|
||||
: Icon(
|
||||
cupertino ? CupertinoIcons.lightbulb : Icons.lightbulb_outline,
|
||||
size: 14,
|
||||
color: color,
|
||||
),
|
||||
? _spinner()
|
||||
: Icon(Icons.lightbulb_outline, size: 14, color: color),
|
||||
label: label,
|
||||
color: color,
|
||||
semanticsLabel: '$label, expand for details',
|
||||
@@ -90,12 +80,10 @@ class _ChatReasoningChipState extends State<ChatReasoningChip> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _spinner(bool cupertino) => cupertino
|
||||
? const CupertinoActivityIndicator(radius: 7)
|
||||
: const SizedBox.square(
|
||||
dimension: 12,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
);
|
||||
Widget _spinner() => const SizedBox.square(
|
||||
dimension: 12,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
);
|
||||
|
||||
/// The steps an open sheet listens to. The turn can leave the tree while its
|
||||
/// sheet is still open (its row scrolled away or replaced), so the notifier is
|
||||
@@ -132,16 +120,9 @@ class _ReasoningSheet extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino =
|
||||
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
|
||||
final style = cupertino
|
||||
? CupertinoTheme.of(context).textTheme.textStyle
|
||||
: Theme.of(context).textTheme.bodyMedium;
|
||||
final secondary = cupertino
|
||||
? CupertinoColors.secondaryLabel.resolveFrom(context)
|
||||
: Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
final secondary = Theme.of(context).colorScheme.onSurfaceVariant;
|
||||
return DefaultTextStyle.merge(
|
||||
style: style,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.sizeOf(context).height * 0.8,
|
||||
@@ -161,10 +142,7 @@ class _ReasoningSheet extends StatelessWidget {
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
if (streaming) ...[
|
||||
const SizedBox(width: 8),
|
||||
_spinner(cupertino),
|
||||
],
|
||||
if (streaming) ...[const SizedBox(width: 8), _spinner()],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user