Chat perf: path-free running border, keystroke- and delta-quiet composer, spinners that do not relayout their list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import '../../../../ui/adaptive/segmented_bar_overflow.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../ui/status/app_spinner.dart';
|
||||
|
||||
class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
|
||||
const ChatBarAction({
|
||||
@@ -187,7 +188,7 @@ class ChatLoadingIndicator extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return const Center(child: AppSpinner());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../ui/status/app_spinner.dart';
|
||||
|
||||
import '../../data/chat_attachment_images.dart';
|
||||
import 'chat_attachment_frame.dart';
|
||||
@@ -92,7 +93,7 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
|
||||
Widget _pending(BuildContext context) => SizedBox.square(
|
||||
key: const Key('chat-attachment-thumbnail-loading'),
|
||||
dimension: 96,
|
||||
child: const Center(child: CircularProgressIndicator()),
|
||||
child: const Center(child: AppSpinner()),
|
||||
);
|
||||
|
||||
Widget _thumbnail(BuildContext context, Uint8List bytes) {
|
||||
|
||||
@@ -49,41 +49,48 @@ class _ChatResponsePendingState extends State<ChatResponsePending>
|
||||
label: 'Assistant is responding',
|
||||
liveRegion: true,
|
||||
excludeSemantics: true,
|
||||
// A fixed box (the three dots and their two gaps) with its own
|
||||
// builder: each tick rebuilds the dots and lays out only this box, not
|
||||
// the transcript row's builder and the list around it.
|
||||
child: SizedBox(
|
||||
key: const Key('chat-response-pending-dots'),
|
||||
height: fontSize,
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation,
|
||||
builder: (context, _) => Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (var index = 0; index < 3; index++)
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: index == 0 ? 0 : dot * 0.6,
|
||||
),
|
||||
child: Opacity(
|
||||
opacity: MediaQuery.disableAnimationsOf(context)
|
||||
? 1
|
||||
: 0.35 +
|
||||
0.65 *
|
||||
(0.5 +
|
||||
0.5 *
|
||||
math.sin(
|
||||
2 *
|
||||
math.pi *
|
||||
(_animation.value - index / 3),
|
||||
)),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
width: dot * 4.2,
|
||||
child: LayoutBuilder(
|
||||
builder: (context, _) => AnimatedBuilder(
|
||||
animation: _animation,
|
||||
builder: (context, _) => Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (var index = 0; index < 3; index++)
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: index == 0 ? 0 : dot * 0.6,
|
||||
),
|
||||
child: Opacity(
|
||||
opacity: MediaQuery.disableAnimationsOf(context)
|
||||
? 1
|
||||
: 0.35 +
|
||||
0.65 *
|
||||
(0.5 +
|
||||
0.5 *
|
||||
math.sin(
|
||||
2 *
|
||||
math.pi *
|
||||
(_animation.value -
|
||||
index / 3),
|
||||
)),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: SizedBox.square(dimension: dot),
|
||||
),
|
||||
child: SizedBox.square(dimension: dot),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user