TF-4301 Address code review comments on label feature

- Make LabelModalMixin interactor getters non-nullable; remove force-unwraps at call sites
- Show positiveLabel and add semanticLabel in progressing button for accessibility
- Use timestamp-based label name in E2E scenario to prevent flakiness on reused accounts
- Guard labelAs action with isLabelAvailable check in SingleEmailController
- Don't pop back on label creation failure so users can retry without losing context
- Block modal dismissal while label creation request is in flight
- Null-guard email.id before toggling label in ThreadView::onCreateANewLabelAction
- Log stackTrace and rethrow in DialogRouter to distinguish errors from user cancel
This commit is contained in:
dab246
2026-04-16 17:10:43 +07:00
committed by Dat H. Pham
parent 232987ae0c
commit 660c4f40e2
8 changed files with 33 additions and 20 deletions
@@ -12,8 +12,8 @@ import 'package:tmail_ui_user/main/routes/dialog_router.dart';
mixin LabelModalMixin {
List<Label> get labels;
ImagePaths get imagePaths;
CreateNewLabelInteractor? get createNewLabelInteractor;
EditLabelInteractor? get editLabelInteractor;
CreateNewLabelInteractor get createNewLabelInteractor;
EditLabelInteractor get editLabelInteractor;
Future<dynamic> openCreateNewLabelModal({
required AccountId accountId,
@@ -26,8 +26,8 @@ mixin LabelModalMixin {
accountId: accountId,
imagePaths: imagePaths,
verifyNameInteractor: verifyNameInteractor,
createNewLabelInteractor: createNewLabelInteractor!,
editLabelInteractor: editLabelInteractor!,
createNewLabelInteractor: createNewLabelInteractor,
editLabelInteractor: editLabelInteractor,
),
dialogLabel: 'create-new-label-modal',
);
@@ -47,8 +47,8 @@ mixin LabelModalMixin {
selectedLabel: selectedLabel,
actionType: LabelActionType.edit,
verifyNameInteractor: verifyNameInteractor,
createNewLabelInteractor: createNewLabelInteractor!,
editLabelInteractor: editLabelInteractor!,
createNewLabelInteractor: createNewLabelInteractor,
editLabelInteractor: editLabelInteractor,
),
dialogLabel: 'edit-label-modal',
);