Sieve rules: editing rule moves it to the end of the list #24

Open
opened 2026-08-25 08:51:34 +00:00 by mbunkus · 3 comments

I have about 25 Sieve rules. Sometimes I want to rename them. Each time I do the rule gets moved to the end of the list. As rule order is immensely important, I have to move it to its original place each time this happens, requiring ten or more mouse clicks as there are only the "move 1 place up/down" buttons, no drag & drop support either. Highly annoying & might be very surprising to someone not aware of it.

═══════════ #25 ═══════════

Rebuilt from: notification email, session transcript. Description text is incomplete.

I have about 25 Sieve rules. Sometimes I want to rename them. Each time I do the rule gets moved to the end of the list. As rule order is immensely important, I have to move it to its original place each time this happens, requiring ten or more mouse clicks as there are only the "move 1 place up/down" buttons, no drag & drop support either. Highly annoying & might be very surprising to someone not aware of it. ═══════════ #25 ═══════════ <sub>Rebuilt from: notification email, session transcript. Description text is incomplete.</sub>
Author

Oh no, is actually much worse: each time I edit an existing rule it gets moved to the end. This is pretty bad, honestly.

Oh no, is actually much worse: _each time I edit an existing rule_ it gets moved to the end. This is pretty bad, honestly.
Owner

Fixed in #27, and the drag and drop you asked for shipped in #32. Both are in main.

Two things caused the reordering. saveAndApply always appended the rule it was given — correct for a rule created from a message, wrong for one being edited. And the "Also apply to existing messages" tick defaulted to on wherever it was offered, so every edit in Settings took that path, including a plain rename. That is why it happened every time rather than occasionally: the code path that replaces a rule in place was there, but nothing reached it.

Rules now keep their position, and that tick defaults to on only in "Filter messages like this…", where applying is the point of the dialog. A side effect worth having: renaming a rule no longer silently re-runs a filter across your Inbox.

On the ten clicks — a grip handle now sits on the left of each rule card, so a rule can be dragged where you want it. The up and down buttons stay for the keyboard. Touch dragging is not covered, since HTML5 drag and drop is mouse-only, so on a phone the buttons are still the way.

Your addendum was the useful part of this one: "each time I edit an existing rule" is what ruled out the rename path specifically and pointed at something every edit went through.

Fixed in #27, and the drag and drop you asked for shipped in #32. Both are in main. Two things caused the reordering. `saveAndApply` always appended the rule it was given — correct for a rule created from a message, wrong for one being edited. And the "Also apply to existing messages" tick defaulted to on wherever it was offered, so **every** edit in Settings took that path, including a plain rename. That is why it happened every time rather than occasionally: the code path that replaces a rule in place was there, but nothing reached it. Rules now keep their position, and that tick defaults to on only in "Filter messages like this…", where applying is the point of the dialog. A side effect worth having: renaming a rule no longer silently re-runs a filter across your Inbox. On the ten clicks — a grip handle now sits on the left of each rule card, so a rule can be dragged where you want it. The up and down buttons stay for the keyboard. Touch dragging is not covered, since HTML5 drag and drop is mouse-only, so on a phone the buttons are still the way. Your addendum was the useful part of this one: "each time I edit an existing rule" is what ruled out the rename path specifically and pointed at something every edit went through.
Author

Can confirm, works nicely. Drag & drop support is much appreciated, too.

Can confirm, works nicely. Drag & drop support is much appreciated, too.
This repo is archived. You cannot comment on issues.