Files
webmail/lib
Patrick Rotter 90a6c0cb1d fix: a search inside a tag view narrows the tag instead of replacing it
Selecting a tag does not clear an active search: `handleTagSelect` leaves
`searchQuery`/`searchFilters` alone and `selectKeyword` leaves
`selectedMailbox`, so a tag view and a search are active together. The
paths then disagreed about which one wins:

  fetchEmails / refreshCurrentMailbox → `selectedKeyword` first, so the
    tag fan-out ran and the query was dropped;
  searchEmails / advancedSearch / loadMoreEmails → the search first, so
    since #1082 the all-folders fan-out ran and the tag was dropped.

Both orders are defensible on their own; having both is not. A
push-triggered refresh silently replaced a search result list with the
whole tag, and "load more" appended rows the tag does not contain — the
same class of inconsistency #1082 set out to remove between a search and
its own next page.

Resolve it the way the codebase already documents ("a tag view takes
precedence over the selected folder"), and keep the query: a search inside
a tag view now narrows the tag, in all five paths. `fetchTagEmails` grows
an optional `extraFilter`, which `getEmails` already accepts alongside
`hasKeyword` — the same argument the message-list category tabs use — so
no new query plumbing is needed.

Searching within the tag is also the more useful reading: a tag view is a
list the user deliberately opened, and a search box above it reads as
"within this", not "forget this".
2026-09-22 19:41:51 +02:00
..
2026-09-03 22:12:15 -07:00
2026-04-16 19:07:42 +02:00
2026-04-16 19:07:42 +02:00