diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-25 10:13:20 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-25 10:13:20 +0200 |
| commit | 07c36ce617512bb9514e604b614e95a15c390b04 (patch) | |
| tree | c933635e83f55cda94e4b1a9457a28cebefc3ed4 /docs/superpowers | |
| parent | 01ea9e9d7df04dc771430e4c378202b8ef37b8db (diff) | |
| download | qtmaildir-07c36ce617512bb9514e604b614e95a15c390b04.tar.gz qtmaildir-07c36ce617512bb9514e604b614e95a15c390b04.zip | |
feat(compose): a menu bar on the composer
File, Edit and Format, to the scope the user chose. Save draft (Ctrl+S)
is the only new action: saveDraftNow() was reachable from the autosave
timer, the send path and closeEvent, so there was no way for the user to
ask for a save. It routes through that same function, which is what
emits draftSaved for item 158's indexing, reports through item 160's
status bar and raises the failure banner; a second write path would have
to repeat all three.
The menus show the toolbar's own QAction objects rather than copies, as
item 140 required for the message pane's bar. Two needed hand-building.
The HTML toggle is a QToolButton and cannot go in a menu, so a checkable
twin mirrors it in both directions, since a menu entry that only follows
the button is half a control. The signature entry takes the switch's own
QMenu pointer, because that menu is rebuilt whenever the signatures
change and copied entries would go stale.
Edit's entries drive QPlainTextEdit and follow its own undoAvailable and
copyAvailable, so a greyed entry tells the truth about what pressing it
would do.
theMenuBarReachesEveryComposerAction() is item 132's reachability rule
applied to the composer: it walks the real menu bar and collects the
composer's actions with findChildren, so an action added to the toolbar
and forgotten in the menus fails without the test being touched. It
skips actions owning a submenu, since Qt emits no triggered for those.
The composer's actions stay out of KeyMap, per item 148: they are
parented to this window, so they are WindowShortcuts dispatched to the
active composer and the main window's namespace is untouched.
lrelease reports 496 finished, 0 unfinished.
Closes item 161.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UUQS6n3cmsFrsjCNmwNtf8
Diffstat (limited to 'docs/superpowers')
| -rw-r--r-- | docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md index 41a7a1b..2e941ec 100644 --- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md +++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md @@ -7709,3 +7709,45 @@ because the user looked at it. severity is the established vocabulary here. - `saveDraftNow()` returns false on failure and the banner takes over, so the status line must not claim a save the write did not make. + + + +## 161. The composer has no menu bar + +**Observed (user, 2026-08-25):** "the compose window should have a menu bar on +top", with "save draft (ctrl+s)" and "duplicate the other actions like we do +on the main window". + +**Cause (verified in code):** the composer has no `QMenuBar`, and **Save draft +does not exist as an action at all.** `saveDraftNow()` is reachable only from +the autosave timer, from the send path, and from `closeEvent`; there is no way +for the user to ask for a save, and no `Ctrl+S` anywhere in the composer or in +`KeyMap`. + +The actions the composer does have are ad-hoc `QAction`s parented to the +window: `m_sendAction` and a Close action (`composewindow.cpp:583-608`), plus +the formatting toolbar's own. **None is registered in `KeyMap`**, which is +deliberate and documented for `Ctrl+W` in item 148: they are WindowShortcuts +dispatched to the active composer only, so they never touch the main window's +namespace. A consequence worth stating before this item is built: +`everyActionIsReachableFromAMenu()` walks the MAIN window's menu bar, so it +does not currently constrain these, and adding a composer menu bar does not +automatically bring them under item 132's rules. + +**Approach.** A `QMenuBar` on the composer, with Save draft (`Ctrl+S`) as the +new action and the existing ones gathered under it rather than duplicated. + +**Constraints.** + +- **"Duplicate the other actions" means the main window's MESSAGE actions, and + most of them are meaningless here.** A composer has no thread, no selection + and no tag surface. Ask which the user actually wants before building a menu + that offers Archive or Mark all read over a message being written. +- Keep the composer's actions out of `KeyMap`, per item 148's reasoning. A + composer menu bar is not a reason to move them. +- Save draft must go through `saveDraftNow()`, which already handles the + failure banner and emits `draftSaved` for the indexing item 158 added. A + second write path would reintroduce the ghost-file problem that fixed. +- **Item 160 unblocked this** on 2026-08-25: the status bar exists, so a + manual save reports through `refreshDraftStatus()` like an autosave. Route + `Ctrl+S` through `saveDraftNow()` and the reporting is already done. |
