Skip to content

[stable5.13] fix(ui): show "Mark not spam" for unflagged junk messages - #14330

Open
backportbot[bot] wants to merge 2 commits into
stable5.13from
backport/14324/stable5.13
Open

backportbot[bot] wants to merge 2 commits into
stable5.13from
backport/14324/stable5.13

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Backport of #14324 to stable5.13.

The production change is identical to main. The tests are ported to the Vue 2 test setup of this branch, and I added tests for Envelope.vue that the automatic backport did not carry over.

Screenshots

stable5.13 on Nextcloud 35, message in the Junk folder without a $junk keyword.

Before After
Before: row menu After: row menu

Testing

Unit tests for the junk method, menus, icons and quick action pass, and fail again with the old production code. Checked by hand on a Nextcloud 35 instance with a Dovecot Junk folder: the row menu shows "Mark not spam", clicking it moves the message to the inbox, and the "Mark as spam" quick action stays one-way. Not tested: list layout, a message that keeps $notjunk in Junk.

Assisted by ClaudeCode:claude-sonnet-5-5, ClaudeCode:claude-opus-5-5, ClaudeCode:claude-haiku-5-5

Messages delivered to the Junk folder usually have no $junk keyword.
The UI offered "Mark as spam" for them and only set $junk, so the
message stayed in the folder and users had to click again to get
"Mark not spam".

Junk state is now derived in one store method, isEnvelopeJunk: $junk
always counts, and an unflagged message in a junk folder (the account's
junk mailbox or a folder with the junk special use) counts as junk
unless it has $notjunk. The row and thread menus, the junk icons, the
bulk selection, and the toggle and move actions use it.

The "Mark as spam" quick action stays one-way: it skips messages that
are already junk and never moves a message back to the inbox. The
normal menu toggle still works in both directions.

Not changed: the $Junk/$NotJunk keyword names (#13815), the order of
the flag updates in setFlags, and the $notjunk flag on the copy that
MoveJunkListener creates in INBOX. A message that keeps $notjunk
inside the Junk folder still shows "Mark as spam".

Fixes #11168

Assisted-by: ClaudeCode:claude-sonnet-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-haiku-5-5
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>

[skip ci]
@backportbot backportbot Bot added bug 3. to review AI assisted This PR contains AI-assisted commits labels Nov 26, 2026
test: add Vue 2 tests for junk state in envelope components

Assisted-by: ClaudeCode:claude-sonnet-5-5
Assisted-by: ClaudeCode:claude-haiku-5-5
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst
ChristophWurst marked this pull request as ready for review November 26, 2026 11:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants