Commit Graph
1342 Commits
Author SHA1 Message Date
Linus Rath e9e07ddb64 Merge main into feat/assistant-everywhere 2026-11-03 01:35:57 +01:00
Linus Rath 55d9c81210 Merge more actions for the assistant (package C) 2026-11-03 01:13:47 +01:00
Linus Rath 989cfc64a4 fix: offer a plugin the invitation and settings calls only once it was granted their permission 2026-11-03 00:55:50 +01:00
Linus Rath 37aaf05d6d fix: spend a plugin's undo token only once its undo went through, so a failed undo can be tried again 2026-11-03 00:51:30 +01:00
Linus Rath 169100eb12 fix: take the setting names app.getSettings gives, and check hidden, gated and restricted settings on undo too 2026-11-03 00:47:35 +01:00
Linus Rath 8add856aac fix: let plugins only switch off sender favicons and avatars in Junk
Both make the server fetch the sender's domain. The test that every
default value is allowed now also names senderFavicons (on by default,
which a plugin may no longer set); the rest of it is as it was.
2026-11-03 00:46:08 +01:00
Linus Rath d973e9062a fix: give a photo's date only from when it was taken, not when the file changed
exif.test.ts: the case "falls back to the file date" now expects no
date, since IFD0's DateTime is the file's change date, not the date
the photo was taken.
2026-11-03 00:45:56 +01:00
Linus Rath 22a783efe0 fix: check an invitation's sender also when it claims one of the user's own addresses 2026-11-03 00:43:16 +01:00
Linus Rath f7a7828bfa fix: check an image attachment's size before decoding it, and decode on older browsers
The host reads the size a PNG, GIF, JPEG, WebP or BMP declares in its
header first: over 50 megapixels it answers too_big, trackers and tiny
images are never decoded, a format whose header it can't read is
unsupported, and large images are decoded at the target width. A browser
that throws a TypeError on createImageBitmap's options decodes without
them.

The tests' stand-in pictures are now PNG headers instead of JSON (the
code reads the header), so image-shrink.test.ts and
plugin-host-attachment-image.test.ts build them that way, and the first
shrink test expects the resize options on createImageBitmap.
2026-11-03 00:42:53 +01:00
Linus Rath 6ef1397a53 fix: refuse to switch the out-of-office on for a plugin while it forwards mail or that can't be read 2026-11-03 00:42:30 +01:00
Linus Rath f8de35dd85 feat: let plugins count a conversation's messages, and read only the newest 50
api.email.getThread fetches only the newest 50 messages of a thread
(Thread/get, then Email/get for those ids) instead of all of them with
their bodies. api.email.getThreadCount answers the number of messages
from Thread/get, with its own rate limit.

plugin-host-thread.test.ts now expects getThreadEmails to be called with
{ newest: 50 }, the new option that limits what is fetched.
2026-11-03 00:38:07 +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 23c410ddea fix: ask the server whether a folder is shared before a plugin's move, filter or archive files mail there 2026-11-03 00:29:02 +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 0fb8f44cc4 test: expect the out-of-office's forward flag in vacation.get
vacation.get now also says whether the out-of-office forwards mail
(forwardActive, from the area c host APIs), so the test that pins the
whole answer names it too. The other fields are as they were.
2026-11-02 23:56:35 +01:00
Linus Rath a256beb918 fix: tell each plugin whether it may show the side panel
api.host.features.sidePanel now says whether this plugin may offer the
app-side-panel (ui:side-panel granted), not only that the webmail has
it. A plugin enabled before an update added the permission can then say
so instead of offering a switch that does nothing. The host computes the
assistant's flags per plugin for a frame's init and for each push.

