Skip to content

fix(email): exclude trashed messages from importance filter and use inbox emailView for signal/noise#1975

Merged
evanhutnik merged 3 commits intomainfrom
evan/trash-in-inbox
Mar 16, 2026
Merged

fix(email): exclude trashed messages from importance filter and use inbox emailView for signal/noise#1975
evanhutnik merged 3 commits intomainfrom
evan/trash-in-inbox

Conversation

@evanhutnik
Copy link
Copy Markdown
Contributor

Summary

  • Importance filter excludes TRASH: The dynamic query importance=true message filter now wraps its conditions with a NOT EXISTS check for the TRASH label. Previously, a trashed draft (is_draft=true + TRASH label) would still pass the importance filter since is_draft=TRUE was evaluated unconditionally.
  • Inbox signal/noise emailView: Changed the emailView for the inbox signal and noise tab presets from all to inbox so the backend correctly scopes the soup request to inbox messages. Also removed a duplicate emailView property that was outside queryFilters in the signal preset.
  • Test coverage: Added a trashed-draft fixture (thread 9) and an integration test (test_importance_true_excludes_trashed_drafts) plus a unit test (test_build_message_email_filter_importance_true_excludes_trash) to verify the TRASH exclusion.

…nbox emailView for signal/noise

- Update dynamic query importance=true filter to exclude messages with TRASH label,
  even if is_draft=true
- Change inbox signal/noise tab emailView from 'all' to 'inbox' so the backend
  correctly scopes the soup request
- Add test fixture (thread 9: trashed draft) and integration test to verify
  trashed drafts are excluded from importance=true results

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 16, 2026

evanhutnik and others added 2 commits March 16, 2026 14:56
…eries

Add NOT EXISTS TRASH checks to important, starred, drafts, and user_label
preview queries. Previously only the dynamic query and inbox/sent/all_mail
views excluded trashed messages.

Add fixture data (threads 10-11: trashed starred, trashed user-label) and
integration tests for each static view.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@evanhutnik evanhutnik merged commit df66486 into main Mar 16, 2026
39 checks passed
@evanhutnik evanhutnik deleted the evan/trash-in-inbox branch March 16, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant