diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-19 10:27:02 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-19 10:27:02 +0200 |
| commit | 2e0db925d5ca7100d8405ffc352ae435cdbdb73d (patch) | |
| tree | 4d10cc671d1ed994b23263e80bdbc1c77c8df330 /tests/test_htmlbuilder.cpp | |
| parent | 6de81918dc7a9342fb532d6a5542c868ff65826c (diff) | |
| download | qtmaildir-delete-to-trash.tar.gz qtmaildir-delete-to-trash.zip | |
fix(trash): refresh the list when a restore empties a rowdelete-to-trash
Reported from a hand test: Restore moved the message correctly and the row it
came from sat in the trash list until the Trash filter was clicked again.
The trash view is path-based, so a restored message stops matching the query
the list was built from. That is a state no tag change can express, and nothing
in onMessagesMoved() removes a row, deliberately: in an ordinary view a deleted
message's card should stay put, since one deleted message does not doom the
conversation.
refreshCurrentQuery(), not runCurrentQuery(). The refresh runs immediately
after the undo entry is pushed, and re-running the query outright clears the
undo stack, which would make Restore the one mutation in the window with no way
back. Gated on isShowingTrash() rather than on the destination, because a
Delete is a move too and reaches the same slot.
Three tests, each catching a different mutation: the row leaves, undo survives
the refresh and still moves the file back, and a delete outside the trash view
leaves its row alone.
The third one was wrong on its first draft and passed against the mutation it
existed to catch. It used a `tag:inbox` view, which looks ordinary but which a
deleted message keeps matching, since Delete adds `deleted` and the origin tag
and removes nothing. A path query on the inbox folder is the honest instrument:
the file really leaves, so the row survives only because nothing refreshed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_htmlbuilder.cpp')
0 files changed, 0 insertions, 0 deletions
