Commit Graph
2390 Commits
Author SHA1 Message Date
Linus Rath b1c4bb00d9 chore: merge opening files and sharing into the mail branch 2026-11-03 07:30:08 +01:00
Linus Rath d6ae3d172b feat: merge opening files and sharing into the installed app
# Conflicts:
#	components/mail/mail-app.tsx
#	lib/__tests__/sw-harness.ts
2026-11-03 07:11:39 +01:00
Linus Rath f716ea66ee fix: ask before a share starts a message and save nothing until the first edit
Any site could POST a form to the share target on load: with no clicks
the composer opened with its subject and file, and autosave stored a
real draft on the server 2 seconds later. The worker can't see where a
POST came from, and Chromium's link capturing accepts form submissions,
so an installed-app window proves nothing either.

- every share landing now asks first, in every window and browser; a
  text landing address gets the same question. Nothing goes up before
  the answer.
- handed-in text and files are the composer's starting state: no
  autosave, page-close save or sign-out flush before the first real
  edit.
- the worker ignores frames, keeps at most 5 entries and 100 MB for 15
  minutes, sweeps on activate, on each share and from a page timer,
  and seals what it keeps with a key passed in the landing fragment.
  Offline wipes clear it too.
- the server fallback uses the fragment and caps by encoded length:
  3000 Japanese characters made a 27 KB `Location` and a 431.
- a second compose handoff waits until the composer closes, also one
  set aside by reading a message, where it used to replace the first.
- a launch leaving the mail page saves what was just typed first.
- an expired handoff or a missing stored file now says so; shares get
  the control-character stripping and limits of `parseMailto`.

Existing tests changed because the landing moved from the query to the
fragment, stored entries gained a sealed part, and a share now asks
first.
2026-11-03 07:08:38 +01:00
Linus Rath 20b2e7054e chore: merge search, notification actions and calendar into the mail branch 2026-11-03 07:02:39 +01:00
Linus Rath 2eb835b0b6 feat: merge offline calendar
# Conflicts:
#	lib/jmap/offline-hooks.ts
2026-11-03 06:39:38 +01:00
Linus Rath a3819f6a1c fix: keep offline calendar writes in order, and stop them getting lost or doubled
Review of the calendar store found writes that went missing, went out
wrong, or appeared twice.

- Writes with different scheduling flags stay separate and go out in
  order. Merging them collapsed the two steps of an occurrence change, so
  attendees who had answered got no mail, and "don't notify" went out to
  everyone with a later RSVP.
- An edit made after a create's lost response is sent as an update. An
  import of a uid the server has updates what differs.
- `createCalendarEvent`, `batchCreateCalendarEvents` and
  `createCalendarTask` choose a uid before the first send, so a lost
  answer online doesn't duplicate.
- The client resolves stand-in ids before the network, which covers an
  open dialog once the server is back.
- A stale whole `recurrenceOverrides` map no longer erases overrides.
- A 4xx refuses that write and the queue goes on. `serverFail`,
  `rateLimit` or an answer with no verdict retry instead of deleting.
- "This and all following" is refused offline with a clear message.
- A full list only drops what the server says it doesn't have. Sync adopts
  a stand-in by uid. Reminder keys survive a stand-in becoming real.
  Accounts the session no longer lists are forgotten.

Changed tests: the one asserting a sticky scheduling flag is gone, it
locked in the bug. Reminder keys now use the account and uid. Two flush
assertions drop `sent: 1`, because sync reads a lost write back first. The
two-account id test uses a listed account, as unlisted ones are removed.
2026-11-03 06:32:53 +01:00
Linus Rath 51c09a1a69 fix: never let a notification's buttons go round plugins, session limits or Trash
Review of the notification actions. With a plugin that may stop a move
or read change, or a silent tab holding the login, the message now
opens instead of the route acting. The route answers 401 under a
session limit, and neither path touches a message since moved to Trash
or Junk. A tab that thawed declines an old click, Archive follows the
gate of the notification's login and files into a shared-out Archive
as the app's button does, Reply opens a composer in the Pro shell, the
route retries once when another client made the folder first and
leaves no empty folder behind, and logins match however the server
address is written.

