aboutsummaryrefslogtreecommitdiffstats
path: root/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-14 18:41:10 +0200
committerDanilo M. <danix@danix.xyz>2026-08-14 18:41:10 +0200
commitf897153a1196f23fe0d82dc703d98df1363bf3fc (patch)
tree9fbec09be98ebb55582729dbad0c22580221bee7 /docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
parentbf715fe78c3c39a658f2d3446648bc07c775589d (diff)
downloadqtmaildir-f897153a1196f23fe0d82dc703d98df1363bf3fc.tar.gz
qtmaildir-f897153a1196f23fe0d82dc703d98df1363bf3fc.zip
docs: close item 36, narrow item 66 with a negative result
Item 36's section moves to the closed file and its three traps go into CLAUDE.md, which is where they will be read: the worker is unreachable by findChild, rowCount on an unexpanded thread row is 0 by design, and currentThreadId reports intent rather than content. The claim that this class of bug cannot be reproduced in test_mainwindow is now false, so it is corrected rather than left standing beside its replacement. One in-test reference to item 36 as a permanent limitation is reworded: bare-window cases still have no worker, but that is now a choice per case rather than a property of the binary. Item 66 stays open with the simple case ruled out. The negative result sharpens this entry's own candidate rather than contradicting it: the test drives setCurrentIndex, which updates the selection model synchronously, while the suspect guard turns on a real click not having done so yet. Two cheaper conditions are named as still unexcluded. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md')
-rw-r--r--docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
index 221b3b2..ed88693 100644
--- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
+++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability-closed.md
@@ -4893,3 +4893,47 @@ a keybinding and nothing is broken.
**The consequence for item 36.** That item could not add fixture-backed tests
while a malformed config could hang the constructor. It can now, which is why
84 was done first.
+
+## 36. `test_mainwindow` cannot reach the worker
+
+**Done 2026-08-14, unreleased.** See
+`specs/2026-08-14-mainwindow-worker-fixture-design.md`.
+
+**Observed:** twice in one session (0.8.0), a defect could not be given a
+regression test because `MainWindow` in tests had no notmuch database, so its
+`NotmuchWorker` never emitted `threadLoaded`. One of those, the guard in
+`onThreadLoaded()` against a queued load repainting a pane a multi-row selection
+had just blanked, is now covered: the reproduction written here fails when that
+handler is disabled.
+
+**Shipped as `WorkerBackedWindow` in `test_mainwindow.cpp`, opt-in per test,
+with NO production change.** `wireWorker()` already built the worker from
+`m_config.notmuchConfig()`, an ordinary config key, so a written
+`qtmaildir.conf` pointing at the fixture exercises the shipping path. The entry
+had read as bigger than it was since 2026-08-04 because it assumed a hook was
+needed.
+
+**Three traps found while writing it, each of which had made an earlier version
+of the test worthless. All three are worth knowing before touching this area.**
+
+The worker is **unreachable by `findChild`**. `wireWorker()` creates it
+parentless and immediately moves it to its own thread, so it is not in the
+window's object hierarchy. The tests wait with `QTRY_VERIFY_WITH_TIMEOUT` on
+observable state instead, which is the better assertion anyway.
+
+**`rowCount()` on a thread row is 0 until the thread is expanded**, because
+children are populated by the expansion. `hasChildren()` is the correct
+pre-expansion question, falling back to `summary.totalCount > 1`, and it is also
+what proves two messages threaded rather than arriving as two rows. An assertion
+on `rowCount` fails against correct code.
+
+**`currentThreadId()` reports intent, not content.** It is assigned
+synchronously in the selection handler at `src/mainwindow.cpp:2387`, before any
+worker round-trip, so a test asserting on it passed with `onThreadLoaded()`
+disabled entirely. `MessageView::showingPlaceholder()` is what the user sees.
+The test asserts the pane IS blank before the click, so the assertion after it
+means something.
+
+**Item 66 did not reproduce**, which is recorded in that item rather than
+worked around here. The test was not widened until it failed; the negative
+result and what it narrows to are in item 66's own entry.