feat: Search pagination and UX improvements
- Add pagination support to search (previously limited to 50 results) - Search now scoped to current mailbox/folder - Support shared mailbox folders in search - Display total results count (e.g., "50 of 1400 conversations") - Add clear (X) button to search input - Re-run search when changing folders during active search - Remove unused sidebar screenshot
This commit is contained in:
+17
-1
@@ -67,6 +67,8 @@ export default function Home() {
|
||||
toggleStar,
|
||||
moveToMailbox,
|
||||
searchEmails,
|
||||
searchQuery,
|
||||
setSearchQuery,
|
||||
isLoading,
|
||||
isLoadingEmail,
|
||||
setLoadingEmail,
|
||||
@@ -469,7 +471,12 @@ export default function Home() {
|
||||
}
|
||||
|
||||
if (client) {
|
||||
await fetchEmails(client, mailboxId);
|
||||
// If there's an active search, re-run it in the new mailbox
|
||||
if (searchQuery) {
|
||||
await searchEmails(client, searchQuery);
|
||||
} else {
|
||||
await fetchEmails(client, mailboxId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -483,6 +490,13 @@ export default function Home() {
|
||||
await searchEmails(client, query);
|
||||
};
|
||||
|
||||
const handleClearSearch = async () => {
|
||||
setSearchQuery("");
|
||||
if (client && selectedMailbox) {
|
||||
await fetchEmails(client, selectedMailbox);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDownloadAttachment = async (blobId: string, name: string, type?: string) => {
|
||||
if (!client) return;
|
||||
|
||||
@@ -645,6 +659,8 @@ export default function Home() {
|
||||
}}
|
||||
onLogout={handleLogout}
|
||||
onSearch={handleSearch}
|
||||
onClearSearch={handleClearSearch}
|
||||
activeSearchQuery={searchQuery}
|
||||
quota={quota}
|
||||
isPushConnected={isPushConnected}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user