-
Notifications
You must be signed in to change notification settings - Fork 88
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
base: feature/TF-3731-Thread-Detail-Cache-web
Are you sure you want to change the base?
TF-3699 Thread Detail Next previous actions #3843
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/3843. |
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); | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
final threadDetailSettingStatus = ThreadDetailSettingStatus.loading.obs; | ||
AppLifecycleListener? appLifecycleListener; | ||
bool threadDetailWasEnabled = true; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove line
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
long-large-emails.webm |
What about with large content in thread ? |
long-large-emails.webm |
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