Skip to content

Add saved-file toast, reader entry points, and folder choice for Save as .eml - #10

Merged
latentoperator merged 1 commit into
mainfrom
feat/eml-save-feedback
Oct 7, 2026
Merged

latentoperator merged 1 commit into
mainfrom
feat/eml-save-feedback

Conversation

@latentoperator

Copy link
Copy Markdown
Owner

Saving a message as .eml was easy to miss: it only worked from the inbox list, went straight to Downloads, and confirmed itself with a caption at the edge of the status line.

What changes

  • Saved-file toast. After a successful save, a card above the status bar says Saved <file> and in ~/Downloads (or whichever folder was used), with Open folder... and a dismiss button. It hides after 8 seconds and stays while the pointer is over it. The existing status-line note is unchanged.
  • Save from the open message. The reader toolbar gets a download button next to Open in browser that saves to Downloads. Right-clicking the message body now offers Save as .eml and Save as .eml to folder....
  • Choose a folder. The message-list menu gains Save as .eml to folder.... The folder chooser runs out of process (scripts/attachment.sh folder → omarchy-file-select --directory, which uses the desktop portal, with zenity as the fallback), the same way the compose file picker avoids in-shell Qt dialogs. The standalone app does not offer the folder rows because it has no chooser.
  • Backend. mail.exportEml accepts an optional directory, which must be an absolute path already in normal form (no .., no ., no doubled or trailing separators, no control characters). The folder must already exist and is opened through the same descriptor-anchored private_fs::directories ownership checks used for Downloads. It is never created; Downloads is still created on first use, as before. This stays within unreleased API 7.

Security

Security: PASS for the export write boundary. Any path the chooser returns is still revalidated by the backend, which refuses it as invalid_params before fetching anything unless it is absolute and in normal form. The write uses the same anchored directory walk, the same rules for rejecting group- or world-writable directories, and the same no-follow unique-name writer as Downloads. Tests verify that a missing chosen folder is not created (the side effect cannot happen), not merely that an error is returned. Owner capture is unchanged: if the user switches accounts while the chooser is open, the save is still refused (JS test).

Verification

  • Rust: cargo test --locked --features integration-test-credentials reports 642 passed and 1 failed. The failure is agent::jobs::tests::legacy_worker_compatibility_accepts_only_known_exact_script_argv, which also fails on unmodified main (d281a64) on Hopebox and appears to depend on the environment. This PR adds export parse and write tests.
  • QML on XPS (Qt 6, offscreen): 1313 passed, 0 failed, including new EmlSavedToast, reader toolbar/body-menu, and message-menu folder-row cases.
  • make test-js, tests/test_source.sh (including the 128 KiB file ceiling), and tests/test_attachment.sh (new folder-picker cases) all pass.
  • omarchy-file-select --directory exists on XPS and calls the portal FileChooser with directory=true.
  • Not yet exercised: the live shell on the laptop. That requires omamail-private install, which restarts the shell.

Release Notes

  • A clear "Saved" card with an Open folder button now appears after saving a message as .eml.
  • Save as .eml is now available from an open message: a toolbar button, plus entries in the body's right-click menu.
  • New "Save as .eml to folder..." lets you choose where the file goes; Downloads remains the default.

… Save as .eml

- EmlSavedToast: a card naming the saved file and folder, with Open folder
  and dismiss; auto-hides after 8s, held while hovered. Status line note kept.
- Reader: download button in the view toolbar (saves to Downloads) and
  Save as .eml / Save as .eml to folder... rows in the body's right-click menu.
- Message menu: Save as .eml to folder... row beside Save as .eml.
- mail.exportEml takes an optional absolute, normalized directory. A picked
  folder must already exist and pass the same ownership checks; it is never
  created. Downloads behaviour is unchanged.
- attachment.sh folder: one folder through omarchy-file-select --directory
  (portal), falling back to zenity, out of process like the file picker.
- Tests: Rust parse/write cases, contract case, shell picker cases, JS
  routing/stale-owner cases, QML toast/reader/menu cases.
@latentoperator
latentoperator merged commit 3c3d4bf into main Oct 7, 2026
14 checks passed
@latentoperator
latentoperator deleted the feat/eml-save-feedback branch October 7, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant