diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-13 11:59:30 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-13 11:59:30 +0200 |
| commit | e7cdd7fd3ae960572976cb4a053ecf192baa17c2 (patch) | |
| tree | d191bd82d67b750a14e72fabdbacbd5eb60c5e58 /src/tagrulesdialog.h | |
| parent | 2471356c99f506b6227c4f9a9399f051b85ef76c (diff) | |
| download | qtmaildir-e7cdd7fd3ae960572976cb4a053ecf192baa17c2.tar.gz qtmaildir-e7cdd7fd3ae960572976cb4a053ecf192baa17c2.zip | |
fix(rules): keep the text-mode toggle reachable
Ticking "Edit as text" was a one-way trip: the only way back to the rows
was closing the dialog and reopening it. The checkbox was parented to the
builder widget and sat on the match row, and switching to text mode hides
that widget, so the toggle disappeared along with the rows it governs.
Move it to the query row, which is visible in both modes.
The existing tests all passed against this, because they drove the toggle
through setChecked and then asserted on the checked STATE. A hidden
checkbox reports its state perfectly well, so every one of those
assertions held while the widget was unreachable. The new test asks the
question that matters, whether the toggle would be on screen, and it uses
isVisibleTo since nothing is isVisible on a dialog that was never shown.
Worth recording how close the mutation check came to endorsing this too.
Reparenting the checkbox alone left it in the query row's layout, so it
stayed visible and the test still passed. Only restoring the full shipped
shape, parent and layout together, reproduced the fault and failed the
test. A mutation that does not reproduce the original bug proves nothing
about the test that is meant to catch it.
The spec's layout sketch carried the same error and is corrected, with
the reason, so the next reader does not reintroduce it.
Diffstat (limited to 'src/tagrulesdialog.h')
| -rw-r--r-- | src/tagrulesdialog.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tagrulesdialog.h b/src/tagrulesdialog.h index c91dc0c..9559918 100644 --- a/src/tagrulesdialog.h +++ b/src/tagrulesdialog.h @@ -82,6 +82,12 @@ public: void setTextModeForTest(bool on); QString warningTextForTest() const; + /// Whether the text-mode toggle would be on screen. A toggle that hides + /// itself when switched on is a one-way trip, and asserting only on the + /// checked STATE passes against that, since the state is still readable + /// when the widget is not. + bool textModeToggleIsReachableForTest() const; + signals: /// Asks the owner to run countQueries() through the worker. void countsRequested(); |
