Skip to content

Conversation

Shadow243
Copy link
Member

This PR introduces a new parameter that allows Cypht to search for flagged messages across all folders.
By default, the search is limited to the INBOX, which is lightweight and optimized for performance.

Enabling the new option allows a broader search across the entire server, but it's more resource-intensive.
Therefore, users should be aware of the performance implications before activating it.

Reported at https://avan.tech/item136195#threadId91599 as point 5

@Shadow243 Shadow243 marked this pull request as draft July 22, 2025 15:17
@Shadow243 Shadow243 requested a review from kroky July 22, 2025 15:18
@Shadow243 Shadow243 force-pushed the feat/allow-flagged-in-all-folders branch from 5a4f65c to 26bc417 Compare July 22, 2025 15:18
@Shadow243 Shadow243 changed the title fea(backend): allow search flagged in all folders if enabled in settings feat(backend): allow search flagged in all folders if enabled in settings Jul 22, 2025
foreach (array_keys($all_folders) as $folder) {
$uids = $mailbox->search($folder, $filter, $terms, $sort, $reverse);
$headers = $mailbox->get_message_list($folder, $uids);
$uids = array_slice($uids, 0, $limit);
Copy link
Member

Choose a reason for hiding this comment

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

How do you apply the limit across folders? Limit is flagged per source, so it should be decreased when a folder returns some results.

@kroky
Copy link
Member

kroky commented Aug 4, 2025

@Shadow243 why is this still in draft? Isn't it ready for review?

@marclaporte
Copy link
Member

marclaporte commented Aug 29, 2025

Brainstorming: There is often this trade off of search here (fast) vs search everywhere (slow).

It's not just for flagged emails, but also for tags and general search. I wonder if we should generalize this?

So the default is the quick search, and when relevant, add a link/button/option to extend this search to all folders (or something)

"Did you find what you were looking for? Would you like to expand this search to all folders of this account or all folders of all accounts?" (or something like this)

See also: #676

This is not a blocker for 2.5.0 but quite important, so I will put it for milestone 2.6

Let's discuss at our https://github.com/cypht-org/cypht/wiki/Monthly-Community-Meetings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants