feat: search bar in topbar with Gmail-style query syntax

- Search form in topbar routes to /app/search?q=...
- SearchResults page with infinite scroll, same row style as FolderView
- Supports Gmail-like operators: from:, is:unread, has:attachment, after:, before:
- SearchApi.query() calls GET /search which runs through the existing GmailQueryParser
- Input sanitised via encodeURIComponent on submit; external links use noopener/noreferrer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
cesnimda
2026-06-30 20:15:45 +02:00
parent 4d15a3a8fb
commit 498536451e
5 changed files with 164 additions and 1 deletions
+2
View File
@@ -65,6 +65,8 @@ export const LayoutApi = {
export const SearchApi = {
folder: (slug, page = 1, pageSize = 50) =>
api.post('/search', folderToRequest(slug, page, pageSize)).then((r) => r.data),
query: (q, page = 1, pageSize = 50) =>
api.get('/search', { params: { q, page, pageSize } }).then((r) => r.data),
};
function folderToRequest(slug, page, pageSize) {