diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-17 13:48:54 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-17 13:48:54 +0200 |
| commit | abf56abd167109f50e0ddb06e1baf92192174cd7 (patch) | |
| tree | 20495d1bedd7949d2d0809ae6573fc5e3f23dd0b /src/keymap.h | |
| parent | 019117aa8e52ce39cab58f77b57a9a67f510696f (diff) | |
| download | qtmaildir-abf56abd167109f50e0ddb06e1baf92192174cd7.tar.gz qtmaildir-abf56abd167109f50e0ddb06e1baf92192174cd7.zip | |
fix(ui): make Important a toggle, like Delete and Toggle unread
The `flag` action only ever added the `flagged` tag, so pressing Ctrl+I on a
thread or message that was already important re-applied a tag it already had.
Re-applying a tag changes nothing and repaints nothing, so the key read as
dead, and removing `flagged` meant opening the tag dialog.
It now reads the current state and picks a direction, exactly as `delete` and
`toggle_unread` beside it do. One direction is chosen for the whole selection:
it unmarks only when every selected row is already important, so a single
keystroke cannot leave a selection in two states.
The direction comes from everySelectedRowHasTag(), never a hand-rolled loop.
Two separate bugs went into that helper on 2026-08-16 (items 88 and 105), and
a copy of the then-current `delete` loop would have inherited both: resolving
a reply's row number against the top-level list, and asking a reply's THREAD
where the write is message-scoped, which makes a toggle one-way.
The reply test needs THREE different states to mean anything: the first thread
in the list unflagged, the reply's own thread flagged, and the reply itself
unflagged. With the reply left in its thread's state, the mutation putting
item 105's bug back stayed green, measured. The fixture helper defaults
replyTags to the thread's, so a test that does not pass them explicitly
asserts nothing about scope.
Backlog item 98.
Diffstat (limited to 'src/keymap.h')
0 files changed, 0 insertions, 0 deletions