Two assertions of this feature's own tests change: the route answers
401, not 403, when a login's scopes can't be worked out, since that now
also covers session limits; a tab's message to the page now carries
`at`.

The Pro shell's mail surface now reads a parked link's query from the
handoff: the address bar may have none by its first render, which lost
`?slot=` and `?owner=` there too.
2026-11-03 06:28:04 +01:00
Linus Rath a025b78ed4 test: pin the fixed Message-ID, the found copy and the conflict list 2026-11-03 06:16:09 +01:00
Linus Rath f6db7ea53a fix: keep pinned and unread-first lists off a full sort, and stop syncing when the disk is full 2026-11-03 06:02:10 +01:00
Linus Rath 687e7cc012 feat: move offline mode onto the encrypted local store
The IndexedDB cache, its crypto, the responder and the page-side sync
go. lib/offline keeps its structure, policy, wipes, sign-out gates and
notices; answers, the outbox and sync now live in lib/store, in a worker
behind lib/store/client/api.ts.

What users get besides that:
- every folder is kept, not just the Inbox and opened ones
- delete for good and empty trash work offline
- a change the server refuses, or that meets a message changed on
  another device, is shown instead of dropped
- a send whose response got lost is looked up by a Message-ID fixed when
  it was queued, then finished, submitted or sent again
- with the store on, a start paints from the local copy, then connects

An account the app drops by itself no longer wipes its data: only a
sign-out or an explicit removal does. The outbox of the old database
moves over once, in lib/offline/migrate-legacy.ts, and the old database
goes only after the store committed. `isNetworkFailure` now counts
timeouts and proxy 5xx. Sends and outbox requests are never answered
from the device.

Tests moved with the code: cache.test.ts and responder.test.ts are
replaced by lib/store/__tests__/, and review-fixes.test.ts, outbox.test.ts
and client-fallback.test.ts now run the real engine on node:sqlite.
Changed assertions: an uncertain send is looked up rather than left alone
forever, destroy and empty trash are queued rather than refused, and #9
(opened folders) became "a folder the server deleted goes", since all
folders are kept.
2026-11-03 05:54:39 +01:00
Linus Rath fdeb7963ba refactor: read event durations without loading the calendar UI 2026-11-03 05:41:35 +01:00
Linus Rath 2bb0797996 feat: archive, mark read or reply right from a new mail notification
A notification for one message gets buttons where the browser has room
for them, and a click on its body works as before. The service worker
has no login, so an open tab takes the action first, through the store
actions. With no tab open a new same-origin route, /api/push/action,
does Mark read and Archive with the context cookie. When the cookie is
gone, the token has expired or the login can't be told apart, the
message opens in the app instead. Reply opens the composer through a
`?reply=1` link, with any text typed on the notification.

- `public/sw.js`: buttons, asking open tabs, the route, `sync` handling
- `app/api/push/action`: same-origin, checks the login and the account,
  honours the admin's Archive gate, files by the mirrored archive mode
- `lib/pwa-notify`: the page's side, the mirror for the worker, and
  `requestOutboxSync`, which the offline queue calls
- Background Sync, thin version: a `sync` event tells open tabs to flush

Two push-preview-route assertions change: they match the whole answer
for a named message, which now also carries `login`, what the action
route checks so a stale notification can't act on whoever holds the
cookie slot now.
2026-11-03 05:26:43 +01:00
Linus Rath c65d18eaae feat: open mail, calendar and contact files from the OS and share into a new draft
The installed app only handled mailto: and webcal: launches. The launch
consumer dropped files, and nothing could hand a File to the composer or
the import dialogs, because the pending mailto is JSON in sessionStorage.

- manifest: `shortcuts` named in the browser's language, `file_handlers`
  for .eml, .ics and .vcf, and `share_target`, all with the base path and
  per-domain branding. Lite's manifest is unchanged.
- `lib/launch-handoff.ts`: the one place files and links wait, in memory
  and in the Cache API, so they survive a sign-in that leaves the page.
  The desktop bridge can call the same functions, since launchQueue never
  fires in Electron. Sign-out clears it.
- launch consumer: routes files by type, and takes a shortcut to an open
  window, which focus-existing would otherwise only focus.
- .eml opens in a new host for the preview, also before sign-in, with the
  strictest device policy deciding about saving. .ics and .vcf open their
  import dialogs through a new `initialFile` prop. A .ics needs the server,
  so offline the dialog says so and carries on once back online.
- composer: `initialFiles` goes through `addFiles`, so plugin vetoes and
  size limits still apply, also from a Pro compose tab.
- `sw.js` takes the share POST before the offline check and keeps the files
  for the page. Without a worker, `/protocol/share` passes text and links
  on and the page says the files are lost. `protocol` joins the app
  sections and the handler pages join the shell, so a mailto: launch
  offline no longer gets a network error.

Browsers without launchQueue or a service worker behave as before.
2026-11-03 05:26:01 +01:00
Linus Rath 03e7cd86f1 fix: print only the open message on Ctrl+P, without plugin panels or the app around it 2026-11-03 03:30:33 +01:00
Linus Rath d82f677b9b fix: stop the admin overview offering an older version as an update 2026-11-03 03:27:33 +01:00
Linus Rath 600bf4fcf3 fix: keep a typed extra label header when the classification page first renders 2026-11-03 02:36:00 +01:00
Linus Rath bf19f21eaf test: give the composing settings test the useLocale the proofreading section needs 2026-11-03 02:35:24 +01:00
Linus Rath e2bc222f49 fix: load the assistant's calendar and settings calls on first use so plugin views don't load the calendar store 2026-11-03 01:54:32 +01:00
Linus Rath 5b4e740ba3 Merge branch 'main' into feat/assistant-everywhere 2026-11-03 01:50:22 +01:00
Linus Rath ddbff7aeb7 Merge the assistant's Files (package D)
# Conflicts:
#	components/email/__tests__/composer-plugin-edit.test.tsx
#	lib/__tests__/plugin-projection.test.ts
2026-11-03 01:48:30 +01:00
Linus Rath 06764d0e0a test: give the composer plugin tests' settings mock the calendar sync bridge 2026-11-03 01:38:42 +01:00
Linus Rath cad10893e3 test: wait for the send confirmation to take focus before pressing Escape 2026-11-03 01:36:12 +01:00
Linus Rath e9e07ddb64 Merge main into feat/assistant-everywhere 2026-11-03 01:35:57 +01:00
Linus Rath 64aad7943f test: give the composer test's settings mock the calendar sync bridge the calendar store registers 2026-11-03 01:31:05 +01:00
Linus Rath d7cb895ebf Merge branch 'feat/assistant-everywhere' into feat/assistant-d
# Conflicts:
#	lib/__tests__/plugin-permission-coverage.test.ts
2026-11-03 01:19:42 +01:00
Linus Rath 55d9c81210 Merge more actions for the assistant (package C) 2026-11-03 01:13:47 +01:00
Linus Rath 6c3e68ce4e Merge branch 'feat/assistant-everywhere' into feat/assistant-d 2026-11-03 01:01:29 +01:00
Linus Rath d68970126e feat: tell plugins when the open message's attachments can't be read from this login 2026-11-03 00:33:59 +01:00
Linus Rath 9ce4d01807 fix: keep the reader still while the list changes, and give Pro tabs no list ticks 2026-11-03 00:30:56 +01:00
Linus Rath e716f529cd test: match template sync and server-state guard to current behaviour 2026-11-03 00:29:56 +01:00
Linus Rath 08bc05a20b Merge branch 'feat/assistant-everywhere' into feat/assistant-b 2026-11-03 00:24:50 +01:00
Linus Rath 267ca40522 Merge branch 'feat/assistant-everywhere' into feat/assistant-c 2026-11-03 00:24:12 +01:00
Linus Rath 12dc2ce3c8 feat: let plugins find, read, attach, save and create files in Files 2026-11-03 00:17:46 +01:00
Linus Rath 6edf7f80a5 fix: let plugins stop an attachment saved to Files, as they can stop an upload 2026-11-03 00:17:45 +01:00
Linus Rath 82dff8035c Merge pull request #1507 from Schrobo/fix/calendar-contact-group-attendees
fix: expand contact groups into calendar attendees
2026-11-03 00:02:05 +01:00
Linus Rath 363c797178 feat: let a plugin dialog fill the window's visible height, so a chat fits above a phone's keyboard 2026-11-02 23:59:57 +01:00
Linus Rath ad36f8d382 fix: show the side panel only where the plugin does, and keep it steady
- The button and the panel of Calendar, Contacts, Files and Settings
  show only when the plugin's shouldShow says yes, so a plugin switched
  off for these views (admin, user or no service) leaves no button that
  opens an empty panel, and no extra rows in Contacts and Settings.
- Files: while the details are open the panel steps aside there only;
  the other views keep it as the user left it. With both stored open the
  details fold when the page loads.
- Resizing stops where the view keeps its 480 px, so a drag or the arrow
  keys no longer fold the panel away (and the handle keeps the focus).
- Settings and Contacts render the same element with or without the
  panel, so a form keeps what was typed when the panel starts docking.
- Contacts on a phone: the panel button sits over an open contact too.
- The panel buttons of the reader and the views have one name, "Plugin
  panel", with aria-pressed, and name the plugin's panel shortcut in
  their title; the open panels are named landmarks.

The reader tests look the button up by its new name and pressed state
(viewer-toolbar-over-side-panel, reader-plugin-surfaces,
viewer-plugin-panel-width), since "Show/Hide plugin panel" is gone.
2026-11-02 23:54:53 +01:00
Linus Rath 8905d31b38 fix: show the admin's locks for plain text and the reply identity on the composing page 2026-11-02 23:14:21 +01:00
Linus Rath 7dd5fe41c3 refactor: answer invitations from one place the reader's banner and plugins share 2026-11-02 23:14:21 +01:00
Szymon Chroboczek a8106d9617 fix: expand contact groups into calendar attendees 2026-11-02 23:10:47 +01:00
Linus Rath 7ab900a0f7 fix: save an edited HTML event description as plain text and keep notes in its format 2026-11-02 22:52:04 +01:00
Linus Rath 798f0ca0c8 fix: show an HTML event description as text instead of its markup 2026-11-02 22:52:04 +01:00
Linus Rath c29a01a133 fix: add a cloud attachment link in the format the message has when the upload finishes 2026-11-02 22:52:04 +01:00
Linus Rath 2ae9e9c2f9 fix: turn quoted lines back into a quote when switching a reply to rich text 2026-11-02 22:52:04 +01:00
Linus Rath dfb946541f fix: keep quote markers, list markers and image alt text when switching a reply to plain text 2026-11-02 22:52:04 +01:00
Linus Rath 4bf676dec1 fix: keep the vacation reply's plain-text part in step with its HTML after a reload 2026-11-02 22:52:03 +01:00
Linus Rath 54c9c2f353 fix: stop the vacation page saving over and over after an HTML reply is saved 2026-11-02 22:52:03 +01:00
Linus Rath 708bc42414 fix: keep line breaks and quoted text when printing a plain-text email 2026-11-02 22:52:03 +01:00
Linus Rath 877aadbb06 fix: reopen drafts from the pro view in the format they were written in 2026-11-02 22:52:03 +01:00
Linus Rath 45a7f2ec6a fix: show an HTML-only signature in the identity list 2026-11-02 22:52:03 +01:00