Lay out each chat once per center stage move and record the feature

This commit is contained in:
2026-11-10 13:26:15 +00:00
parent 4b6519610d
commit 61e5f19abd
3 changed files with 94 additions and 6 deletions
@@ -6,6 +6,7 @@ import 'package:pipelines_app/features/chat/workspace/chat_center_stage_controll
import 'package:pipelines_app/features/chat/workspace/chat_center_stage_keys.dart';
import 'package:pipelines_app/features/chat/workspace/chat_center_stage_layout.dart';
import 'package:pipelines_app/features/chat/workspace/chat_center_stage_strip.dart';
import 'package:pipelines_app/features/chat/workspace/chat_motion_viewport.dart';
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
import 'package:pipelines_app/features/chat/workspace/chat_workspace_geometry.dart';
@@ -166,8 +167,18 @@ void main() {
stage.value = true;
await tester.pump();
await tester.pump(const Duration(milliseconds: 40));
// Mid-flight the stage is on its way, neither split nor staged.
expect(widthOf(tester, 'three'), inExclusiveRange(before['three']!, 950));
// Mid-flight the stage's painted rectangle is on its way, while its chat
// is laid out once, at its destination width.
final painted = tester
.getSize(
find.ancestor(
of: find.byKey(const ValueKey('input-three')),
matching: find.byType(ChatMotionViewport),
),
)
.width;
expect(painted, inExclusiveRange(before['three']!, 950));
expect(widthOf(tester, 'three'), 950);
await tester.pumpAndSettle();
expect(widthOf(tester, 'three'), 950);
expect(find.byType(ChatCenterStageStrip), findsNWidgets(2));