Refractoring Stage 6.14 Encapsulated dav-ui.js’s helpers in a local scope while keeping its public DAV feature API intact. Bumped the version to 0.4.26 (Android version code 426) and updated REFACTOR_PLAN.md.

This commit is contained in:
2026-10-16 22:28:00 +03:00
parent 928410b10e
commit 9759c3579a
6 changed files with 11 additions and 6 deletions
+3 -1
View File
@@ -114,6 +114,7 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- [x] Hide the account-manager script in a local module scope and route selectors, escaping, notifications, and DAV navigation through explicit feature APIs (`account-ui.js`, `dav-ui.js`).
- [x] Route the snooze action's message-label hook through the productivity feature API (`snooze-ui.js`, `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] 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.
- [ ] Migrate remaining mail-related consumers and remove transitional global dependencies.
@@ -142,7 +143,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.25`; Android derives `versionName 0.4.25` and `versionCode 425`. 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.26`; Android derives `versionName 0.4.26` and `versionCode 426`. The user confirms the previous artifact works; this bump is for the next build.
## Progress log
@@ -170,5 +171,6 @@ This is a gradual destination, not a requirement to move everything at once. IPC
- Step 6 at version `0.4.23` moves account-manager dependencies onto feature APIs and publishes the DAV manager through `window.epMailFeatures.dav` instead of a free global function.
- Step 6 at version `0.4.24` removes the snooze-to-productivity label action's implicit global call; account and snooze feature API checks are covered by the renderer tests.
- 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.
- 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.
+2 -1
View File
@@ -1,6 +1,6 @@
(() => {
const davProductivityUi = window.epMailFeatures.productivity;
const selectDavUi = davProductivityUi.select;
const selectAllDavUi = davProductivityUi.selectAll;
function davTypeName(type){return type==='caldav'?'calendar':'contacts'}
async function syncDav(type, uploadLocal=false){
@@ -45,3 +45,4 @@ window.epMailFeatures.dav = Object.freeze({
openManager: openDavManager,
sync: syncDav
});
})();
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "ep-mail",
"version": "0.4.25",
"version": "0.4.26",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ep-mail",
"version": "0.4.25",
"version": "0.4.26",
"dependencies": {
"@capacitor/android": "^8.5.2",
"@capacitor/core": "^8.5.2",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ep-mail",
"version": "0.4.25",
"version": "0.4.26",
"private": true,
"description": "Eternity Project mail client",
"homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client",
+1
View File
@@ -77,6 +77,7 @@ test('account and snooze UI consume the explicit mail API instead of selected le
assert.match(accountUi, /accountDavUi\.openManager/);
assert.doesNotMatch(accountUi, /(?<!\.)\b(?:esc|toast)\s*\(|(?<!\.)\$\(/);
assert.match(davUi, /window\.epMailFeatures\.dav = Object\.freeze/);
assert.match(davUi, /^\(\(\) => \{/);
assert.match(appShell, /window\.epMailShell = Object\.freeze/);
assert.match(mailUi, /appShell\.wrapOpenMessage/);
assert.match(mailUi, /appShell\.wrapShowCompose/);
+2 -1
View File
@@ -1,6 +1,6 @@
(() => {
const davProductivityUi = window.epMailFeatures.productivity;
const selectDavUi = davProductivityUi.select;
const selectAllDavUi = davProductivityUi.selectAll;
function davTypeName(type){return type==='caldav'?'calendar':'contacts'}
async function syncDav(type, uploadLocal=false){
@@ -45,3 +45,4 @@ window.epMailFeatures.dav = Object.freeze({
openManager: openDavManager,
sync: syncDav
});
})();