domma-cms 1.61.0 → 1.61.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CLAUDE.md +1 -1
  3. package/docs/DommaFeatures.md +3 -1
  4. package/docs/cache.md +24 -0
  5. package/docs/configuration.md +1 -1
  6. package/package.json +1 -1
  7. package/plugins/_lib/admin/mail/body-menu.js +1 -1
  8. package/plugins/_lib/admin/mail/cms-host.js +1 -1
  9. package/plugins/_lib/admin/mail/compose-window.js +1 -1
  10. package/plugins/_lib/admin/mail/contacts.js +1 -1
  11. package/plugins/_lib/admin/mail/diagnostics-section.js +1 -1
  12. package/plugins/_lib/admin/mail/drag-drop.js +1 -1
  13. package/plugins/_lib/admin/mail/folder-tree.js +1 -1
  14. package/plugins/_lib/admin/mail/font-controls.js +1 -1
  15. package/plugins/_lib/admin/mail/fonts.js +1 -1
  16. package/plugins/_lib/admin/mail/host-context.js +1 -1
  17. package/plugins/_lib/admin/mail/identity.js +1 -1
  18. package/plugins/_lib/admin/mail/image-senders-section.js +1 -1
  19. package/plugins/_lib/admin/mail/keyboard.js +1 -1
  20. package/plugins/_lib/admin/mail/mail.html +1 -1
  21. package/plugins/_lib/admin/mail/message-actions.js +1 -1
  22. package/plugins/_lib/admin/mail/oauth-panel.js +1 -1
  23. package/plugins/_lib/admin/mail/panes.js +1 -1
  24. package/plugins/_lib/admin/mail/reader-kit.js +1 -1
  25. package/plugins/_lib/admin/mail/reader-runtime.js +27 -1
  26. package/plugins/_lib/admin/mail/reader-view.js +1 -1
  27. package/plugins/_lib/admin/mail/resizable.js +1 -1
  28. package/plugins/_lib/admin/mail/restore-spam.js +1 -1
  29. package/plugins/_lib/admin/mail/rules.js +1 -1
  30. package/plugins/_lib/admin/mail/scheduling.js +1 -1
  31. package/plugins/_lib/admin/mail/section-kit.js +1 -1
  32. package/plugins/_lib/admin/mail/security-note.js +1 -1
  33. package/plugins/_lib/admin/mail/settings-section.js +1 -1
  34. package/plugins/_lib/admin/mail/templates.js +1 -1
  35. package/plugins/_lib/admin/mail/threads.js +1 -1
  36. package/plugins/_lib/admin/mail/vacation.js +1 -1
  37. package/plugins/_lib/admin/mail/when-closed.js +1 -1
  38. package/plugins/_lib/admin/ui/dates.js +1 -1
  39. package/plugins/_lib/admin/ui/resizable.js +1 -1
  40. package/plugins/_lib/domma-mail.lock.json +80 -80
  41. package/plugins/_lib/mail/accountFileStore.js +1 -1
  42. package/plugins/_lib/mail/accountRepository.js +1 -1
  43. package/plugins/_lib/mail/accountRoutes.js +1 -1
  44. package/plugins/_lib/mail/bodyTokenProvider.js +1 -1
  45. package/plugins/_lib/mail/bodyTokens.js +1 -1
  46. package/plugins/_lib/mail/compose.js +1 -1
  47. package/plugins/_lib/mail/defaults.js +1 -1
  48. package/plugins/_lib/mail/envelope.js +1 -1
  49. package/plugins/_lib/mail/folderActions.js +1 -1
  50. package/plugins/_lib/mail/folderRuntime.js +1 -1
  51. package/plugins/_lib/mail/folders.js +1 -1
  52. package/plugins/_lib/mail/imapPoolRuntime.js +1 -1
  53. package/plugins/_lib/mail/mbox.js +1 -1
  54. package/plugins/_lib/mail/message-action.js +1 -1
  55. package/plugins/_lib/mail/messageSecurity.js +1 -1
  56. package/plugins/_lib/mail/messageSecurityProvider.js +1 -1
  57. package/plugins/_lib/mail/networkAddresses.js +1 -1
  58. package/plugins/_lib/mail/networkPolicy.js +1 -1
  59. package/plugins/_lib/mail/oauthAccounts.js +1 -1
  60. package/plugins/_lib/mail/oauthRouteRuntime.js +1 -1
  61. package/plugins/_lib/mail/oauthRuntime.js +1 -1
  62. package/plugins/_lib/mail/pollSchedule.js +1 -1
  63. package/plugins/_lib/mail/poller.js +1 -1
  64. package/plugins/_lib/mail/pollerRuntime.js +1 -1
  65. package/plugins/_lib/mail/priority.js +1 -1
  66. package/plugins/_lib/mail/publicMailbox.js +1 -1
  67. package/plugins/_lib/mail/readRuntime.js +1 -1
  68. package/plugins/_lib/mail/render.js +1 -1
  69. package/plugins/_lib/mail/ruleRunner.js +1 -1
  70. package/plugins/_lib/mail/schedulerRuntime.js +1 -1
  71. package/plugins/_lib/mail/secretProvider.js +1 -1
  72. package/plugins/_lib/mail/secretbox.js +1 -1
  73. package/plugins/_lib/mail/senderAuth.js +1 -1
  74. package/plugins/_lib/mail/sieve.js +1 -1
  75. package/plugins/_lib/mail/smtpService.js +1 -1
  76. package/plugins/_lib/mail/snoozeRuntime.js +1 -1
  77. package/plugins/_lib/mail/store.js +1 -1
  78. package/plugins/_lib/mail/subscriptions.js +1 -1
  79. package/plugins/_lib/mail/syncPlan.js +1 -1
  80. package/plugins/_lib/mail/syncRuntime.js +1 -1
  81. package/plugins/_lib/mail/syncSelection.js +1 -1
  82. package/plugins/_lib/mail/unreadBadge.js +1 -1
  83. package/plugins/_lib/mail/unsubscribe.js +1 -1
  84. package/plugins/_lib/mail/vacationRuntime.js +1 -1
  85. package/plugins/_lib/mail/write.js +1 -1
  86. package/plugins/docs/CHANGELOG.md +5 -0
  87. package/plugins/docs/CLAUDE.md +30 -0
  88. package/plugins/docs/admin/views/docs.js +2 -1
  89. package/plugins/docs/admin/views/editor.js +5 -3
  90. package/plugins/docs/docs/guide.md +11 -0
  91. package/plugins/docs/lib/store.js +46 -2
  92. package/plugins/docs/plugin.js +70 -28
  93. package/plugins/docs/plugin.json +14 -1
  94. package/plugins/docs/tests/restricted.test.js +240 -0
  95. package/plugins/free-tier.lock.json +15 -13
  96. package/plugins/mail-reader/CLAUDE.md +6 -0
  97. package/plugins/mail-reader/plugin.js +9 -0
  98. package/plugins/mail-reader/plugin.json +1 -1
  99. package/public/js/effects.js +1 -1
  100. package/public/js/site.js +1 -1
  101. package/server/config.js +37 -0
  102. package/server/routes/api/chats.js +3 -1
  103. package/server/routes/api/components.js +2 -1
  104. package/server/routes/api/content-api.js +1 -1
  105. package/server/routes/api/content-public.js +2 -2
  106. package/server/routes/api/content-writes.js +1 -1
  107. package/server/routes/api/effects.js +4 -9
  108. package/server/routes/api/layouts.js +1 -1
  109. package/server/routes/api/pages.js +6 -5
  110. package/server/routes/api/search.js +3 -3
  111. package/server/routes/api/sidebar-counts.js +2 -0
  112. package/server/routes/api/theme.js +2 -1
  113. package/server/routes/api/views.js +2 -1
  114. package/server/routes/public.js +4 -4
  115. package/server/server.js +12 -6
  116. package/server/services/cache/adminChange.js +28 -0
  117. package/server/services/content.js +73 -10
  118. package/server/services/effectsSettings.js +25 -0
  119. package/server/services/health.js +2 -2
  120. package/server/services/htmlResponse.js +33 -4
  121. package/server/services/listTags.js +1 -1
  122. package/server/services/markdown.js +56 -22
  123. package/server/services/pluginGuides.js +2 -2
  124. package/server/services/plugins.js +25 -2
  125. package/server/services/projects.js +39 -4
  126. package/server/services/publicAssets.js +488 -0
  127. package/server/services/renderer.js +10 -8
  128. package/server/services/seo/index.js +3 -3
  129. package/server/services/sitemap.js +1 -1
  130. package/server/services/versions.js +2 -2
  131. package/server/services/wpImport/index.js +2 -2
  132. package/server/templates/page.html +3 -2
