Skip to content

TF-3699 Thread Detail Next previous actions #3843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: feature/TF-3731-Thread-Detail-Cache-web
Choose a base branch
from

Conversation

tddang-linagora
Copy link
Collaborator

Issue

Demo

Thread setting enable

Web

thread-enable-web.mov

Mobile

thread-enable-mobile.webm

Thread setting disable

Web

thread-disable-web.mov

Mobile

thread-disable-mobile.webm

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/3843.

Comment on lines 12 to 63
void onNext() {
if (!nextAvailable) return;

if (isThreadDetailEnabled) {
final currentThreadIndex = availableThreadIds.indexOf(currentThreadId!);
final nextThreadIndex = currentThreadIndex + 1;
final nextThreadId = availableThreadIds[nextThreadIndex];
_preparePageWithIndex(nextThreadIndex);
_goToPageWithEmail(
currentDisplayedEmails.firstWhereOrNull(
(presentationEmail) => presentationEmail.threadId == nextThreadId,
),
);
return;
}

final currentEmailIndex = currentDisplayedEmails.indexOf(
mailboxDashBoardController.selectedEmail.value!,
);
final nextEmailIndex = currentEmailIndex + 1;
final nextEmail = currentDisplayedEmails[nextEmailIndex];
_preparePageWithIndex(nextEmailIndex);
_goToPageWithEmail(nextEmail);
}

bool get previousAvailable => isThreadDetailEnabled
? currentThreadId != availableThreadIds.firstOrNull
: currentEmailId != currentDisplayedEmails.firstOrNull?.id;
void onPrevious() {
if (!previousAvailable) return;

if (isThreadDetailEnabled) {
final currentThreadIndex = availableThreadIds.indexOf(currentThreadId!);
final previousThreadIndex = currentThreadIndex - 1;
final previousThreadId = availableThreadIds[previousThreadIndex];
_preparePageWithIndex(previousThreadIndex);
_goToPageWithEmail(
currentDisplayedEmails.firstWhereOrNull(
(presentationEmail) => presentationEmail.threadId == previousThreadId,
),
);
return;
}

final currentEmailIndex = currentDisplayedEmails.indexOf(
mailboxDashBoardController.selectedEmail.value!,
);
final previousEmailIndex = currentEmailIndex - 1;
final previousEmail = currentDisplayedEmails[previousEmailIndex];
_preparePageWithIndex(previousEmailIndex);
_goToPageWithEmail(previousEmail);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated code, we should improve it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dab246
Copy link
Member

dab246 commented Jun 27, 2025

  • Test email with long content , large width

final threadDetailSettingStatus = ThreadDetailSettingStatus.loading.obs;
AppLifecycleListener? appLifecycleListener;
bool threadDetailWasEnabled = true;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ThreadDetailManager(this._getThreadDetailStatusInteractor);

final availableThreadIds = RxList<ThreadId>();
final currentMobilePageViewIndex = 0.obs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only use for mobile?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@tddang-linagora
Copy link
Collaborator Author

Test email with long content , large width

long-large-emails.webm

@tddang-linagora tddang-linagora requested a review from dab246 June 27, 2025 03:16
@dab246
Copy link
Member

dab246 commented Jun 27, 2025

Test email with long content , large width

What about with large content in thread ?

@tddang-linagora
Copy link
Collaborator Author

What about with large content in thread ?

long-large-emails.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Thread] Previous and Next between Thread
3 participants