plugin-host-features.test.ts: the host bridge assertions take the
assistant's flags as the test plugin sees them (it lacks ui:side-panel,
so sidePanel is false there).
2026-11-02 23:54:52 +01:00
Linus Rath d5c558d747 fix: undo the first filter rule again, which left its script active and in place 2026-11-02 23:49:14 +01:00
Linus Rath ecaad2b3d9 Merge branch 'feat/assistant-everywhere' into feat/assistant-f 2026-11-02 23:37:41 +01:00
Linus Rath 2bc9b0ccc6 test: check that attachment text is read only from accounts this login shows 2026-11-02 23:37:35 +01:00
Linus Rath 89df82adce fix: answer an invitation whose event lies outside the calendar's loaded weeks 2026-11-02 23:29:43 +01:00
Linus Rath d3d150d2c4 fix: let plugins answer invitations found by a search of the user's own mail 2026-11-02 23:20:54 +01:00
Linus Rath fd30fdcd27 feat: let plugins answer invitations, add filter rules, change many messages and change settings, with undo
The AI assistant's "more actions" need host calls today's plugin API
lacks. Area c of lib/plugin-sandbox/assistant adds them:

- `calendar.respond(emailId, status)`, new permission calendar:respond:
  answers an invitation of the user's own account through
  lib/calendar-rsvp.ts, like the reader's banner
- `calendar.deleteEvent` now returns an undo token for a single event;
  `calendar.undoDelete` creates it again from the host's copy
- `filters.list/create/undo` over Settings > Filters' model; forward,
  redirect, reject, discard and keep are refused, and so are folders
  that are shared or not the account's own
- `email.batch/undoBatch`: up to 200 messages through the store's
  batch functions, restore points first, one entry in the undo history
- `vacation.get` also says whether the out-of-office forwards mail
- `app.describeSettings`, `app.setSettings` and `app.undoSettings`, new
  permission settings:change, over the allow-list in
  lib/settings-schema.ts, refusing locked, hidden, restricted and gated
  settings when the change is made

Undo tokens stay in the host for 30 minutes, bound to the plugin and
the account. app.getSettings now shows every setting setSettings may
change. settings:write's text is reworded to what it gates (tags).
plugin-host-api-app-info gains a test; its other assertions are as
they were.
2026-11-02 23:14:23 +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
Linus Rath adb32aba3a fix: turn off a host flag the webmail stops naming 2026-11-02 23:03:49 +01:00
Linus Rath f6e0b760d5 fix: keep an HTML description's format when duplicating an event 2026-11-02 22:52:04 +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 8c1556117d fix: quote the text part in a rich reply when the html part is a bare wrapper without line breaks 2026-11-02 22:52:04 +01:00
Linus Rath f8d45d9497 fix: give plugins and plugin forwards the text of an HTML-only mail, not its markup 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 0d2fdc44f4 fix: keep angle brackets and ampersands in plain-text templates and placeholder values 2026-11-02 22:52:03 +01:00
Linus Rath 47820a8429 Merge branch 'feat/assistant-everywhere' into feat/assistant-b
# Conflicts:
#	lib/plugin-sandbox/runtime.tsx
2026-11-02 22:51:39 +01:00
Linus Rath f1980821f5 feat: let plugins page through mail search results 2026-11-02 22:13:59 +01:00
Linus Rath 8139214aea feat: tell the reader panel which messages are ticked in the list 2026-11-02 22:12:01 +01:00
Linus Rath 398ee1ef06 feat: let plugins read a whole conversation 2026-11-02 22:07:32 +01:00
Linus Rath 2de7821e35 feat: let plugins see a message's pictures, shrunk in the app 2026-11-02 22:04:52 +01:00
Linus Rath 8fcd647215 feat: let plugins show a side panel next to Calendar, Contacts, Files and Settings 2026-11-02 21:59:36 +01:00
Linus Rath dda31538af fix: hand the assistant's host flags to plugins in api.host.features
The sandbox runtime copied only the three policy flags from the host's
features, so a flag an assistant area adds (sidePanel, files, ...) never
reached api.host.features and the plugin hid the feature. The runtime
now copies every other flag the host names as true or false.