package/CHANGELOG.md CHANGED
@@ -1,9 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.61.2] - 2026-11-11
4
+
5
+ - Mail: a mirrored folder catches up when it is opened, so its list matches the folder's unread count (Domma Mail core 0.24.3).
6
+ - Mail Reader 1.2.9: reading mail no longer empties the page cache. Docs 2.15.0 (restricted Docs for outside accounts) is now the bundled copy.
7
+
8
+ ## [1.61.1] - 2026-11-11
9
+
10
+ ### Changed
11
+
12
+ - **Faster pages for returning visitors.** A page's stylesheets and scripts are now cached by the browser for good and renamed automatically when they change, so going from one page to the next no longer asks the server about each of them again. On the Domma CMS site a repeat page view went from 58 requests to 10. Nothing to set up: a rendered page's local `.css` and `.js` links carry `_pv=<hash>`, and its modules are covered by an import map. See docs/cache.md, "Fingerprinted assets".
13
+ - **Custom CSS is a file, not part of every page.** Past 4 KB, `content/custom.css` is linked as `/content/custom.css` instead of being written into each page (previews keep it inline). On a site with a large stylesheet this took a page from 244 KB to 70 KB and cut the memory the page cache uses by about two thirds.
14
+ - **Lists, search and the sitemap no longer render every page.** The Pages list, its badge and tags, the Layouts, Search and Content API badges, the sitemap, the Content API's page list and search, and the public site search each parsed every page in full - about two seconds on a 237-page site, during which the site answered nothing else. They now read the front matter only (about 20 ms). Plugins: `listPages({render: false})` returns front matter, `urlPath`, `content` and `resolvedProject` without rendering.
15
+ - A page served from the cache costs about half the server time it did: it is no longer hashed, and `site.json` and the projects list are no longer read, on every request.
16
+ - Scroll-reveal settings are written into the page, so effects start without waiting on a request.
17
+
18
+ ### Fixed
19
+
20
+ - **The page cache survives an open admin.** The chat availability check-in (every 30 seconds), the side menu's badge refresh (every minute) and the editor's live previews (as you type) are POSTs, and each counted as a change that emptied the whole cache - so while anyone was signed in, almost no page was served from it. A route can now say it changes nothing a page shows (`config: {keepsCache: true}`, see docs/cache.md).
21
+ - Memory no longer grows with every editor preview and page save (the front matter parser kept every string it was given).
22
+ - `menu-float.js` was fetched and run twice on every page.
23
+
3
24
  ## [1.61.0] - 2026-11-11
4
25
 
5
26
  ### Changed
6
27
 
28
+
7
29
  - **AI chat answers see up to 48,000 characters of Knowledge** (was 16,000), so a full Knowledge base of around 80 entries reaches AI Assist instead of only the most used third. Needs the matching Manager change; until then the Manager trims at 24,000.
8
30
  - **AI Assist lives under Data.** Its side-menu entry now starts in the Data folder (it was Tools > Communication); a place an admin chose for it still wins.
9
31
  - **Builders in AI Assist.** A new **Builders** tab lists the AI chats of the site's builders - the Site Builder's conversations and the Tool Builder's builds - with who started each and when; click one to carry on in its builder. Each person sees only the builders, and the chats, they could open in the builder itself. Builders opt in with plugin.json `admin.aiAssist` (see docs/plugin-development.md, "AI Assist: listing your AI chats"); only the plugin's own screen and API are accepted.
package/CLAUDE.md CHANGED
@@ -560,7 +560,7 @@ standing trap as `buildThemeView()`. Every key in that object reaches the page s
560
560
  `normaliseSearchSettings()` whitelists rather than merges. `enabled: false` emits nothing at all.
561
561
 
562
562
  `window.DommaSiteSearch.open()` keeps its old name on purpose: context menus and site scripts already call it.
