From 7dcc7c221fdecfc97cfd0f2a9e19b42bbedd29ec Mon Sep 17 00:00:00 2001 From: Yatendra Kumar Date: Mon, 17 Jul 2023 15:09:44 +0530 Subject: [PATCH] fix: row banner overlay (#3009) --- .../database_row_page_test.dart | 43 +++++++++++++++++++ .../database_view/widgets/row/row_banner.dart | 29 ++++++------- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/frontend/appflowy_flutter/integration_test/database_row_page_test.dart b/frontend/appflowy_flutter/integration_test/database_row_page_test.dart index 42f291586e..802603a683 100644 --- a/frontend/appflowy_flutter/integration_test/database_row_page_test.dart +++ b/frontend/appflowy_flutter/integration_test/database_row_page_test.dart @@ -2,6 +2,7 @@ import 'package:appflowy/plugins/database_view/widgets/row/row_banner.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart'; import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flowy_infra_ui/style_widget/text.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; @@ -194,6 +195,48 @@ void main() { ); }); + testWidgets( + 'check if the title wraps properly when a long text is inserted', + (tester) async { + await tester.initializeAppFlowy(); + await tester.tapGoButton(); + + // Create a new grid + await tester.tapAddButton(); + await tester.tapCreateGridButton(); + + // Hover first row and then open the row page + await tester.openFirstRowDetailPage(); + + // Wait for the document to be loaded + await tester.wait(500); + + // Focus on the editor + final textField = find + .descendant( + of: find.byType(SimpleDialog), + matching: find.byType(TextField), + ) + .first; + + // Input a long text + await tester.enterText(textField, 'Long text' * 25); + await tester.pumpAndSettle(); + + // Tap outside to dismiss the field + await tester.tapAt(Offset.zero); + await tester.pumpAndSettle(); + + // Check if there is any overflow in the widget tree + expect(tester.takeException(), isNull); + + // Re-open the document + await tester.openFirstRowDetailPage(); + + // Check again if there is any overflow in the widget tree + expect(tester.takeException(), isNull); + }); + testWidgets('delete row in row detail page', (tester) async { await tester.initializeAppFlowy(); await tester.tapGoButton(); diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_banner.dart b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_banner.dart index a52cf1d045..ff922e83c4 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_banner.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/widgets/row/row_banner.dart @@ -40,24 +40,21 @@ class _RowBannerState extends State { child: MouseRegion( onEnter: (event) => _isHovering.value = true, onExit: (event) => _isHovering.value = false, - child: SizedBox( - height: 80, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - child: _BannerAction( - isHovering: _isHovering, - popoverController: popoverController, - ), - ), - _BannerTitle( - cellBuilder: widget.cellBuilder, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + child: _BannerAction( + isHovering: _isHovering, popoverController: popoverController, ), - ], - ), + ), + _BannerTitle( + cellBuilder: widget.cellBuilder, + popoverController: popoverController, + ), + ], ), ), );