From 2511fcb9a6c79083b7eeb5f14408860f52957aca Mon Sep 17 00:00:00 2001 From: DatDang Date: Fri, 13 Sep 2024 09:03:48 +0700 Subject: [PATCH] Prevent Semantic node missing --- .../views/dialog/confirmation_dialog_builder.dart | 8 ++++++++ .../views/quick_search/quick_search_input_form.dart | 3 +++ lib/features/composer/presentation/composer_view_web.dart | 3 +++ .../composer/presentation/view/web/web_editor_view.dart | 6 ++++++ .../presentation/widgets/recipient_composer_widget.dart | 1 + .../presentation/widgets/subject_composer_widget.dart | 1 + .../web/mobile_responsive_app_bar_composer_widget.dart | 1 + lib/features/login/presentation/base_login_view.dart | 2 ++ lib/features/login/presentation/login_view_web.dart | 1 + .../presentation/mailbox_dashboard_view_web.dart | 1 + 10 files changed, 27 insertions(+) diff --git a/core/lib/presentation/views/dialog/confirmation_dialog_builder.dart b/core/lib/presentation/views/dialog/confirmation_dialog_builder.dart index d4d3de87bf..ea0f42bda5 100644 --- a/core/lib/presentation/views/dialog/confirmation_dialog_builder.dart +++ b/core/lib/presentation/views/dialog/confirmation_dialog_builder.dart @@ -187,6 +187,7 @@ class ConfirmDialogBuilder { alignment: AlignmentDirectional.centerEnd, child: Semantics( label: ConfirmationDialogKeyValues.closeButton, + container: true, child: TMailButtonWidget.fromIcon( icon: _imagePath.icCircleClose, iconSize: 30, @@ -209,6 +210,7 @@ class ConfirmDialogBuilder { child: Center( child: Semantics( identifier: ConfirmationDialogKeyValues.title, + container: true, child: Text( _title, textAlign: TextAlign.center, @@ -223,6 +225,7 @@ class ConfirmDialogBuilder { child: Center( child: Semantics( identifier: ConfirmationDialogKeyValues.content, + container: true, child: Text(_content, textAlign: TextAlign.center, style: _styleContent ?? const TextStyle(fontSize: 17.0, color: AppColor.colorMessageDialog) @@ -236,6 +239,7 @@ class ConfirmDialogBuilder { child: Center( child: Semantics( identifier: ConfirmationDialogKeyValues.content, + container: true, child: RichText( textAlign: TextAlign.center, text: TextSpan( @@ -253,6 +257,7 @@ class ConfirmDialogBuilder { padding: const EdgeInsetsDirectional.only(top: 8, start: 16, end: 16), child: Semantics( identifier: ConfirmationDialogKeyValues.cancelButton, + container: true, child: ConfirmDialogButton( label: _cancelText, backgroundColor: _colorCancelButton, @@ -268,6 +273,7 @@ class ConfirmDialogBuilder { padding: const EdgeInsetsDirectional.only(top: 8, start: 16, end: 16), child: Semantics( identifier: ConfirmationDialogKeyValues.confirmButton, + container: true, child: ConfirmDialogButton( label: _confirmText, backgroundColor: _colorConfirmButton, @@ -288,6 +294,7 @@ class ConfirmDialogBuilder { if (_cancelText.isNotEmpty) Expanded(child: Semantics( identifier: ConfirmationDialogKeyValues.cancelButton, + container: true, child: ConfirmDialogButton( label: _cancelText, backgroundColor: _colorCancelButton, @@ -301,6 +308,7 @@ class ConfirmDialogBuilder { if (_confirmText.isNotEmpty) Expanded(child: Semantics( identifier: ConfirmationDialogKeyValues.confirmButton, + container: true, child: ConfirmDialogButton( label: _confirmText, backgroundColor: _colorConfirmButton, diff --git a/core/lib/presentation/views/quick_search/quick_search_input_form.dart b/core/lib/presentation/views/quick_search/quick_search_input_form.dart index 43e99d932a..1eddebd00e 100644 --- a/core/lib/presentation/views/quick_search/quick_search_input_form.dart +++ b/core/lib/presentation/views/quick_search/quick_search_input_form.dart @@ -853,6 +853,7 @@ class _TypeAheadFieldQuickSearchState extends State extends State<_SuggestionsList> if (widget.itemBuilder != null) { return Semantics( identifier: SearchKeyValues.searchEmailResult, + container: true, child: InkWell( child: widget.itemBuilder!(context, suggestion), onTap: () => widget.onSuggestionSelected?.call(suggestion), @@ -1260,6 +1262,7 @@ class _SuggestionsListState extends State<_SuggestionsList> type: MaterialType.transparency, child: Semantics( identifier: SearchKeyValues.searchUserResult, + container: true, child: InkWell( child: widget.contactSuggestionBuilder!(context, contact), onTap: () => widget.onContactSuggestionSelected?.call(contact), diff --git a/lib/features/composer/presentation/composer_view_web.dart b/lib/features/composer/presentation/composer_view_web.dart index d1df5c2194..4e0a258503 100644 --- a/lib/features/composer/presentation/composer_view_web.dart +++ b/lib/features/composer/presentation/composer_view_web.dart @@ -43,6 +43,7 @@ class ComposerView extends GetWidget { excludeFromSemantics: true, child: Semantics( identifier: ComposerKeyValues.composerView, + container: true, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -289,6 +290,7 @@ class ComposerView extends GetWidget { excludeFromSemantics: true, child: Semantics( identifier: ComposerKeyValues.composerView, + container: true, child: Column(children: [ Obx(() => DesktopAppBarComposerWidget( emailSubject: controller.subjectEmail.value ?? '', @@ -555,6 +557,7 @@ class ComposerView extends GetWidget { excludeFromSemantics: true, child: Semantics( identifier: ComposerKeyValues.composerView, + container: true, child: Column(children: [ Obx(() => DesktopAppBarComposerWidget( emailSubject: controller.subjectEmail.value ?? '', diff --git a/lib/features/composer/presentation/view/web/web_editor_view.dart b/lib/features/composer/presentation/view/web/web_editor_view.dart index 933e4be7c6..741568e430 100644 --- a/lib/features/composer/presentation/view/web/web_editor_view.dart +++ b/lib/features/composer/presentation/view/web/web_editor_view.dart @@ -65,6 +65,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { case EmailActionType.composeFromFileShared: return Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? HtmlExtension.editorStartTags, @@ -93,6 +94,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { return contentViewState!.fold( (failure) => Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? HtmlExtension.editorStartTags, @@ -121,6 +123,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { } return Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? newContent, @@ -156,6 +159,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { ); return Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? emailContentQuoted, @@ -187,6 +191,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { ); return Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? emailContentQuoted, @@ -209,6 +214,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin { default: return Semantics( identifier: ComposerKeyValues.composerContentField, + container: true, child: WebEditorWidget( editorController: editorController, content: currentWebContent ?? HtmlExtension.editorStartTags, diff --git a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart index 88772089ae..d0ff97c74c 100644 --- a/lib/features/composer/presentation/widgets/recipient_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/recipient_composer_widget.dart @@ -127,6 +127,7 @@ class _RecipientComposerWidgetState extends State { identifier: widget.prefix == PrefixEmailAddress.to ? ComposerKeyValues.composerToField : null, + container: true, child: Container( decoration: const BoxDecoration( border: Border( diff --git a/lib/features/composer/presentation/widgets/subject_composer_widget.dart b/lib/features/composer/presentation/widgets/subject_composer_widget.dart index 9fa3420213..2c10a51aa3 100644 --- a/lib/features/composer/presentation/widgets/subject_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/subject_composer_widget.dart @@ -26,6 +26,7 @@ class SubjectComposerWidget extends StatelessWidget { Widget build(BuildContext context) { return Semantics( identifier: ComposerKeyValues.composerSubjectField, + container: true, child: Container( decoration: const BoxDecoration( border: Border( diff --git a/lib/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart b/lib/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart index f627e82565..c397859c1f 100644 --- a/lib/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/web/mobile_responsive_app_bar_composer_widget.dart @@ -87,6 +87,7 @@ class MobileResponsiveAppBarComposerWidget extends StatelessWidget { const SizedBox(width: MobileAppBarComposerWidgetStyle.space), Semantics( identifier: ComposerKeyValues.composerSendButton, + container: true, child: TMailButtonWidget.fromIcon( icon: isSendButtonEnabled ? _imagePaths.icSendMobile diff --git a/lib/features/login/presentation/base_login_view.dart b/lib/features/login/presentation/base_login_view.dart index c56e172c09..d0f89166e2 100644 --- a/lib/features/login/presentation/base_login_view.dart +++ b/lib/features/login/presentation/base_login_view.dart @@ -45,11 +45,13 @@ abstract class BaseLoginView extends GetWidget { children: [ Semantics( identifier: LoginBasicAuthKeyValues.loginEmailField, + container: true, child: buildUserNameInput(context), ), const SizedBox(height: 24), Semantics( identifier: LoginBasicAuthKeyValues.loginPasswordField, + container: true, child: buildPasswordInput(context), ), const SizedBox(height: 40), diff --git a/lib/features/login/presentation/login_view_web.dart b/lib/features/login/presentation/login_view_web.dart index f5e9b691ec..c72af97b75 100644 --- a/lib/features/login/presentation/login_view_web.dart +++ b/lib/features/login/presentation/login_view_web.dart @@ -24,6 +24,7 @@ class LoginView extends BaseLoginView { body: Center(child: SingleChildScrollView( child: Semantics( identifier: LoginBasicAuthKeyValues.loginView, + container: true, child: ResponsiveWidget( responsiveUtils: controller.responsiveUtils, mobile: _buildMobileForm(context), diff --git a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart index 971a0f435a..d7807a22be 100644 --- a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart +++ b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart @@ -660,6 +660,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView { alignment: Alignment.centerLeft, child: Semantics( identifier: ComposerKeyValues.openComposerButton, + container: true, child: TMailButtonWidget( key: const Key('compose_email_button'), text: AppLocalizations.of(context).compose,