563
- There is no index - each query scans `listPages()` - and drafts and private pages never reach a result.
563
+ There is no index - each query scans `listPages({render: false})` (front matter and source, nothing rendered) - and drafts and private pages never reach a result.
564
564
 
565
565
  `server/services/search-migration.js` runs once at startup to lift an existing site off the old plugin: settings out
566
566
  of plugins.json, the plugins.json entry gone, and `plugins/site-search/` deleted (only if it is the bundled one -
@@ -360,7 +360,7 @@ Fast, file-based and friendly.
360
360
  - Since: built in 0.67.0 (was a plugin)
361
361
  - **Custom themes hook** - plugins (the Theme Roller) register themes via `hooks.registerThemes()`: a base theme plus changed tokens, usable everywhere a theme is chosen; the base is remembered so the site keeps working if the plugin goes away.
362
362
  - Since: 0.73.0
363
- - **Site custom CSS** - one stylesheet, `content/custom.css`, inlined last on every public page so it always wins.
363
+ - **Site custom CSS** - one stylesheet, `content/custom.css`, loaded last on every public page so it always wins: inline up to 4 KB, linked as `/content/custom.css` (fingerprinted, cached for good) beyond that; inline in previews.
364
364
  - Where: **System > Site Settings > Custom CSS**, or the page editor's CSS pane
365
365
 
366
366
  ### Site menus (authoring view)
@@ -453,6 +453,8 @@ headings (Layouts → Page contents settings, and `[contents]` per page).
453
453
  - Where: `server/services/renderer.js`, `server/templates/page.html`
454
454
  - **Response cache** - fully rendered pages are cached per URL, file modification time, set of viewer roles and origin, and invalidated by tags when pages, collections, forms, blocks, views, menus, context menus or settings change; concurrent cold requests render once. In-process memory driver, toggle and flush from the admin. Drafts and previews are never cached; responses are `private, no-cache` so shared proxies never mix roles.
455
455
  - Where: **System > Site Settings > Cache** (key viewer, on/off, clear); dashboard widget; `config/cache.json`; `/api/cache/*`; `docs/cache.md`
456
+ - **Fingerprinted assets** - a rendered page's local stylesheets and classic scripts carry `_pv=<hash of the file>` and are served `immutable` while the hash matches; modules are covered by an import map (their tags are not rewritten, so each stays one instance). A changed file gets a new URL on the next page drawn; an old fingerprint gets the current file with `max-age=0`. Images are left alone.
457
+ - Where: `server/services/publicAssets.js`; `docs/cache.md`
456
458
  - Since: file-change self-invalidation 0.36.12
457
459
 
458
460
  ---
package/docs/cache.md CHANGED
@@ -60,6 +60,10 @@ Tag-based. When an admin saves a page, only entries tagged `page:<that-url>` are
60
60
 
61
61
  The markdown pipeline auto-attaches the appropriate shortcode tags as it processes a page - embedding `[collection slug="faq"]` causes the rendered page to be tagged `collection:faq`, so a FAQ entry edit transparently busts every page that displays the FAQ. There is no central embed-map to maintain.
62
62
 
63
+ ### The admin-change safety net
64
+
65
+ Besides the tags above, every successful signed-in POST, PUT, PATCH or DELETE clears the whole cache (server.js), so a missed invalidation cannot serve stale pages. A route whose effect is on no page opts out with `config: {keepsCache: true}` (`services/cache/adminChange.js`) - the chat availability check-in, the sidebar's badge counts, the editor previews and the theme, component and view previews do: they are POSTs that only read, some sent by every open admin every 30-60 seconds. Use it only for such routes; when in doubt, leave it off.
66
+
63
67
  ## Manual flush, inspection, and on/off
64
68
 
65
69
  | Endpoint | Behaviour |
@@ -98,6 +102,26 @@ Before the response cache is asked, the route decides whether the viewer may see
98
102
 
99
103
  `services/assetCache.js`: an `onSend` hook added before @fastify/compress's. When @fastify/static has answered a GET with a 200 for a compressible type (its stream carries the file's path), the hook swaps the stream for a buffer kept in memory - the bytes as sent, per encoding (`br`, `gzip`, `identity`), keyed on the path and checked against the file's mtime and size on every request. @fastify/static still resolves the path, sets the type, cache-control, ETag and Last-Modified and answers 304s, HEADs and 404s. Files under 1 KB or over 2 MB, Range requests and non-text types are left to stream. Bounded at 64 MB (LRU by bytes); on while the response cache is on; emptied on a clear or re-init. `GET /api/cache/status` reports it as `assets`.
