Skip to content

[Thread] Filter Out Emails in Trash/Drafts/Templates from Thread ViewΒ #4403

@dab246

Description

@dab246

Related

Description

A thread can contain emails spread across multiple mailboxes. Emails belonging to Trash, Drafts, or Templates should not appear in the thread view and should be excluded from thread-aware actions.

Rationale

  • Trash: user already deleted the email β€” it should not reappear in thread view
  • Drafts: not yet sent β€” should not be shown as part of the conversation
  • Templates: not a real email in the conversation

Tasks

  • After ThreadExpansionService.expandThreads() returns, filter out emails whose mailboxIds contain Trash, Drafts, or Templates mailbox IDs
  • Resolve Trash/Drafts/Templates mailbox IDs from MailboxDashboardController or session capabilities
  • Apply the filter to both:
    • Thread detail view (displaying emails within a thread)
    • Thread-aware actions (do not perform actions on filtered-out emails)
  • Handle edge case: if all emails in a thread are filtered out, hide the thread from the list or handle gracefully

Acceptance Criteria

  • Emails in Trash do not appear in thread view
  • Emails in Drafts do not appear in thread view
  • Emails in Templates do not appear in thread view
  • Thread actions only apply to non-filtered emails
  • A thread containing only filtered emails is hidden or handled gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions