Skip to content

feat: Allow user to control message view mode #10945

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 7 commits into
base: main
Choose a base branch
from

Conversation

SebastianKrupinski
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski commented Mar 29, 2025

Resolves: #5913

Summary

  • Adds the ability for a user to control message viewing mode (Threaded View or Singleton View)
  • Adds the ability for a administrator to preset default message viewing mode (Threaded View or Singleton View)
  • Changes behavior of drag and dropping message(s) to folder depending on viewing mode (Threaded View or Singleton View)
  • Changes behavior of Message List -> Message Actions menu (Move, Delete, Snooze) depending on viewing mode (Threaded View or Singleton View)

User Setting

Screenshot 2025-03-29 164914

Administrator Settings

Screenshot 2025-03-29 164801

Signed-off-by: SebastianKrupinski <[email protected]>
@SebastianKrupinski SebastianKrupinski force-pushed the enh/issue-5913-diable-mail-threading branch from 97d05cd to 2c6772c Compare March 29, 2025 21:38
@ChristophWurst
Copy link
Member

If you receive two messages that form a thread, you will still only see one entry in your INBOX with the current approach, right?

@GretaD
Copy link
Contributor

GretaD commented Apr 3, 2025

before
1

after
2

Copy link
Contributor

@GretaD GretaD left a comment

Choose a reason for hiding this comment

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

it works as described

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Tested and doesn't work. It's only possible to open the latest received message of a thread. I can not open earlier ones, because they are not shown in the message list. The list is still threaded.

@SebastianKrupinski
Copy link
Contributor Author

Tested and doesn't work. It's only possible to open the latest received message of a thread. I can not open earlier ones, because they are not shown in the message list. The list is still threaded.

Correct! I was not aware we stacked messages in the list, I have already made the backed and front end changes, just need to updated some backend tests, will push the update soon.

@SebastianKrupinski
Copy link
Contributor Author

Tested and doesn't work. It's only possible to open the latest received message of a thread. I can not open earlier ones, because they are not shown in the message list. The list is still threaded.

Corrected, message are no longer stacked in message list.

image

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Looks sane

Are there any plans to skip building threads if the user doesn't use them anyway?

if ($view !== null) {
$view = $view === 'singleton' ? IMailSearch::VIEW_SINGLETON : IMailSearch::VIEW_THREADED;
}
$messages = $this->mailSearch->findMessages(
Copy link
Member

Choose a reason for hiding this comment

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

Inline the var and you have a smaller diff ✨

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, Hopefully this is what you ment

@ChristophWurst
Copy link
Member

Are there any plans to skip building threads if the user doesn't use them anyway?

@SebastianKrupinski?

@SebastianKrupinski
Copy link
Contributor Author

Are there any plans to skip building threads if the user doesn't use them anyway?

@SebastianKrupinski?

Fixed, took some major head scratching to find the correct code.

@SebastianKrupinski
Copy link
Contributor Author

Will fix lint errors on final approval

@ChristophWurst
Copy link
Member

Apologies if my communication wasn't clear from the ticket and task description (#5913 (comment)). I should have communicated this more actively.

Do you see an issue with handling "dethreading" on the database level? With the latest changes we see lots of conditional logic for threaded vs non threaded views. When every message forms a thread of one, we don't need the conditional logic, do we?

Building threads needs a check to be skipped with any solution. With the current state they are still built:

...
[debug] Building threads for account 4634
[debug] Account 4634 has 30 messages with threading information
[debug] Threading 30 messages - build ID table took 0s. 15/16MB memory used
[debug] Threading 30 messages - build root container took 0s. 15/16MB memory used
[debug] Threading 30 messages - free ID table took 0s. 15/16MB memory used
[debug] Threading 30 messages - prune containers took 0s. 15/16MB memory used
[debug] Threading 30 messages - group by subject took 0s. 16/16MB memory used
[debug] Threading 30 messages took 0s
...

@SebastianKrupinski
Copy link
Contributor Author

Do you see an issue with handling "dethreading" on the database level? With the latest changes we see lots of conditional logic for threaded vs non threaded views. When every message forms a thread of one, we don't need the conditional logic, do we?

Building threads needs a check to be skipped with any solution. With the current state they are still built:

I see what you mean on the building threads part, this should now be addressed.

As for the conditional logic on the front end, if I understand your comments properly, yes we do (but I might be missing something), can we discuss on Monday?

@ChristophWurst
Copy link
Member

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

Disable Mail Threading
3 participants