fix(chat): keep provided reasoning visible during live replies
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../sessions/chat_adaptive.dart';
|
||||
|
||||
/// A collapsed block opened with the host's own disclosure control.
|
||||
/// A block opened with the host's own disclosure control (collapsed by default).
|
||||
///
|
||||
/// [childBuilder] runs only while the block is open, so a closed disclosure
|
||||
/// never encodes or lays out its body.
|
||||
@@ -12,17 +12,19 @@ class NativeDisclosure extends StatefulWidget {
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.childBuilder,
|
||||
this.initiallyExpanded = false,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final WidgetBuilder childBuilder;
|
||||
final bool initiallyExpanded;
|
||||
|
||||
@override
|
||||
State<NativeDisclosure> createState() => _NativeDisclosureState();
|
||||
}
|
||||
|
||||
class _NativeDisclosureState extends State<NativeDisclosure> {
|
||||
bool _expanded = false;
|
||||
late bool _expanded = widget.initiallyExpanded;
|
||||
|
||||
void _toggle() => setState(() => _expanded = !_expanded);
|
||||
|
||||
@@ -31,6 +33,7 @@ class _NativeDisclosureState extends State<NativeDisclosure> {
|
||||
if (chatControlsStyleOf(context) != ChatControlsStyle.cupertino) {
|
||||
return ExpansionTile(
|
||||
title: Text(widget.label),
|
||||
initiallyExpanded: widget.initiallyExpanded,
|
||||
maintainState: false,
|
||||
// A transcript block starts at the row edge, like its answer text; the
|
||||
// tile's own padding would indent it, and its body defaults to centred,
|
||||
|
||||
Reference in New Issue
Block a user