diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-21 20:12:30 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-21 20:12:30 +0200 |
| commit | 84e3205ddcba3263e6c07fa314437318309d4b76 (patch) | |
| tree | e120d487e85687a94274677a04c9c09f8123a3b2 /src/mainwindow.h | |
| parent | 95ae5dfe2df7858ad957b353dc0ae1d7af3b4832 (diff) | |
| download | qtmaildir-84e3205ddcba3263e6c07fa314437318309d4b76.tar.gz qtmaildir-84e3205ddcba3263e6c07fa314437318309d4b76.zip | |
feat(compose): register the six compose actions, item 123
Handlers are empty for now; this commit is the registration, so the three
coverage tests guard every later task rather than being satisfied at the end.
Two corrections to the spec, both found in the code rather than assumed. It
calls for a new top-level Message menu and one already exists, so these join
it; two menus named Message would be a defect. And it says every action
needs a binding, which item 132 changed while this was being planned:
save_message ships with no chord, since it is the rarely-used escape hatch
and menu reachability is now the rule that must hold.
reply_no_quote shares reply's icon and is added to the no-duplicate-icons
exception list for the same reason the five thread actions are: it never
reaches the toolbar, and a menu entry always carries its text. That list is
renamed menuOnlySharedIconActions, after the property that earns the
exemption rather than the tier that first needed it.
Bindings are provisional. The user intends to rework them, and Ctrl+Alt+R
for reply_no_quote is an imperfect fit since that tier elsewhere means a
wider scope rather than a variant.
The six labels went through a mnemonic pass that nothing enforced before.
Four of them collided inside the Message menu on first writing, and the
whole class was invisible to a green suite: Qt does not error on a duplicate
mnemonic, it cycles the highlight instead of activating, so the key simply
stops working. Item 57 had already decided this rule by rejecting a label
that would have collided, but it lived in prose and in one test's comment,
which is precisely why it was broken again here.
noMenuHasTwoEntriesSharingAMnemonic() enforces it now, scoped per menu since
a mnemonic resolves among the open menu's entries, and keyed on
QKeySequence::mnemonic() rather than on parsing & by hand, because && is a
literal ampersand and only Qt answers which key it will dispatch. Three
pre-existing collisions are a named freeze list rather than a silent fix or
a narrowed test: Alt+R three ways and Alt+S twice in Message, Alt+O in View.
Renaming entries a user has had in their fingers since 0.1.0 belongs to the
shortcuts rework, and the freeze is written as exact groups so a new entry
joining any of them still fails.
Two of the test's own design choices came from mutation checks that failed
for the right reason while reporting the wrong thing. Reporting collisions
as pairs was order-dependent, so a new colliding entry re-keyed a frozen
pair and the fresh defect read as "a frozen collision no longer happens";
matching frozen entries by whole string broke the same way, since a growing
group stopped matching its frozen text. It reports whole groups and matches
on menu plus key.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXF741wz4SY7j5dqvAxMU5
Diffstat (limited to 'src/mainwindow.h')
| -rw-r--r-- | src/mainwindow.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index 8e483d2..a3cd0ec 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -594,6 +594,27 @@ private: /// that populates. void showMaildirOverview(); + /// Opens a composer on a blank message (item 123). + /// + /// Empty for now. This is the registration commit: the six actions exist, + /// carry icons, sit in the Message menu and are covered by the three + /// coverage tests, so those tests guard the composer while it is built + /// rather than being satisfied once at the end. ComposeWindow does not + /// exist yet. + void composeNew(); + + /// Opens a composer seeded from the displayed message (item 123). + /// + /// `kind` chooses reply, reply-all or forward; `quote` is what separates + /// reply from reply-without-quoting, which are the same kind with and + /// without a seeded body. Empty for now, as above. + void composeReply(ComposeContext::Kind kind, bool quote); + + /// Writes the displayed message's raw file somewhere the user chooses. + /// + /// Empty for now, as above. + void saveDisplayedMessage(); + /// Creates a QAction, binds it to the sequence KeyMap holds for `name`, /// and registers it. `name` is the action name used in [keys]. QAction *addAction(const QString &name, const QString &text, |
