todo: extend email search with Gmail-style operators (from:, subject:, has:attachment, …)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,20 @@ Deferred work. Context: Officer is collapsing from multi-tenant / open-source-re
|
|||||||
under `dev-data/{email}/home`, per-user server state (dock, user apps, AppRegistry keyed by
|
under `dev-data/{email}/home`, per-user server state (dock, user apps, AppRegistry keyed by
|
||||||
email), and auth (passkeys-per-origin, JWT signin, unmounted `PasskeyGate`).
|
email), and auth (passkeys-per-origin, JWT signin, unmounted `PasskeyGate`).
|
||||||
|
|
||||||
|
## Email
|
||||||
|
|
||||||
|
- [ ] **Gmail-style search operators.** Extend the FTS5 search (`/email/search`, `searchEmails` +
|
||||||
|
`toFtsQuery` in `api/email/email-db.ts`) to parse structured operators like `from:`, `to:`,
|
||||||
|
`subject:`, `has:attachment`, `label:`, `before:`/`after:` (dates), `is:unread`, quoted phrases,
|
||||||
|
and `OR`. Today `toFtsQuery` just does per-term prefix-AND across all columns.
|
||||||
|
Approach: split the query into (a) **field-scoped text** → FTS5 column filters (the `emails_fts`
|
||||||
|
table already has named columns `subject`/`sender`/`recipients`/`snippet`/`body`, so
|
||||||
|
`subject:foo` → `{subject}:"foo"*` in the MATCH; `from:x` → the `sender` column) and (b)
|
||||||
|
**structured filters** applied as SQL `WHERE` alongside the MATCH — `has:attachment` →
|
||||||
|
`attachment_count > 0`, `before:/after:` → `date` range, `is:unread` → `read = 0`, `label:` →
|
||||||
|
`labels LIKE`. Free text stays full-text. Frontend: keep the single search box (operators are
|
||||||
|
typed inline, Gmail-style) — no UI change needed beyond maybe a hint/legend.
|
||||||
|
|
||||||
## Known bugs
|
## Known bugs
|
||||||
|
|
||||||
- [ ] **`bootstrap.ts` runs `npm install -g` for Pi on every boot.** `findPiPackageDir` checks stale
|
- [ ] **`bootstrap.ts` runs `npm install -g` for Pi on every boot.** `findPiPackageDir` checks stale
|
||||||
|
|||||||
Reference in New Issue
Block a user