From 1ef934045f7ea11f76db2a10ad5fe7a89f5f6cd4 Mon Sep 17 00:00:00 2001 From: Tero Date: Sat, 17 Oct 2026 00:05:37 +0300 Subject: [PATCH] Update REFACTOR_PLAN.md tree view and few features to TODO.md --- REFACTOR_PLAN.md | 31 +++++++++++++++++++++---------- TODO.md | 14 ++++++++------ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/REFACTOR_PLAN.md b/REFACTOR_PLAN.md index 67f3164..dee473d 100644 --- a/REFACTOR_PLAN.md +++ b/REFACTOR_PLAN.md @@ -13,21 +13,32 @@ Improve the maintainability and auditability of ep-mail without changing its pro - Existing tests focus mainly on OpenPGP and attachments; IPC, storage, and mail workflow boundaries need more coverage. - The web content is sanitized and remote images are approval-gated. Preserve and add regression coverage for these protections. -## Target boundaries +## Current boundaries and target direction ```text desktop/ - main.cjs # Electron startup and lifecycle - ipc/ # Request validation and handler registration - mail/ # Account, IMAP, SMTP, sync, outbox, message mapping - dav/ # DAV services and iCalendar/vCard codecs - security/ # Secure storage and shared boundary validation - pgp/ # OpenPGP services (existing focused modules) -renderer/ - app/ mail/ accounts/ dav/ pgp/ shared/ + main.cjs, preload.cjs # Electron startup, lifecycle, narrow bridge + ipc/ # Mail, DAV, and OpenPGP handler registrars + mail/ # IMAP/SMTP, sync, outbox, snooze, attachments + dav/ # DAV remote-reference validation + security/ # IPC sender and request validation + pgp-*.cjs # OpenPGP key, mail, and key-server services + account-store.cjs # Account-record migration + secure-json-store.cjs # Encrypted JSON persistence + mail-*.cjs, dav-codecs.cjs # Mail models, content projection, DAV codecs +index.html # Shared desktop/browser/Capacitor entry point +app.js, *-ui.js, *.css # Shared renderer sources (canonical) +renderer-state.js # Shared namespaced renderer state +renderer-mail-api.js # Shared renderer feature API factory +mail-content-security.js # HTML sanitizer and remote-image policy +platform-bridge.js # Generated platform bridge +www/ # Generated Capacitor web assets; do not edit +scripts/prepare-android-web.cjs # Copies root web assets into www/ ``` -This is a gradual destination, not a requirement to move everything at once. IPC modules should validate and translate renderer requests, then call services. Services should not depend on Electron IPC or window objects. Pass dependencies such as storage, network clients, clocks, and notification callbacks explicitly where practical. +Keep the shared renderer outside `desktop/`: Electron, the browser build, and Android all use these web sources. The root files are canonical and `www/` is generated. Desktop service boundaries are reflected by the existing `desktop/ipc/`, `desktop/mail/`, `desktop/dav/`, and `desktop/security/` directories. + +IPC modules should validate and translate renderer requests, then call services. Services should not depend on Electron IPC or window objects. Pass dependencies such as storage, network clients, clocks, and notification callbacks explicitly where practical. A future move of shared UI sources into a dedicated `renderer/` directory is optional, not required for this plan; it would need coordinated updates to `index.html` script/style URLs, Electron Builder file inclusion, Android copying, service-worker precache paths, and asset-parity tests. ## Steps and acceptance criteria diff --git a/TODO.md b/TODO.md index b4a7665..ede595f 100644 --- a/TODO.md +++ b/TODO.md @@ -12,7 +12,7 @@ ## Mail workflow - [x] Snooze messages until a chosen time and show a follow-up reminder when they return. -- [ ] Add Undo Send and scheduled sending. +- [ ] Add a configurable Undo Send delay and scheduled sending. - [x] Improve mail search with sender, subject, date, folder, and attachment filters. - [x] Cache recent messages and save drafts offline; queue supported sends and message actions for retry when connectivity returns. - [ ] Group related messages into conversations, with controls to expand or collapse threads. @@ -31,13 +31,14 @@ - [x] Phase 2: receive — detect PGP/MIME and inline PGP mail, decrypt on open, verify signatures, show encryption/signature status, handle missing keys and wrong passphrases. - [x] Phase 3: send — public-key keyring and key import from contacts/messages, encrypt and sign when composing, encrypted copy in Sent, warn instead of silently downgrading. - [x] Phase 4 (desktop): trust levels and fingerprint verification, key-change warnings, passphrase cache timeout. - - [ ] Phase 4 (Android): Android Keystore key storage, biometric unlock, and the reading/sending bridge (encryption is desktop-only until then). + - [ ] Phase 4 (Android): add Android Keystore key storage, biometric unlock, and the reading/sending bridge (encryption is desktop-only until then). - [x] Phase 5 (automated): large attachments, multiple recipients, corrupted/tampered payloads, inline PGP and PGP/MIME tests. - [x] Phase 5 (GnuPG): automated interoperability tests with GnuPG 2.5 (both directions: PGP/MIME, inline, clear-signed, detached signatures). - [x] Phase 6: documentation and release. - [x] Manual interoperability check with Thunderbird. - - [x] Address findings from the automated OpenPGP security reviews (see [SECURITY_REVIEW.md](./SECURITY_REVIEW.md)). - - [ ] Complete an independent human security review of the encryption code before relying on it. + - [x] Address findings from the automated OpenPGP security reviews (see [SECURITY_REVIEW.md](./SECURITY_REVIEW.md)). + - [ ] Complete an independent human security review of the encryption code before expanding OpenPGP support to Android. + - [ ] Add direct IPC-handler tests for both accept and cancel paths of the main-process plaintext-send confirmation. ## Appearance and settings @@ -48,6 +49,7 @@ ## Account settings +- [ ] Add OAuth2 account setup for Google and Microsoft mail accounts. - [ ] Fix the mailbox space indicator; it is not working. - [x] Fix automatic mail sync so the message list refreshes when new mail arrives. - [x] Sync all connected accounts' mailboxes in the Electron main process at launch/resume and periodically in the background. @@ -64,8 +66,8 @@ - [x] Remove the display name initials from the bottom-left corner. - [x] Add the ability to delete draft mails. - [x] Fix IMAP folder creation, which does not work. -- [ ] Give the sidebar (Inbox, Folders, etc.) more room so every item fits on screen: make the box scrollable with a slider, or remove or collapse less-used items. -- [ ] Make labels work and add the ability to create more labels. +- [ ] Improve sidebar usability so all folders fit or can be reached by scrolling; consider collapsing less-used sections. +- [ ] Make labels work reliably and support creating and managing additional labels. - [x] Fix created IMAP folders not showing in the mail rules folder list; only Inbox, Archive and Trash are shown. - [x] Fix draft mail deletion to work like the Inbox: select multiple drafts and delete the selected drafts at once. - [x] Show created IMAP folders in the same list as Inbox and the other folders, and move the folder list and the add-folder button to the top row above Inbox. Add scrolling to the IMAP folders area.