Refractoring Stage 6.3 Convert mail UI to explicit feature APIs and remove legacy global dependencies.

This commit is contained in:
2026-10-16 18:39:09 +03:00
parent c1961a4059
commit d14c1cfb07
16 changed files with 164 additions and 22 deletions
+6 -5
View File
@@ -102,7 +102,8 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- [x] Introduce a namespaced shared renderer-state module with transitional classic-script accessors (`renderer-state.js`).
- [x] Extract mail HTML sanitization and remote-image approval checks into a dedicated renderer API (`mail-content-security.js`).
- [ ] Convert mail UI to explicit feature APIs and remove legacy global dependencies.
- [x] Add an explicit mail feature API and migrate the account manager to it (`renderer-mail-api.js`, `account-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.
- Preserve CSP, HTML sanitization, and per-message remote-image approval behavior.
@@ -128,7 +129,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.14`; Android derives `versionName 0.4.14` and `versionCode 414`. `release/` currently contains Windows artifacts through `0.4.13`; no `0.4.14` artifact has been built yet.
- Latest version check: `package.json` and both lockfile version fields are `0.4.15`; Android derives `versionName 0.4.15` and `versionCode 415`. `release/` contains Windows artifacts through `0.4.14`; the `0.4.15` artifact has not been built yet.
## Progress log
@@ -147,9 +148,9 @@ 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. The user bumped to `0.4.14`; package and lockfile match, and Android's derived build number is `414`. The latest artifact observed is Windows `0.4.13`.
- Added a build-version consistency check. Package/lockfile are now `0.4.15`, with Android build number `415`; the latest artifact observed is Windows `0.4.14`.
- 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` as the namespaced owner of shared mail/view state and `mail-content-security.js` as a dedicated sanitizer/remote-image API. Transitional classic-script accessors remain; bootstrap order and desktop/Android/offline asset inclusion are tested.
- Step 6's first renderer slice passes 119 tests. The `0.4.14` artifact has not been built as part of this renderer change.
- 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 120 tests. The `0.4.15` artifact has not been built as part of this renderer change.
- 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.