From 7b3e3e1b16953756a04d809e63c51015866b12f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 10 Feb 2026 13:39:22 +0100 Subject: [PATCH] Do not focus composer when clicking on tablet bottom bar button --- .../tablet_bottom_bar_composer_widget.dart | 137 +++++++++--------- 1 file changed, 70 insertions(+), 67 deletions(-) diff --git a/lib/features/composer/presentation/widgets/mobile/tablet_bottom_bar_composer_widget.dart b/lib/features/composer/presentation/widgets/mobile/tablet_bottom_bar_composer_widget.dart index d983a30cb..ee92c87a8 100644 --- a/lib/features/composer/presentation/widgets/mobile/tablet_bottom_bar_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/mobile/tablet_bottom_bar_composer_widget.dart @@ -1,6 +1,7 @@ import 'package:core/presentation/resources/image_paths.dart'; import 'package:core/presentation/views/button/tmail_button_widget.dart'; import 'package:flutter/material.dart'; +import 'package:pointer_interceptor/pointer_interceptor.dart'; import 'package:scribe/scribe/ai/presentation/widgets/button/ai_assistant_button.dart'; import 'package:tmail_ui_user/features/composer/presentation/styles/mobile/tablet_bottom_bar_composer_widget_style.dart'; import 'package:tmail_ui_user/main/localizations/app_localizations.dart'; @@ -35,77 +36,79 @@ class TabletBottomBarComposerWidget extends StatelessWidget { return Container( padding: TabletBottomBarComposerWidgetStyle.padding, color: TabletBottomBarComposerWidgetStyle.backgroundColor, - child: Row( - children: [ - const Spacer(), - if (onOpenAiAssistantModal != null) - AiAssistantButton( - imagePaths: imagePaths, - margin: const EdgeInsetsDirectional.only( - start: TabletBottomBarComposerWidgetStyle.space, + child: PointerInterceptor( + child: Row( + children: [ + const Spacer(), + if (onOpenAiAssistantModal != null) + AiAssistantButton( + imagePaths: imagePaths, + margin: const EdgeInsetsDirectional.only( + start: TabletBottomBarComposerWidgetStyle.space, + ), + onOpenAiAssistantModal: onOpenAiAssistantModal!, ), - onOpenAiAssistantModal: onOpenAiAssistantModal!, + const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), + TMailButtonWidget.fromIcon( + icon: imagePaths.icDeleteMailbox, + borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, + padding: TabletBottomBarComposerWidgetStyle.iconPadding, + iconSize: TabletBottomBarComposerWidgetStyle.iconSize, + tooltipMessage: AppLocalizations.of(context).delete, + onTapActionCallback: deleteComposerAction, ), - const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), - TMailButtonWidget.fromIcon( - icon: imagePaths.icDeleteMailbox, - borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, - padding: TabletBottomBarComposerWidgetStyle.iconPadding, - iconSize: TabletBottomBarComposerWidgetStyle.iconSize, - tooltipMessage: AppLocalizations.of(context).delete, - onTapActionCallback: deleteComposerAction, - ), - const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), - TMailButtonWidget.fromIcon( - icon: imagePaths.icMarkAsImportant, - borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, - padding: TabletBottomBarComposerWidgetStyle.iconPadding, - iconSize: TabletBottomBarComposerWidgetStyle.iconSize, - iconColor: isMarkAsImportant + const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), + TMailButtonWidget.fromIcon( + icon: imagePaths.icMarkAsImportant, + borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, + padding: TabletBottomBarComposerWidgetStyle.iconPadding, + iconSize: TabletBottomBarComposerWidgetStyle.iconSize, + iconColor: isMarkAsImportant + ? TabletBottomBarComposerWidgetStyle.selectedIconColor + : TabletBottomBarComposerWidgetStyle.iconColor, + tooltipMessage: isMarkAsImportant + ? AppLocalizations.of(context).turnOffMarkAsImportant + : AppLocalizations.of(context).turnOnMarkAsImportant, + onTapActionCallback: toggleMarkAsImportantAction, + ), + const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), + TMailButtonWidget.fromIcon( + icon: imagePaths.icReadReceipt, + borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, + padding: TabletBottomBarComposerWidgetStyle.iconPadding, + iconSize: TabletBottomBarComposerWidgetStyle.iconSize, + iconColor: hasReadReceipt ? TabletBottomBarComposerWidgetStyle.selectedIconColor : TabletBottomBarComposerWidgetStyle.iconColor, - tooltipMessage: isMarkAsImportant - ? AppLocalizations.of(context).turnOffMarkAsImportant - : AppLocalizations.of(context).turnOnMarkAsImportant, - onTapActionCallback: toggleMarkAsImportantAction, - ), - const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), - TMailButtonWidget.fromIcon( - icon: imagePaths.icReadReceipt, - borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, - padding: TabletBottomBarComposerWidgetStyle.iconPadding, - iconSize: TabletBottomBarComposerWidgetStyle.iconSize, - iconColor: hasReadReceipt - ? TabletBottomBarComposerWidgetStyle.selectedIconColor - : TabletBottomBarComposerWidgetStyle.iconColor, - tooltipMessage: hasReadReceipt - ? AppLocalizations.of(context).turnOffRequestReadReceipt - : AppLocalizations.of(context).turnOnRequestReadReceipt, - onTapActionCallback: requestReadReceiptAction, - ), - const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), - TMailButtonWidget.fromIcon( - icon: imagePaths.icSaveToDraft, - borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, - padding: TabletBottomBarComposerWidgetStyle.iconPadding, - iconSize: TabletBottomBarComposerWidgetStyle.iconSize, - tooltipMessage: AppLocalizations.of(context).saveAsDraft, - onTapActionCallback: saveToDraftAction, - ), - const SizedBox(width: TabletBottomBarComposerWidgetStyle.sendButtonSpace), - TMailButtonWidget( - text: AppLocalizations.of(context).send, - icon: imagePaths.icSend, - iconAlignment: TextDirection.rtl, - padding: TabletBottomBarComposerWidgetStyle.sendButtonPadding, - iconSize: TabletBottomBarComposerWidgetStyle.iconSize, - iconSpace: TabletBottomBarComposerWidgetStyle.sendButtonIconSpace, - textStyle: TabletBottomBarComposerWidgetStyle.sendButtonTextStyle, - backgroundColor: TabletBottomBarComposerWidgetStyle.sendButtonBackgroundColor, - borderRadius: TabletBottomBarComposerWidgetStyle.sendButtonRadius, - onTapActionCallback: sendMessageAction, - ) - ] + tooltipMessage: hasReadReceipt + ? AppLocalizations.of(context).turnOffRequestReadReceipt + : AppLocalizations.of(context).turnOnRequestReadReceipt, + onTapActionCallback: requestReadReceiptAction, + ), + const SizedBox(width: TabletBottomBarComposerWidgetStyle.space), + TMailButtonWidget.fromIcon( + icon: imagePaths.icSaveToDraft, + borderRadius: TabletBottomBarComposerWidgetStyle.iconRadius, + padding: TabletBottomBarComposerWidgetStyle.iconPadding, + iconSize: TabletBottomBarComposerWidgetStyle.iconSize, + tooltipMessage: AppLocalizations.of(context).saveAsDraft, + onTapActionCallback: saveToDraftAction, + ), + const SizedBox(width: TabletBottomBarComposerWidgetStyle.sendButtonSpace), + TMailButtonWidget( + text: AppLocalizations.of(context).send, + icon: imagePaths.icSend, + iconAlignment: TextDirection.rtl, + padding: TabletBottomBarComposerWidgetStyle.sendButtonPadding, + iconSize: TabletBottomBarComposerWidgetStyle.iconSize, + iconSpace: TabletBottomBarComposerWidgetStyle.sendButtonIconSpace, + textStyle: TabletBottomBarComposerWidgetStyle.sendButtonTextStyle, + backgroundColor: TabletBottomBarComposerWidgetStyle.sendButtonBackgroundColor, + borderRadius: TabletBottomBarComposerWidgetStyle.sendButtonRadius, + onTapActionCallback: sendMessageAction, + ) + ] + ), ), ); }