100
104
 
105
+ ## Fingerprinted assets
106
+
107
+ `services/publicAssets.js`. @fastify/static serves every file `public, max-age=0`, so a browser revalidated every stylesheet and script on every page view. `fingerprintHtml()` is the last step of both render paths:
108
+
109
+ - a local `<link rel="stylesheet">` or classic `<script src>` (under `public/`, Domma's dist or a plugin's `public/`) gains `_pv=<first 16 hex of the file's sha256>`;
110
+ - a module is identified by its URL, so a `<script type="module">` tag is rewritten only when nothing imports that URL. The page gets a `<script type="importmap">` before its first script, mapping every module its scripts import (followed through the files, however deep) from the URL it is imported by to that URL with `_pv`. A module that is both linked and imported keeps its URL in the tag and is left out of the map, so it stays one instance in every browser. A page with its own import map, or a module script from another origin, gets none;
111
+ - a request whose `_pv` matches the file as it is now is answered `Cache-Control: public, max-age=31536000, immutable`. Any other `_pv` (a cached page or an open tab from before the file changed) gets the current file with `max-age=0` - never a 404.
112
+
113
+ Images are not fingerprinted: scripts draw them from data by the plain URL, and one picture under two URLs downloads twice.
114
+
115
+ `content/custom.css` over 4 KB is linked as `/content/custom.css` (served by the same module, compressed once per encoding) instead of being inlined; previews keep it inline, and so does a stylesheet with a relative `url()` or `@import`, which would resolve differently as a file. The hand-written `?v=` tokens stay as they are - `tests/services/asset-cache-busting.test.js` still applies.
116
+
117
+ ## Listings and the per-request memos
118
+
119
+ - `listPages({render: false})` reads front matter and source only, kept per file against mtime and size. Lists, badges, search and the sitemap use it. `listPages()` still renders, through the parsed-page memo while the cache is on.
120
+ - `listProjects()` is kept while the cache is on (30 s at most) and dropped on any invalidation, so switching a project off is immediate.
121
+ - Plugin head/body snippets are kept for 10 s while the cache is on.
122
+ - `readConfig(name)` (config.js) is `getConfig()` for per-request read-only use: one stat, the parsed file reused until it changes, frozen.
123
+ - A cached page's ETag hash is kept beside the cached string and reused only for that very string.
124
+
101
125
  ## Thundering-herd safety
102
126
 
