Chat composer pops in with the bar when a chat opens

This commit is contained in:
2026-11-04 21:58:11 +00:00
parent fa6c0864db
commit b71345fe4e
4 changed files with 265 additions and 42 deletions
@@ -23,6 +23,7 @@ import 'chat_composer_controller.dart';
import '../ui/transcript/chat_attachment_frame.dart';
import '../../../ui/adaptive/glass_bar.dart';
import '../../../ui/adaptive/glass_pill.dart';
import '../../../ui/adaptive/pop_entrance.dart';
import 'chat_reading_width.dart';
import 'composer_focus_request.dart';
import 'composer_focus_restore.dart';
@@ -730,51 +731,60 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
onSelected: _completeCommand,
),
),
_pill(
context,
cupertino,
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (extras.isNotEmpty)
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
12,
8,
12,
0,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: extras,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
_attach(context, cupertino),
Expanded(
child: Focus(
canRequestFocus: false,
includeSemantics: false,
onKeyEvent: _onKey,
child: _field(cupertino),
// The pill pops in with the app's shared entrance, as
// the bar's pieces do, once per chat: this state is keyed
// by the chat, and a rebuild (typing, the keyboard, a
// sheet closing) never replays it. It only paints, so the
// field takes focus and keys at once while it plays.
PopEntrance(
key: const ValueKey('chat-composer-entrance'),
child: _pill(
context,
cupertino,
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (extras.isNotEmpty)
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
12,
8,
12,
0,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: extras,
),
),
// Shown only while tasks run (or their list
// cannot be read); a quiet control, not a
// caption.
?widget.backgroundTasks,
if (widget.running) ...[
_primary(context, cupertino, stop: true),
const SizedBox(width: 4),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
_attach(context, cupertino),
Expanded(
child: Focus(
canRequestFocus: false,
includeSemantics: false,
onKeyEvent: _onKey,
child: _field(cupertino),
),
),
// Shown only while tasks run (or their list
// cannot be read); a quiet control, not a
// caption.
?widget.backgroundTasks,
if (widget.running) ...[
_primary(context, cupertino, stop: true),
const SizedBox(width: 4),
],
_primary(context, cupertino),
],
_primary(context, cupertino),
],
),
],
),
],
),
),
),
],