TF-4013 Unified UX between mobile and web
(cherry picked from commit 298afd1871aedc3549191b16796241aec9b4552d)
This commit is contained in:
@@ -5,7 +5,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:model/extensions/email_address_extension.dart';
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/email_address_action_type.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/extensions/handle_create_new_rule_filter.dart';
|
||||
@@ -60,8 +59,7 @@ extension HandleEditRecipientExtension on ComposerController {
|
||||
switch(prefix) {
|
||||
case PrefixEmailAddress.to:
|
||||
listToEmailAddress.remove(emailAddress);
|
||||
toAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
toAddressExpandMode.refresh();
|
||||
toRecipientState.refresh();
|
||||
_setTextAndFocus(
|
||||
controller: toEmailAddressController,
|
||||
focusNode: toAddressFocusNode,
|
||||
@@ -70,8 +68,7 @@ extension HandleEditRecipientExtension on ComposerController {
|
||||
break;
|
||||
case PrefixEmailAddress.cc:
|
||||
listCcEmailAddress.remove(emailAddress);
|
||||
ccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
ccAddressExpandMode.refresh();
|
||||
ccRecipientState.refresh();
|
||||
_setTextAndFocus(
|
||||
controller: ccEmailAddressController,
|
||||
focusNode: ccAddressFocusNode,
|
||||
@@ -80,8 +77,7 @@ extension HandleEditRecipientExtension on ComposerController {
|
||||
break;
|
||||
case PrefixEmailAddress.bcc:
|
||||
listBccEmailAddress.remove(emailAddress);
|
||||
bccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
bccAddressExpandMode.refresh();
|
||||
bccRecipientState.refresh();
|
||||
_setTextAndFocus(
|
||||
controller: bccEmailAddressController,
|
||||
focusNode: bccAddressFocusNode,
|
||||
@@ -90,8 +86,7 @@ extension HandleEditRecipientExtension on ComposerController {
|
||||
break;
|
||||
case PrefixEmailAddress.replyTo:
|
||||
listReplyToEmailAddress.remove(emailAddress);
|
||||
replyToAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
replyToAddressExpandMode.refresh();
|
||||
replyToRecipientState.refresh();
|
||||
_setTextAndFocus(
|
||||
controller: replyToEmailAddressController,
|
||||
focusNode: replyToAddressFocusNode,
|
||||
|
||||
+1
-5
@@ -1,7 +1,6 @@
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/email/prefix_email_address.dart';
|
||||
import 'package:model/extensions/email_address_extension.dart';
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/prefix_recipient_state.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/utils/email_utils.dart';
|
||||
@@ -31,22 +30,18 @@ extension HandleRecipientsCollapsedExtensions on ComposerController {
|
||||
|
||||
if (listToEmailAddress.isNotEmpty) {
|
||||
toRecipientState.value = PrefixRecipientState.enabled;
|
||||
toAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
}
|
||||
|
||||
if (listCcEmailAddress.isNotEmpty) {
|
||||
ccRecipientState.value = PrefixRecipientState.enabled;
|
||||
ccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
}
|
||||
|
||||
if (listBccEmailAddress.isNotEmpty) {
|
||||
bccRecipientState.value = PrefixRecipientState.enabled;
|
||||
bccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
}
|
||||
|
||||
if (listReplyToEmailAddress.isNotEmpty) {
|
||||
replyToRecipientState.value = PrefixRecipientState.enabled;
|
||||
replyToAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
}
|
||||
|
||||
updatePrefixRootState();
|
||||
@@ -96,6 +91,7 @@ extension HandleRecipientsCollapsedExtensions on ComposerController {
|
||||
}
|
||||
|
||||
void hideAllRecipients() {
|
||||
fromRecipientState.value = PrefixRecipientState.disabled;
|
||||
toRecipientState.value = PrefixRecipientState.disabled;
|
||||
ccRecipientState.value = PrefixRecipientState.disabled;
|
||||
bccRecipientState.value = PrefixRecipientState.disabled;
|
||||
|
||||
-5
@@ -1,5 +1,4 @@
|
||||
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:tmail_ui_user/features/base/model/filter_filter.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/draggable_email_address.dart';
|
||||
@@ -33,19 +32,15 @@ extension RemoveDraggableEmailAddressBetweenRecipientFieldsExtension on Composer
|
||||
switch(draggableEmailAddress.filterField) {
|
||||
case FilterField.to:
|
||||
controller.listToEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.toAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
break;
|
||||
case FilterField.cc:
|
||||
controller.listCcEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.ccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
break;
|
||||
case FilterField.bcc:
|
||||
controller.listBccEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.bccAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
break;
|
||||
case FilterField.replyTo:
|
||||
controller.listReplyToEmailAddress.remove(draggableEmailAddress.emailAddress);
|
||||
controller.replyToAddressExpandMode.value = ExpandMode.EXPAND;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:model/mailbox/expand_mode.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_controller.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/prefix_recipient_state.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart';
|
||||
@@ -29,7 +28,6 @@ extension SetupEmailRecipientsExtension on ComposerController {
|
||||
if (emailAddressOfTo.isNotEmpty) {
|
||||
listToEmailAddress.addAll(emailAddressOfTo);
|
||||
isInitialRecipient.value = true;
|
||||
toAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
}
|
||||
break;
|
||||
case EmailActionType.composeFromMailtoUri:
|
||||
@@ -40,19 +38,16 @@ extension SetupEmailRecipientsExtension on ComposerController {
|
||||
if (emailAddressOfTo.isNotEmpty) {
|
||||
listToEmailAddress.addAll(emailAddressOfTo);
|
||||
isInitialRecipient.value = true;
|
||||
toAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
}
|
||||
|
||||
if (emailAddressOfCc.isNotEmpty) {
|
||||
listCcEmailAddress = emailAddressOfCc;
|
||||
ccRecipientState.value = PrefixRecipientState.enabled;
|
||||
ccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
}
|
||||
|
||||
if (emailAddressOfBc.isNotEmpty) {
|
||||
listBccEmailAddress = emailAddressOfBc;
|
||||
bccRecipientState.value = PrefixRecipientState.enabled;
|
||||
bccAddressExpandMode.value = ExpandMode.COLLAPSE;
|
||||
}
|
||||
break;
|
||||
case EmailActionType.reply:
|
||||
|
||||
Reference in New Issue
Block a user