103
127
  If three concurrent requests hit a cold key, the producer runs exactly once - the other two await the first's result via an in-flight promise map. This matters for popular pages on cache cold-start: without coalescing, N parallel requests trigger N parallel renders, each writing the same value back to the cache.
@@ -508,7 +508,7 @@ every public page as `window.__CMS_SEARCH__`, so nothing private belongs in it.
508
508
 
509
509
  ### What gets searched
510
510
 
511
- `listPages()` on every query - there is no index, so cost is linear in the number of pages. Drafts and pages with
511
+ `listPages({render: false})` on every query - there is no index, so cost is linear in the number of pages, but only front matter and source are read (kept per file until it changes), never a rendered page. Drafts and pages with
512
512
  `visibility: private` are skipped. Scoring is weighted by field (title, then tags, then description, then body); the
513
513
  body is reduced to plain prose first (`stripMarkdown` in `server/services/search.js`), which drops fenced code,
514
514
  `<pre>`/`<code>`, shortcode tags and `[dconfig]` while keeping readable shortcode attributes such as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.61.0",
3
+ "version": "1.61.2",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/body-menu.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/body-menu.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The reading pane's right-click menu - the pure parts.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/cms-host.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/cms-host.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** The CMS shell boundary. Standalone never imports this adapter. */
4
4
  const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/compose-window.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/compose-window.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/contacts.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/contacts.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Recipient suggestions from the host address book.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/diagnostics-section.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/diagnostics-section.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The settings section that answers "which build is this, and what went wrong".
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/drag-drop.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/drag-drop.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Drag identities include the mailbox and source folder: UIDs alone are not unique. */
4
4
  const PROTECTED_USES = new Set(['\\Inbox', '\\Sent', '\\Drafts', '\\Trash', '\\Junk', '\\Archive', '\\All', '\\Flagged']);
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/folder-tree.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/folder-tree.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Mail folder presentation, shared by the Mail Reader and Email Pro.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/font-controls.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/font-controls.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/fonts.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/fonts.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The fonts and sizes the mail editor offers - pure, so both the compose
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/host-context.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/host-context.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Services supplied by the application that hosts the shared mail interface. */
4
4
  export function createMailApi({getToken, fetch: request = globalThis.fetch, onUnauthorized = () => {}}) {
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/identity.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/identity.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Who a mailbox sends as, and what it signs off with.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/image-senders-section.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/image-senders-section.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The settings section for senders whose images always load.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/keyboard.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/keyboard.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Keyboard navigation for the reader.
@@ -1,4 +1,4 @@
1
- <!-- Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/mail.html. -->
1
+ <!-- Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/mail.html. -->
2
2
  <div class="mail-layout">
3
3
 
4
4
  <!-- Folders -->
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/message-actions.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/message-actions.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * What other Tools add to a message's menu - Booking's "Book Sam...".
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/oauth-panel.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/oauth-panel.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * "Sign in with Microsoft / Google" for a mailbox - the part of the mailbox
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/panes.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/panes.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Pane sizing for the mail reader, shared by the Mail Reader and Email Pro.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-kit.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/reader-kit.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The reader view's decisions that need no DOM - escaping, the mailbox form's
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-runtime.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/reader-runtime.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  const {createMailHost} = await import(new URL(`./host-context.js?v=${MAIL_MODULE_VERSION}`, import.meta.url).href);
@@ -29,6 +29,8 @@ const ASSET_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
29
29
  const versioned = name => new URL(`./${name}?v=${ASSET_VERSION}`, import.meta.url).href;
30
30
  /** How long a dragged message is held over a closed folder before it opens. */
31
31
  const SPRING_OPEN_MS = 700;
32
+ /** How often opening a mirrored list may ask the server to catch the mirror up. */
33
+ const CATCH_UP_INTERVAL_MS = 60_000;
32
34
 
33
35
  const {
34
36
  buildFolderTree,
@@ -439,6 +441,8 @@ return {
439
441
  let openFolder = null;
440
442
  /** Where the last message list came from: the mirror, or the server. */
441
443
  let lastListSource = null;
444
+ /** When each mailbox last caught its mirror up on open, by account id. */
445
+ const caughtUpAt = new Map();
442
446
  /** Server-side limits, fetched once so the UI can enforce them early. */
443
447
  let limits = {maxAttachmentBytes: 20_000_000};
444
448
  let mirrorAvailable = false;
@@ -2360,6 +2364,7 @@ return {
2360
2364
  limit = result.limit;
2361
2365
  renderList();
2362
2366
  renderPager();
2367
+ if (!fresh && !quiet) catchUpMirror();
2363
2368
  } catch (err) {
2364
2369
  listFailed(err, seq, quiet);
2365
2370
  }
@@ -2416,11 +2421,32 @@ return {
2416
2421
 
2417
2422
  renderList();
2418
2423
  renderPager();
2424
+ if (!fresh && !quiet) catchUpMirror();
2419
2425
  } catch (err) {
2420
2426
  listFailed(err, seq, quiet);
2421
2427
  }
2422
2428
  }
2423
2429
 
2430
+ /**
2431
+ * A list just opened from the mirror: bring the mirror up to date.
2432
+ *
2433
+ * The folder pills are the server's own STATUS counts, read live with
2434
+ * the folder listing, but a mirrored folder's list is whatever the
2435
+ * last poll stored - up to a poll interval old. Opening the screen
2436
+ * between polls showed a pill counting mail the list did not hold.
2437
+ * One background refresh (sync, then a fresh list) per mailbox a
2438
+ * minute settles it without syncing on every folder click.
2439
+ *
2440
+ * @returns {void}
2441
+ */
2442
+ function catchUpMirror() {
2443
+ if (lastListSource === 'imap' || !currentAccountId) return;
2444
+ const last = caughtUpAt.get(currentAccountId) ?? 0;
2445
+ if (Date.now() - last < CATCH_UP_INTERVAL_MS) return;
2446
+ caughtUpAt.set(currentAccountId, Date.now());
2447
+ refreshMailbox();
2448
+ }
2449
+
2424
2450
  /**
2425
2451
  * Conversations as a list of rows.
2426
2452
  *
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/reader-view.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/reader-view.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Existing CMS entry point for the shared mail view. */
4
4
  const version = new URL(import.meta.url).searchParams.get('v') ?? '1';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/resizable.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/resizable.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The mail reader's resizable slideovers.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/restore-spam.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/restore-spam.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Undo restores both junk status and the original folder, following each UID remap. */
4
4
  export async function restoreSpam({api, base, account, from, destination, uids, spam}) {
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/rules.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/rules.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Filing rules.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/scheduling.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/scheduling.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/section-kit.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/section-kit.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/security-note.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/security-note.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * What the reader says about a signed or encrypted (S/MIME) message.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/settings-section.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/settings-section.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /** Browser preferences for the shared mail reader. */
4
4
  export const READ_DELAY_KEY = 'domma-mail.mark-read-seconds';
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/templates.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/templates.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  const MAIL_MODULE_VERSION = new URL(import.meta.url).searchParams.get('v') ?? '1';
4
4
  /**
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/threads.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/threads.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Grouping messages into conversations.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/vacation.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/vacation.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * The automatic reply, and everything that must stop it.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/mail/when-closed.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/mail/when-closed.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Run code when a Domma modal or slideover actually closes.
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/ui/dates.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/ui/dates.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Dates as a plugin shows them to a person: dd/mm/yyyy, and dd/mm/yyyy HH:mm
@@ -1,4 +1,4 @@
1
- // Source: @domma-mail/core 0.24.2, packages/core/src/admin/ui/resizable.js.
1
+ // Source: @domma-mail/core 0.24.3, packages/core/src/admin/ui/resizable.js.
2
2
  // Update with domma-mail/scripts/sync-cms.mjs; edit the shared source.
3
3
  /**
4
4
  * Making a slideover resizable.