The host bridge assertions compare against withAssistant(...) like the
snapshot ones already did, because the init payload and host-change
carry the assistant's flags on top of the three policy flags.
2026-11-02 21:59:35 +01:00
Linus Rath bda658bada feat: tell plugins the Content-ID and alt text of a message's inline images
EmailReadView.attachments gain cid and alt for images the HTML shows
inline. plugin-projection.test.ts now expects the cid on its inline
logo, since the view carries it.
2026-11-02 21:58:16 +01:00
Linus Rath bda99e1df8 feat: let plugins read the text of attachments
api.email.getAttachmentText reads PDF (pdf.js), Word, Excel, PowerPoint
and OpenDocument files (own reader over fflate and DOMParser, unpacking
capped at 50 MB), text, CSV, HTML, calendar and address files, and
answers with a status for what it can't read. The extraction lives in
lib/attachment-text so Files can use it too.

The sandbox runtime now copies every flag the host sends into
api.host.features; before, it kept only the three core flags, so the
assistant's flags never reached a plugin. The host bridge assertions in
plugin-host-features.test.ts compare against the core flags plus the
assistant's (withAssistant), since the init payload and host-change now
carry attachmentText too.
2026-11-02 21:53:05 +01:00
Linus Rath 72117c8a71 Merge branch 'main' into feat/proofreading
# Conflicts:
#	components/admin/admin-shell.tsx
2026-11-02 21:27:17 +01:00
Linus Rath f7ff8212a3 refactor: give the AI assistant's host APIs one set of files per area
The assistant's new host calls come in four areas (context, actions,
Files, the panel in every view), built side by side. Each area gets its
own files under lib/plugin-sandbox/assistant for its permissions, method
table, dispatcher, host feature flags and sandbox methods; the shared
files only read the merged result. No area adds anything yet. The host
features test now compares against the core flags plus the areas' flags.
2026-11-02 21:21:06 +01:00
Linus Rath d5a362b43e feat: let plugins ask for permissions an older webmail doesn't know 2026-11-02 21:15:56 +01:00
Linus Rath f0477bc4fd fix: keep the composer's proofreading off the plugin store, and safe with a stand-in editor #1397 2026-11-02 21:08:35 +01:00
Linus Rath 42d1143df1 fix: mark the plugin proxy's no-third-party refusal as the proxy's own error 2026-11-02 20:57:56 +01:00
Linus Rath 8778c74d3a fix: stop plugins widening right-to-left pages with their hidden frame 2026-11-02 20:56:37 +01:00
Linus Rath ac375c4d3d fix: log a proofreading check that fails, with an opt-in debug log for checker authors #1397 2026-11-02 20:46:06 +01:00
Linus Rath 6055dac1cb fix: keep proofreading text from plugins that shouldn't get it, and work it by keyboard #1397
A security and an accessibility review of the proofreading hook found
gaps, fixed here.

What leaves the browser:
- A checker gets a name for each composer of its own, not the composer's
  id, so it can't reach the message through the other api.composer calls
  after proofreading stops.
- Checking pauses while a plugin that can sign or encrypt is turned on but
  still starting, and while the policy couldn't be fetched (the built-in
  defaults could undo an admin's lock).
- No plugin can hold up turning proofreading off (onBeforeSettingChange).
- Suggestions can't carry zero-width, bidi or line-separator characters;
  messages lose bidi overrides; a flood of annotations is cut off early.
- The notices name the plugin as installed, not a label it chose, and say
  that text written before signing or encryption was turned on may
  already have been checked.
- A checker registered during start-up no longer fails its first check.

Keyboard and screen readers:
- Escape in the issue panel closes the panel, not the message.
- Underlines carry aria-invalid, as the browser's own markers do.
- The focus goes somewhere sensible when a button or an issue goes away,
  Tab past the popup's edges goes back to the text, and the shortcuts work
  in the popup and the panel.
- Ctrl+' and Ctrl+; follow the character typed, so other layouts keep
  their own keys (Ctrl+S on Dvorak), with Ä and Ö on German keyboards.
- The popup is described by its message, sits inside a modal composer,
  fits narrow screens, and the panel fits a phone.
2026-11-02 20:26:21 +01:00
Linus Rath ceffe745b3 Merge pull request #1498 from HOLOEYE-JZ/feat/plugin-calendar-task-view 2026-11-02 20:24:23 +01:00