Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/flow_ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Adds FlowComposer.sendTooltip and stopTooltip, host-localized names for the send and stop buttons. Both now read as buttons with their enabled state, so a disabled send button no longer drops out of the accessibility tree.
- Fixes Enter sending the draft while an input method is still composing: Enter now confirms the composition, as in any text field.
- Enter no longer adds a newline while a reply streams, or when held down after a send; Shift+Enter still inserts one.
- Keeps the composer's focus when FlowChatView leaves its wide zero state. The view rebuilt the composer as it moved from the centre to the bottom edge, so the field lost focus on the first send; it now moves the same composer, state and all.

## 0.3.0

Expand Down
5 changes: 3 additions & 2 deletions packages/flow_ui/lib/src/widgets/flow_chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ class _FlowChatViewState extends State<FlowChatView> {
static const double _suggestionsGapCompact = 16;
static const double _suggestionsExtraInset = 8;

final GlobalKey _composerKey = GlobalKey();
bool _showJump = false;
Timer? _jumpDebounce;

Expand Down Expand Up @@ -634,7 +635,7 @@ class _FlowChatViewState extends State<FlowChatView> {
if (widget.aboveComposer != null) widget.aboveComposer!,
if (widget.composer != null) ...[
if (widget.aboveComposer != null) const SizedBox(height: _composerGap),
widget.composer!,
KeyedSubtree(key: _composerKey, child: widget.composer!),
],
];

Expand Down Expand Up @@ -722,7 +723,7 @@ class _FlowChatViewState extends State<FlowChatView> {
} else if (column.isNotEmpty) {
column.add(const SizedBox(height: _suggestionsGapCompact));
}
column.add(widget.composer!);
column.add(KeyedSubtree(key: _composerKey, child: widget.composer!));
}

return [
Expand Down
Loading