Save searches as named views#57

opened6d agobySScreen
The latest issue update is blocked from GitHub. Check sync settings and account permissions. Sync settings

Summary

Let users save a search as a named view (query, account, filters and sort) and reopen it in one step.

Today

shared/mail-search.ts parses fields, phrases and exclusions, and src/mail/MailFilters.tsx holds view, account, label and relevance filters. Nothing can be saved by name.

What to build

  1. "Save view" in the search toolbar when a query or filter is active. Ask only for a name.
  2. Store the definition in encrypted records in server/store.ts, since queries and names can contain personal data.
  3. Open saved views from Commands first. A sidebar group can follow and needs a DESIGN.md update.
  4. Rename and delete from Commands or Settings.

Where

  • src/shell/SearchToolbar.tsx, src/mail/MailFilters.tsx, src/dialogs/CommandPalette.tsx, src/navigation.ts
  • shared/mail-search.ts, shared/types.ts
  • server/store.ts, server/index.ts

Rules to keep

  • A saved view is a query over cached mail. It does not reclassify mail, change categories or fetch more history.
  • The six Inbox categories and the Snoozed, Archive and Done meanings stay as they are.
  • Names and queries are masked in privacy mode.

Acceptance

  • Save, reopen, rename and delete a view; reopening restores query, account, filters and sort exactly.
  • Stored definitions are encrypted.
  • Usable from Commands with the keyboard only.
  • Bounded tests and strict build pass; CHANGELOG.md and docs/KB.md updated.

Related

#42 (global cached-mail search) and #61 (search scope). Build on whichever lands first.

Evidence

Apple Mail Smart Mailboxes, Thunderbird saved searches, Fastmail saved searches, Shortwave.

Source: competitor feature research (2026-10-25), gap G8, rank 7 of 10; design research idea 12.

Claimed by screen. State: In progress.

Scope: encrypted named cached-mail search views, Save view in the search toolbar, and keyboard-accessible open/rename/delete in Commands. Preserve cached search scope and privacy masking.

Owned paths: saved-view shared types/validation, server persistence/API, renderer search/navigation/Commands, focused tests, CHANGELOG.md and docs/KB.md. Base: origin/main at 892ff1c. Feature branch: feat/saved-search-views. One delivery owner; no helpers. No existing PR or claim found in the issue discussion, linked PRs, or repository PR list. PR: not opened.

Planned checks: focused persistence/API and mounted keyboard/privacy tests, full npm test, strict npm run build, git diff --check. Installed and real-account acceptance remain unverified.

Implementation is available locally on feat/saved-search-views, based on main at 892ff1c. Owner remains screen; State remains In progress. Changes are uncommitted and no PR has been opened.

Added encrypted saved-view records and authenticated CRUD, toolbar Save view, and keyboard Commands to open, rename and delete views. Opening restores query, mailbox/tab, account, label, read/relevance filters and sort. Missing accounts/labels disable opening. Privacy hides names and unfocused search text. Mail state and search coverage are unchanged. CHANGELOG.md and docs/KB.md are updated.

Verification on Windows x64, Node 24.22.1:

  • Saved-view service, navigation and Commands checks: 133 passed. After final form styling, the service and three affected navigation cases passed again.
  • npm run build: passed, including strict TypeScript and production bundles.
  • Documentation: 165 local targets checked; git diff --check passed.
  • Full npm test attempt: 1454 passed, 39 skipped, 2 failed. The unfocused-search fixture was corrected to focus before typing; all affected checks above now pass. The remaining macOS installer-target failure also occurs on the separate #58 branch. Its updater source and test are unchanged from main.
  • Isolated desktop startup failed to reach its service; the normal installed app occupies the fixed port. It was left running. Installed UI, real-account acceptance and independent review remain unverified.

Source manifest SHA256: 0c3be3cfbdc42524f39058803bc1bcdae409172f5b59b4d12f5fe743353ea2cc. Full-suite acceptance is still pending, so this issue is not Done.

Delivery update: the owner requested one PR for #57 and #58. Both scopes are being consolidated on feat/saved-views-and-unsubscribe, based on main at 892ff1c. Screen remains the sole delivery owner. The previous feature worktrees remain reference copies; all further delivery edits use the combined branch. State remains In progress.

Both #57 and #58 are committed and published together in PR #139: https://git.cafe/collection-of-devs/aggregate-mail/pulls/139

Base: main at 892ff1c. Branch: feat/saved-views-and-unsubscribe. Head: d0180d6fac78640e0541c04defefa8f5459e6fcc. Commits: bea660e (saved views), d0180d6 (reviewed unsubscribe). Screen remains the sole delivery owner. The combined branch is clean; unrelated website changes are excluded.

Combined verification on Windows x64, Node 24.22.1:

  • npm run build passed, including strict TypeScript and production bundles.
  • npm run check:desktop with a fresh temporary profile passed under a 120-second deadline: renderer loaded, encrypted database opened, isolated API and background close. Electron 44.9.3 reported packaged=false; the owned process and listener exited. This supersedes the earlier source-startup port blocker, and does not establish installed UI acceptance.
  • npm test: 1462 passed, 39 skipped, 1 failed. The only failure is the unchanged desktop/mac-installer-update.test.ts:160 installer-target case, also observed on both separate feature snapshots. All saved-view and unsubscribe cases pass on the combined revision.
  • Commit privacy, diff whitespace and all 166 local documentation targets passed.

Both issues are linked to this single PR with a closes relationship. State stays In progress until merge and acceptance. Full-suite success, independent review, installed UI/browser handoff and live-provider behavior remain unverified. No merge or release was performed.

Closing as completed: the encrypted named saved searches implementation is merged in https://git.cafe/collection-of-devs/aggregate-mail/pulls/139. The previous In progress status is stale.

This reconciles the completed implementation across GitCafe and GitHub. Native, installed and live-provider acceptance remain limited to the fixing PR receipts; this bookkeeping update runs no new tests or real-mail operations.