Refractoring Stage 6.5 Migrated the snooze, attachment, and OpenPGP mail UI to the explicit mail feature API.

This commit is contained in:
2026-10-16 20:31:59 +03:00
parent f19573a337
commit 84a63441ef
14 changed files with 178 additions and 108 deletions
+6 -3
View File
@@ -104,6 +104,8 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- [x] Extract mail HTML sanitization and remote-image approval checks into a dedicated renderer API (`mail-content-security.js`).
- [x] Add an explicit mail feature API and migrate the account manager to it (`renderer-mail-api.js`, `account-ui.js`).
- [x] Migrate snooze UI state/sync access to the mail feature API (`snooze-ui.js`).
- [x] Migrate attachment UI state, selectors, and message hooks to the mail feature API (`attachments.js`).
- [x] Migrate OpenPGP mail UI reader/compose hooks to the mail feature API (`pgp-mail-ui.js`).
- [ ] Migrate remaining mail-related consumers and remove transitional global dependencies.
- Replace hidden globals and script-order dependencies with imports or passed dependencies.
- Keep root web assets canonical and generated copies out of hand-edited workflows.
@@ -130,7 +132,7 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- Electron Builder and the desktop Actions artifact name derive from `package.json`.
- Android `versionName` derives from the same package version. Its current `versionCode` mapping is `major * 10000 + minor * 100 + patch`; keep minor and patch below 100, and revise the mapping before reaching that boundary to avoid collisions.
- `scripts/build-all.ps1` uses the package version for APK naming. Before a release, bump once with `npm run bump:build`, verify the lockfile and computed Android version code, and build every target without another bump.
- Latest version check: `package.json` and both lockfile version fields are `0.4.16`; Android derives `versionName 0.4.16` and `versionCode 416`. `release/` contains Windows artifacts through `0.4.15`; the `0.4.16` artifact has not been built yet.
- Latest version check: `package.json` and both lockfile version fields are `0.4.17`; Android derives `versionName 0.4.17` and `versionCode 417`. The user reports that the current artifact builds and works; the checked-in `release/` directory contains Windows artifacts through `0.4.16`.
## Progress log
@@ -149,9 +151,10 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- Step 5 moved OpenPGP handler registration and message-source fetching into a feature module and added registration/schema coverage.
- Step 5 moved DAV handler registration into a feature module and added registration/schema coverage; the full suite passes 110 tests.
- Step 5 grouped mail/account handlers in `desktop/ipc/mail.cjs`; all 114 tests pass and the remaining app-version handler stays in the Electron shell.
- Added a build-version consistency check. Package/lockfile are now `0.4.16`, with Android build number `416`; the latest artifact observed is Windows `0.4.15`.
- Added a build-version consistency check. Package/lockfile are now `0.4.17`, with Android build number `417`; the latest artifact observed is Windows `0.4.16`.
- Step 5 grouped mail/account handlers and added a release-version consistency test; current package/lockfile/Android version alignment was checked and documented.
- Step 6 added `renderer-state.js`, extracted the mail HTML security API, and introduced `renderer-mail-api.js`; `account-ui.js` now uses that explicit API instead of several mail globals. Transitional aliases remain for other classic scripts.
- Step 6's renderer API slice passes 121 tests. The `0.4.16` artifact has not been built as part of this renderer change.
- Step 6's renderer API slice passes 121 tests. The `0.4.17` artifact has not been built as part of this renderer change.
- Step 6 also migrated snooze and attachment UI state/sync/reader integrations to the mail feature API; 121 tests pass. The latest built artifact observed is `0.4.16`.
- The current IPC/DAV validation changes pass the full suite: 108 tests.
- While work continued, `package.json` and `package-lock.json` reflected a version bump to `0.4.6`; those changes were preserved.