diff --git a/REFACTOR_PLAN.md b/REFACTOR_PLAN.md index b37d01a..de62023 100644 --- a/REFACTOR_PLAN.md +++ b/REFACTOR_PLAN.md @@ -119,6 +119,7 @@ This is a gradual destination, not a requirement to move everything at once. IPC - [x] Encapsulate mail UI implementation behind `window.epMailFeatures.mail` (`mail-ui.js`). - [x] Encapsulate OpenPGP key-management UI helpers locally; it contributes to Preferences through the productivity API (`pgp-ui.js`). - [x] Encapsulate OpenPGP mail helpers behind `window.epMailFeatures.pgp` and use the mail API's HTML escaping helper (`pgp-mail-ui.js`). +- [x] Encapsulate attachment UI helpers locally; its navigation and renderer hooks continue through the mail API (`attachments.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. @@ -147,7 +148,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.30`; Android derives `versionName 0.4.30` and `versionCode 430`. 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.31`; Android derives `versionName 0.4.31` and `versionCode 431`. The user confirms the previous artifact works; this bump is for the next build. ## Progress log @@ -180,5 +181,6 @@ This is a gradual destination, not a requirement to move everything at once. IPC - Step 6 at version `0.4.28` scopes mail UI implementation details while retaining its explicit mail feature API. - Step 6 at version `0.4.29` scopes OpenPGP key UI implementation helpers without changing its Preferences integration. - Step 6 at version `0.4.30` scopes PGP mail helpers, preserving the `prepareSend` API and removing its dependency on the core shell's former global HTML escape helper. +- Step 6 at version `0.4.31` scopes attachment preview and search helpers while retaining their event-driven integrations. - 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. diff --git a/attachments.js b/attachments.js index 3a76ccb..824d670 100644 --- a/attachments.js +++ b/attachments.js @@ -1,3 +1,4 @@ +(() => { // Attachment previews and a dedicated view for finding and managing attachments across mailboxes. const attachmentMailUi = window.epMailFeatures.mail; const selectAttachmentUi = attachmentMailUi.select; @@ -160,3 +161,4 @@ async function openAttachmentsView() { document.addEventListener('DOMContentLoaded', () => { selectAttachmentUi('#attachments-nav')?.addEventListener('click', openAttachmentsView); }); +})(); diff --git a/package-lock.json b/package-lock.json index 0412320..780dfaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ep-mail", - "version": "0.4.30", + "version": "0.4.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ep-mail", - "version": "0.4.30", + "version": "0.4.31", "dependencies": { "@capacitor/android": "^8.5.2", "@capacitor/core": "^8.5.2", diff --git a/package.json b/package.json index 03c9005..10bf3b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ep-mail", - "version": "0.4.30", + "version": "0.4.31", "private": true, "description": "Eternity Project mail client", "homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client", diff --git a/tests/renderer-mail-api.test.cjs b/tests/renderer-mail-api.test.cjs index 4d0f593..d9c3d04 100644 --- a/tests/renderer-mail-api.test.cjs +++ b/tests/renderer-mail-api.test.cjs @@ -69,6 +69,7 @@ test('account and snooze UI consume the explicit mail API instead of selected le const shortcutsUi = fs.readFileSync(path.join(root, 'shortcuts.js'), 'utf8'); const productivityUi = fs.readFileSync(path.join(root, 'productivity.js'), 'utf8'); assert.match(accountUi, /window\.epMailFeatures\.mail/); + assert.match(attachmentUi, /^\(\(\) => \{/); assert.match(snoozeUi, /window\.epMailFeatures\.mail/); assert.match(attachmentUi, /window\.epMailFeatures\.mail/); assert.match(pgpMailUi, /window\.epMailFeatures\.mail/); diff --git a/www/attachments.js b/www/attachments.js index 3a76ccb..824d670 100644 --- a/www/attachments.js +++ b/www/attachments.js @@ -1,3 +1,4 @@ +(() => { // Attachment previews and a dedicated view for finding and managing attachments across mailboxes. const attachmentMailUi = window.epMailFeatures.mail; const selectAttachmentUi = attachmentMailUi.select; @@ -160,3 +161,4 @@ async function openAttachmentsView() { document.addEventListener('DOMContentLoaded', () => { selectAttachmentUi('#attachments-nav')?.addEventListener('click', openAttachmentsView); }); +})();