Skip to content

Commit

Permalink
Prevent Semantic node missing
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Sep 13, 2024
1 parent e74e201 commit 2511fcb
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class ConfirmDialogBuilder {
alignment: AlignmentDirectional.centerEnd,
child: Semantics(
label: ConfirmationDialogKeyValues.closeButton,
container: true,
child: TMailButtonWidget.fromIcon(
icon: _imagePath.icCircleClose,
iconSize: 30,
Expand All @@ -209,6 +210,7 @@ class ConfirmDialogBuilder {
child: Center(
child: Semantics(
identifier: ConfirmationDialogKeyValues.title,
container: true,
child: Text(
_title,
textAlign: TextAlign.center,
Expand All @@ -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)
Expand All @@ -236,6 +239,7 @@ class ConfirmDialogBuilder {
child: Center(
child: Semantics(
identifier: ConfirmationDialogKeyValues.content,
container: true,
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -288,6 +294,7 @@ class ConfirmDialogBuilder {
if (_cancelText.isNotEmpty)
Expanded(child: Semantics(
identifier: ConfirmationDialogKeyValues.cancelButton,
container: true,
child: ConfirmDialogButton(
label: _cancelText,
backgroundColor: _colorCancelButton,
Expand All @@ -301,6 +308,7 @@ class ConfirmDialogBuilder {
if (_confirmText.isNotEmpty)
Expanded(child: Semantics(
identifier: ConfirmationDialogKeyValues.confirmButton,
container: true,
child: ConfirmDialogButton(
label: _confirmText,
backgroundColor: _colorConfirmButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ class _TypeAheadFieldQuickSearchState<T, P, R> extends State<TypeAheadFieldQuick
Expanded(
child: Semantics(
identifier: SearchKeyValues.searchInputField,
container: true,
child: TextField(
focusNode: _effectiveFocusNode,
controller: _effectiveController,
Expand Down Expand Up @@ -1208,6 +1209,7 @@ class _SuggestionsListState<T, P, R> extends State<_SuggestionsList<T, P, R>>
if (widget.itemBuilder != null) {
return Semantics(
identifier: SearchKeyValues.searchEmailResult,
container: true,
child: InkWell(
child: widget.itemBuilder!(context, suggestion),
onTap: () => widget.onSuggestionSelected?.call(suggestion),
Expand Down Expand Up @@ -1260,6 +1262,7 @@ class _SuggestionsListState<T, P, R> extends State<_SuggestionsList<T, P, R>>
type: MaterialType.transparency,
child: Semantics(
identifier: SearchKeyValues.searchUserResult,
container: true,
child: InkWell(
child: widget.contactSuggestionBuilder!(context, contact),
onTap: () => widget.onContactSuggestionSelected?.call(contact),
Expand Down
3 changes: 3 additions & 0 deletions lib/features/composer/presentation/composer_view_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ComposerView extends GetWidget<ComposerController> {
excludeFromSemantics: true,
child: Semantics(
identifier: ComposerKeyValues.composerView,
container: true,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -289,6 +290,7 @@ class ComposerView extends GetWidget<ComposerController> {
excludeFromSemantics: true,
child: Semantics(
identifier: ComposerKeyValues.composerView,
container: true,
child: Column(children: [
Obx(() => DesktopAppBarComposerWidget(
emailSubject: controller.subjectEmail.value ?? '',
Expand Down Expand Up @@ -555,6 +557,7 @@ class ComposerView extends GetWidget<ComposerController> {
excludeFromSemantics: true,
child: Semantics(
identifier: ComposerKeyValues.composerView,
container: true,
child: Column(children: [
Obx(() => DesktopAppBarComposerWidget(
emailSubject: controller.subjectEmail.value ?? '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -121,6 +123,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
}
return Semantics(
identifier: ComposerKeyValues.composerContentField,
container: true,
child: WebEditorWidget(
editorController: editorController,
content: currentWebContent ?? newContent,
Expand Down Expand Up @@ -156,6 +159,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
);
return Semantics(
identifier: ComposerKeyValues.composerContentField,
container: true,
child: WebEditorWidget(
editorController: editorController,
content: currentWebContent ?? emailContentQuoted,
Expand Down Expand Up @@ -187,6 +191,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
);
return Semantics(
identifier: ComposerKeyValues.composerContentField,
container: true,
child: WebEditorWidget(
editorController: editorController,
content: currentWebContent ?? emailContentQuoted,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
identifier: widget.prefix == PrefixEmailAddress.to
? ComposerKeyValues.composerToField
: null,
container: true,
child: Container(
decoration: const BoxDecoration(
border: Border(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/features/login/presentation/base_login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ abstract class BaseLoginView extends GetWidget<LoginController> {
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),
Expand Down
1 change: 1 addition & 0 deletions lib/features/login/presentation/login_view_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2511fcb

Please sign in to comment.