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
5 changes: 4 additions & 1 deletion lib/features/main_screen/workspace_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import 'package:flutter/material.dart' as material
MainAxisSize,
SizedBox,
Widget,
Column;
Column,
Offset;
import 'package:querya_desktop/core/extensions/extension_driver_catalog.dart';
import 'package:querya_desktop/core/motion/querya_fade_slide.dart';
import 'package:querya_desktop/core/motion/querya_switching_body.dart';
Expand Down Expand Up @@ -372,10 +373,12 @@ class _WorkspacePanelState extends State<WorkspacePanel> {
required material.Widget? object,
}) {
return QueryaSwitchingBody(
slide: material.Offset.zero,
index: showingObject ? 1 : 0,
children: [
home,
QueryaFadeSlide(
offset: const material.Offset(0, 0.015),
child: object ??
const material.SizedBox.expand(
key: ValueKey('workspace_object_placeholder'),
Expand Down
25 changes: 25 additions & 0 deletions test/features/main_screen/workspace_panel_layout_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,30 @@ void main() {
expect(find.byType(RedisView), findsOneWidget);
expect(find.byType(QueryaSwitchingBody), findsNWidgets(2));
});

testWidgets(
'home↔object morph uses slide: Offset.zero to prevent dual-axis wobble',
(tester) async {
await pumpWidgetWithSurfaceSize(
tester,
const material.Size(800, 600),
queryaThemeTestShell(
child: const material.SizedBox.expand(
child: WorkspacePanel(activeConnection: redisConnection),
),
),
);
await tester.pump();
await tester.pump(const Duration(milliseconds: 50));

final switchingBodies = tester
.widgetList<QueryaSwitchingBody>(find.byType(QueryaSwitchingBody))
.toList();
final homeObjectSwitchingBody = switchingBodies.firstWhere(
(sb) => sb.slide == material.Offset.zero,
orElse: () => throw StateError('No switching body with Offset.zero'),
);
expect(homeObjectSwitchingBody.slide, material.Offset.zero);
});
});
}
Loading