Refractoring Stage 6.16 Scoped mail-ui.js behind its existing window.epMailFeatures.mail API, removing its implementation functions and state from the shared global scope. Bumped the version to 0.4.28 (Android version code 428) and updated REFACTOR_PLAN.md.

This commit is contained in:
2026-10-16 22:37:25 +03:00
parent 0f2014213e
commit 4b252c774c
6 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -116,6 +116,7 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- [x] Encapsulate productivity implementation state and helpers in a local module scope, preserving the explicit productivity feature API (`productivity.js`). - [x] Encapsulate productivity implementation state and helpers in a local module scope, preserving the explicit productivity feature API (`productivity.js`).
- [x] Encapsulate DAV helpers in a local module scope while preserving `window.epMailFeatures.dav` (`dav-ui.js`). - [x] Encapsulate DAV helpers in a local module scope while preserving `window.epMailFeatures.dav` (`dav-ui.js`).
- [x] Encapsulate core renderer implementation behind `window.epMailShell` (`app.js`). - [x] Encapsulate core renderer implementation behind `window.epMailShell` (`app.js`).
- [x] Encapsulate mail UI implementation behind `window.epMailFeatures.mail` (`mail-ui.js`).
- [x] Migrate additional mail-related consumers to unique local aliases to avoid classic-script lexical redeclarations. - [x] Migrate additional mail-related consumers to unique local aliases to avoid classic-script lexical redeclarations.
- [x] Add a combined-script parse test to prevent duplicate top-level lexical declarations from stopping later UI scripts. - [x] Add a combined-script parse test to prevent duplicate top-level lexical declarations from stopping later UI scripts.
- [ ] Migrate remaining mail-related consumers and remove transitional global dependencies. - [ ] Migrate remaining mail-related consumers and remove transitional global dependencies.
@@ -144,7 +145,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`. - 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. - 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. - `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.27`; Android derives `versionName 0.4.27` and `versionCode 427`. The user confirms the previous artifact works; this bump is for the next build. - Latest version check: `package.json` and both lockfile version fields are `0.4.28`; Android derives `versionName 0.4.28` and `versionCode 428`. The user confirms the previous artifact works; this bump is for the next build.
## Progress log ## Progress log
@@ -174,5 +175,6 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- Step 6 at version `0.4.25` wraps productivity internals in a local scope; Calendar, Contacts, labels, and profile behavior remain published through the productivity feature API. - Step 6 at version `0.4.25` wraps productivity internals in a local scope; Calendar, Contacts, labels, and profile behavior remain published through the productivity feature API.
- Step 6 at version `0.4.26` wraps DAV UI internals in a local scope while preserving the public DAV feature API. - Step 6 at version `0.4.26` wraps DAV UI internals in a local scope while preserving the public DAV feature API.
- Step 6 at version `0.4.27` scopes core renderer functions and state in `app.js`; other scripts continue through the explicit `epMailShell` interface. - Step 6 at version `0.4.27` scopes core renderer functions and state in `app.js`; other scripts continue through the explicit `epMailShell` interface.
- Step 6 at version `0.4.28` scopes mail UI implementation details while retaining its explicit mail feature API.
- The current IPC/DAV validation changes pass the full suite: 108 tests. - 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. - While work continued, `package.json` and `package-lock.json` reflected a version bump to `0.4.6`; those changes were preserved.
+2
View File
@@ -1,3 +1,4 @@
(() => {
const rendererState = window.epMailState; const rendererState = window.epMailState;
const appShell = window.epMailShell; const appShell = window.epMailShell;
const selectMailUi = appShell.select; const selectMailUi = appShell.select;
@@ -814,3 +815,4 @@ const mailUiApi = window.epMailUiModules.createMailUiApi({
}); });
window.epMailFeatures = window.epMailFeatures || {}; window.epMailFeatures = window.epMailFeatures || {};
window.epMailFeatures.mail = mailUiApi; window.epMailFeatures.mail = mailUiApi;
})();
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "ep-mail", "name": "ep-mail",
"version": "0.4.27", "version": "0.4.28",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ep-mail", "name": "ep-mail",
"version": "0.4.27", "version": "0.4.28",
"dependencies": { "dependencies": {
"@capacitor/android": "^8.5.2", "@capacitor/android": "^8.5.2",
"@capacitor/core": "^8.5.2", "@capacitor/core": "^8.5.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ep-mail", "name": "ep-mail",
"version": "0.4.27", "version": "0.4.28",
"private": true, "private": true,
"description": "Eternity Project mail client", "description": "Eternity Project mail client",
"homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client", "homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client",
+2
View File
@@ -81,6 +81,8 @@ test('account and snooze UI consume the explicit mail API instead of selected le
assert.match(appShell, /window\.epMailShell = Object\.freeze/); assert.match(appShell, /window\.epMailShell = Object\.freeze/);
assert.match(mailUi, /appShell\.wrapOpenMessage/); assert.match(mailUi, /appShell\.wrapOpenMessage/);
assert.match(mailUi, /appShell\.wrapShowCompose/); assert.match(mailUi, /appShell\.wrapShowCompose/);
assert.match(mailUi, /^\(\(\) => \{/);
assert.match(mailUi, /window\.epMailFeatures\.mail = mailUiApi/);
assert.doesNotMatch(mailUi, /(?<!\.)\bopenPreferences\s*\(|(?<!\.)\bquery\s*=/); assert.doesNotMatch(mailUi, /(?<!\.)\bopenPreferences\s*\(|(?<!\.)\bquery\s*=/);
assert.match(shortcutsUi, /window\.epMailFeatures\.mail/); assert.match(shortcutsUi, /window\.epMailFeatures\.mail/);
assert.match(shortcutsUi, /window\.epMailFeatures\.productivity/); assert.match(shortcutsUi, /window\.epMailFeatures\.productivity/);
+2
View File
@@ -1,3 +1,4 @@
(() => {
const rendererState = window.epMailState; const rendererState = window.epMailState;
const appShell = window.epMailShell; const appShell = window.epMailShell;
const selectMailUi = appShell.select; const selectMailUi = appShell.select;
@@ -814,3 +815,4 @@ const mailUiApi = window.epMailUiModules.createMailUiApi({
}); });
window.epMailFeatures = window.epMailFeatures || {}; window.epMailFeatures = window.epMailFeatures || {};
window.epMailFeatures.mail = mailUiApi; window.epMailFeatures.mail = mailUiApi;
})();