summaryrefslogtreecommitdiffstats
path: root/docs/superpowers
AgeCommit message (Collapse)AuthorFilesLines
2026-08-09feat(ui): make the toolbar icon size configurableDanilo M.1-0/+34
Follow-up to item 56. With the toolbar now following the desktop's button style, an "icon only" desktop makes the icon the whole control, and this style reports PM_ToolBarIconSize as 16px, which is a small target for a button with no text beside it. A [general] toolbar_icon_size key, 16 to 64, defaulting to 24 rather than to the style's own metric. Setting it to 16 restores the theme's value. Clamped and reported, unlike message_zoom, which documents a 0.5 to 3.0 range in the README and enforces none of it. Both ends here break the UI that would be used to fix them: too small is an invisible icon, too large is a toolbar taller than the window. The unenforced message_zoom range is recorded as item 58 rather than fixed here, since it is a separate defect that predates this change. Also documents in the README that saved-query button labels are the key names from the user's own [queries] section, which is why the "Flagged" button still read that way after the action was renamed: it is a user's query name, not a string this code owns. The sample config now shows `Important = tag:flagged` to teach the wording the UI uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09feat(ui): icons on every action, and rename Flag to ImportantDanilo M.1-2/+45
Items 56 and 57, done together because both touch the action registry. 56. The complaint was inconsistency, not absence: eight of twenty-four actions had themed icons, so two adjacent entries in one menu disagreed and the toolbar laid out an empty slot for the other sixteen. The themeIcons table now covers them all. The fifteen names added were probed against a live icon theme first rather than taken from the freedesktop spec on faith, and the existing null-icon guard still lets a theme that lacks one fall back to text. The second half of the note asked that buttons honour the desktop's "Icon only" setting. They could not: the hardcoded setToolButtonStyle overrode it whatever the user had chosen. It now reads SH_ToolButtonStyle. Dropping the call entirely was tried and rejected, since a bare QToolBar defaults to ToolButtonIconOnly rather than to the platform hint, which ignores the setting just as thoroughly the other way. This is a visible change: on a desktop set to "Icon only" the toolbar now shows icons without text. 57. "Important" over "Starred", the user's pick; the Message menu already has "Mark &spam", so "Starred" would have needed an accelerator from inside the word. Changed the action text, its status tip, the undo description and the star column's tooltip, which still read "Flagged". The tag stays `flagged`. It is wire format that neomutt, the user's saved queries and ThreadSummary::isFlagged() all read, and following the label through to the tag would rewrite the mail store and desynchronise every other tool over the same Maildir. The action name stays `flag` too, since that is the key users write in [keys]. Four tests. everyActionCarriesAnIcon names every action missing one and guards against passing on an empty list; it reported all sixteen before the change. theImportantActionStillWritesTheFlaggedTag asserts on the tag the model actually received, and mutating it to `important` fails that test plus two pre-existing held-edit tests. Also adds the changelog entry for the cron-sync indicator fix, which the commit that made it omitted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09docs: record items 56 and 57 from the user's notesDanilo M.1-0/+112
Two notes added since this morning's pass, both presentation. 56: icons are inconsistent across the interface. The mechanism is not missing, it is partial: the themeIcons table covers eight actions and about twenty others get nothing, so adjacent menu entries disagree. The names are not the obstacle either, probed against this desktop's theme and every name a full set would need resolves. The second half of the note, that buttons should honour "Icon only", is a real override: the hardcoded setToolButtonStyle defeats the desktop's own setting. 57: rename the Flag action to Important or Starred. Label only. The notmuch tag stays `flagged`, since it is wire format that neomutt and the user's saved queries also read. The star glyph already ships in the list column. Recorded that "Important" can take a free accelerator while "Starred" collides with Mark &spam. The first draft of 56 claimed there were no icons at all, which was wrong: it missed the table at mainwindow.cpp:902 by grepping for the call site rather than reading the setup. Corrected before commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09docs: record items 54 and 55 from the user's notesDanilo M.1-0/+149
The backlog is downstream of the user's Obsidian notes and had drifted. Three notes had no entry; two became items and one turned out to be a question with an answer already in the tree. 54, a defect: edits applied before a cron sync still counted as pending. The count is cleared only in the local sync-finished handler, so a run the window did not start left the indicator claiming work that had already shipped, and the exit prompt asked to sync for it. Adjacent to item 49, whose account set goes stale the same way. 55: in a window narrower than the thread view's column widths there is no space left for the splitter's stretch factor to distribute, so the message pane collapses to nothing on first run. The third note asked whether a build can skip the tests. It can: QTMAILDIR_BUILD_TESTS=OFF, which the SlackBuild already passes. Causes verified in the code rather than copied from the notes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08docs: carry the item 20 and 53 backlog entries onto masterDanilo M.2-10/+1703
The work for item 20 lives on the branch item-20-message-rows, parked and not merged while the user explores a layout other than the table. Without these documents on master the session-start backlog read would miss item 53 entirely and item 20 would still read as unspecified, so the next session would either re-ask a question already answered or start designing against a rejected design. Docs only. No code from the branch is merged here, and the entries say so in three places: a note above the status table, item 20's own section, and a banner on the plan document telling a future agent not to execute it again. File and line references were checked against master rather than copied. Item 53's citation of the column-grid cause pointed at threadlistmodel.cpp:275-283, which on master is unrelated font handling; it now names the branch and the function instead of a line range that would send a reader to the wrong code. CLAUDE.md and CHANGELOG.md were deliberately NOT brought across. Both describe a QTreeView and features master does not have, and a CLAUDE.md that misdescribes the architecture is worse than one that is merely out of date.
2026-08-07feat(sync): sync only the accounts with unsynced editsDanilo M.1-1/+12
A sync ran mbsync -a regardless of what changed, so tagging mail in one account fetched all of them. The account set was not a parameter anywhere on the path: MailSync::start() took no arguments and the script hardcoded -a, so nothing between a tag edit and mbsync carried which account changed. Track which accounts have edits and pass their mbsync channels through to the script, which now takes channel names and falls back to -a when given none. An empty set means all accounts, per the request: a sync with nothing pending is a fetch, and narrowing that to wherever the last edit landed would quietly stop collecting mail everywhere else. The channel is a new optional per-account key rather than the section key. The two names genuinely diverge, because a QSettings section key may carry dots that the channel does not, and mbsync treats an unknown channel as fatal rather than skipping it, so key-as-channel would fail those accounts' syncs outright rather than degrade. It defaults to the key, so accounts whose two names already agree need no config change. The edited-account set is deliberately not netted the way the pending-edit map is: that map tracks the index, where a tag removed and re-added leaves nothing outstanding, while this tracks the mail store, where both writes have already renamed files that mbsync still has to propagate. It is also snapshotted before flushHeldEdits(), which inserts into it synchronously rather than on a queued reply, so a successful sync cannot clear accounts whose edits it never carried. Closes item 49. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07feat(ui): add a Maildir overview under HelpDanilo M.1-1/+35
Nothing in the UI reported database-level facts: every query gave a thread count for that query, and nothing said how much mail there is overall. A dialog under Help now shows messages, threads and tags from notmuch, plus the account list from config, since notmuch does not model accounts at all. A separate worker call rather than a reuse of requestCounts, which counts threads to match the row count of a query. This counts messages, which is what a user means by "how much mail is in here". The test pins 4 messages in 3 threads against the fixture and fails if they are ever made equal, so routing both through one count cannot pass unnoticed. Every field starts at -1 and renders as "unknown" when notmuch could not answer it. Printing 0 would say the Maildir is empty, and telling someone their mail is gone is the worst way to report an index that failed to open. The dialog opens showing "Counting..." rather than blocking, since counting every message is not free on a large database. That makes two lifetimes matter: the reply can arrive after the dialog is closed, so the label is a QPointer, and the dialog can be closed and reopened while a count runs, so a generation counter drops the older answer. The test drains DeferredDelete before firing the late reply, because close() deletes through deleteLater and without that the dangling case is never actually reached.
2026-08-07feat(ui): make Escape deselect the row as well as blank the paneDanilo M.1-1/+67
Blanking the pane while leaving the row highlighted reads as half an action, and deselecting is what Escape means nearly everywhere else. The user asked for two actions rather than a changed one, so clear_pane keeps its behaviour and moves to Shift+Esc; clear_selection takes Escape and does both. Shift+Esc rather than unbound because every action carries a default and a test enforces it. Clearing the selection re-adopts the thread it just cleared, unless done in exactly the right way. clearSelection() leaves currentIndex() valid, so onSelectionChanged takes its "one or fewer rows" branch, sees a current row whose id differs from m_currentThreadId, and calls onThreadSelected for it. Clearing the selection before blanking lets that run while the id still matches, so nothing reloads, and clearing current stops a later collapse-to-one-row reaching the same row. All four arrangements were tried; only this one passes. The first version of the test could not distinguish any of them. It asserted showingPlaceholder(), which passes regardless because this fixture has no worker, so loadThread never replies and the pane is never repainted. currentThreadId() and currentIndex() are observable without one, and asserting those is what made the test discriminate.
2026-08-07test: pin the offscreen platform, and let the popup test check its own geometryDanilo M.1-1/+30
ctest sets no QT_QPA_PLATFORM, so the suite's verdict depended on how it was invoked: green for anyone exporting `offscreen` by hand, red under ctest in the same tree. That cost a wrong diagnosis before the cause was found, an unrelated change blamed for a failure that reproduces on a clean checkout. The Wayland warning blames a missing transientParent, which is misleading. Instrumenting the test showed the popup viewport arriving as 1278x0. The zero height is why the grab returned a null pixmap, but the width is the worse half: this test sizes a line edit to 550px and exists to prove a description survives a popup that size, so a working grab would have measured a popup twice that wide and passed while proving nothing. Offscreen gives 548x40, the geometry the test means. Pinning the platform is therefore the correct fix rather than an opt-out. It is set in add_qtmaildir_test so it covers every test, including the two others that create widgets, and anything added later. The test now also asserts its own geometry, since CMake only governs ctest and the binary is often run directly. A bare !shot.isNull() said nothing useful; it now reports "popup viewport has no height (1278x0)" or names a popup too wide to be the case under test. Both guards were verified by mutation.
2026-08-07docs: record four items the usage notes had and the backlog did notDanilo M.1-0/+168
The notes are the upstream source and keep growing, so the backlog goes stale on its own between sessions. This pass found three unrecorded entries, each with its cause verified in the code rather than copied from the note: - 49, sync always runs every account regardless of what changed. The account set is not a parameter anywhere on the path, and the shipped script hardcodes the whole-store sweep. Needs a decision first about whether an account key is also an mbsync channel name. - 50, Esc blanks the pane but leaves the row selected. Built as specified by item 32; the user now wants both, as two actions rather than one. - 51, clicking a subject scrolls the list sideways. Ordinary view auto-scroll, cosmetic. 52 came from the work itself rather than from the notes: the suite's verdict depends on how it is invoked. test_querycompleter grabs a popup and Wayland refuses a grabbing popup for a window that has never received input, so it fails under ctest and passes when run with the offscreen platform by hand. It cost a wrong diagnosis on the day it was found, an unrelated change blamed for a failure that reproduces on a clean checkout, because the comparison was run under two different plugins. Recorded with the transientParent fix preferred over forcing the platform, since a test that runs under the real plugin is worth more than one that opts out.
2026-08-07feat(ui): fill the blank message pane with a branded placeholderDanilo M.1-1/+83
An empty right pane said nothing, and multi-select made it a routine sight. It now carries the wordmark, thread counts that run their query when clicked, and a sync line that appears only when something needs attention. Rendered into the existing web view as a third document shape, so there is one document path and one set of security rules. The brand palette is a deliberate exception to deriving colours from the desktop theme, since a logo is brand rather than chrome; the theme still picks which of the two sets is used. Counts refresh when the pane is about to show rather than in the background: one goes stale the moment a tag is edited, and refreshing one nobody is looking at is work for nothing. A generation counter discards a superseded reply, and a late answer cannot repaint over an opened thread. The helper lines are real links because JavaScript is off in this profile. The handler is gated on the placeholder actually being displayed, so the same URL inside a message body is dropped: a stranger's mail must not drive the thread list, even to run a harmless query. Three defects found while building, all silent: - Every CSS percentage was invalid. QString::arg does not collapse "%%" into "%", so the document carried "50%%" and the browser dropped each declaration holding one, disabling the mask, the glow and both radial gradients while still rendering something plausible. Substitution is by named token now, which cannot collide with a percent sign. - A geometry probe endorsed the layout while that was live, because it measured only properties without percentages. - The font test passed against a build with one face missing, since the other satisfied both of its checks on its own. The mockup's light values needed correcting against a real pane: the grid vanished at a 2% luminance step on white, and the glow subtracts light there rather than adding it, washing the pane. Strength only, not hue.
2026-08-07docs: record what item 30 was specified asDanilo M.1-0/+51
The blank-pane item was designed with the user this session but not built, and the decisions would otherwise have to be re-derived. The important correction is to the item's own source material: it is built from the user's HTML mockups, not from the PNGs this section originally recorded. Those PNGs were rendered from that HTML, and it ships a complete brand palette for both light and dark. Two parts of the mockup cannot survive the port, and both are deliberate properties of this application rather than problems to fix: its Google Fonts import is blocked by the interceptor, and its layout script cannot run because JavaScript is off. Also records that the selected-thread count, which this section called the half with real value, was rejected by the user on the grounds that the status bar already shows it. The helpers are unread, flagged and inbox counts plus a sync line that appears only when something needs attention. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07feat(ui): show each thread's tags under its rowDanilo M.1-25/+98
The thread list was uniform and cramped: every row one line tall, with nothing to say what a thread was about before opening it. Rows are now roughly double height, carrying a strip of tag chips beneath the text, with alternating row colours and a star column for flagged threads beside the existing paperclip. The strip is painted by the VIEW rather than by a delegate, which is why ThreadListView exists. A delegate is handed one cell's rectangle and cannot paint outside its column, so a strip drawn from the subject column stops at that column's edge, losing the last tags of a well-tagged thread, and starts at its left edge, putting the chips under the subject instead of under the row. Tags the row already shows another way are left out: inbox as structure, unread as the dimming, flagged as the star, attachment as the paperclip, and the account as the chip in the subject cell. Sorted, since notmuch's order is not guaranteed stable and a row whose chips reordered between repaints would flicker. Six defects were introduced and fixed on the way here, all of them one consequence: a QTableView paints per cell, and a row-wide strip is not a cell. SubjectDelegate installed view-wide drew the account chip into every column, since AccountLabelRole belongs to the row; it is split into RowStyleDelegate for every column and SubjectDelegate for the subject alone, with a Q_ASSERT guarding that. Row height returned from sizeHint did nothing, because a table takes one height per row. The strip painted from x=0 over the marker columns, via a protected viewportMargins() that returns 0. Measuring the text band and the strip with one font put the pills over the date. Alternating colours and the selection are per-cell too, so the band showed bare viewport background until the view filled it, honouring the model's own BackgroundRole first so a deleted row is not cut in half. And that fill spanned the full width, cutting the centred marker glyphs at their midpoint. Closes item 5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07fix(ui): tell read threads from unread without relying on boldDanilo M.1-8/+32
Bold was unread's only cue, and it renders identically to regular on the user's system: confirmed by eye against a bare QTableView holding a plain QStandardItemModel, with no code from this project involved. The fault is in Qt or fontconfig, below this application, and nothing in the model could ever have reached it. Read and unread mail looked exactly alike. The emphasis is inverted instead. Unread rows keep the palette's own text colour and read rows are dimmed toward the background, so the cue rides on Qt::ForegroundRole, which the delegate already honours, and costs no column. It also suits the real ratio, measured at 99 unread against 4220 read: dimming the bulk is calmer than highlighting it. The dim colour is derived from the palette, never hardcoded, per the rule item 12 established. Bold is kept for systems where it works, but nothing depends on it now. That exposed a second defect, visible the moment it shipped. Qt resolves ForegroundRole into the palette and then prefers it over HighlightedText, so a model-supplied colour wins on a SELECTED row too. The dim is blended against the unselected background, so a selected read row painted grey on the selection colour, near unreadable. SubjectDelegate::initStyleOption now reverses that, and the delegate is installed view-wide rather than on the subject column alone, so every column gets the same handling instead of three of them keeping Qt's ordering. The guarding tests state the property rather than the mechanism: strip the font from the model's answer and the two states must still differ. A test asserting only that bold is set passes on a system where bold paints like regular, which is exactly how this survived. The selection test renders two rows identical but for the unread tag, selects both, and requires zero differing pixels. Part of item 5; the density work and the star column remain. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07fix(ui): the message pane follows the desktop themeDanilo M.1-5/+59
The stylesheet hardcoded #bbb, #555, #000, #666, #ddd and #4a6f8a, and set no background at all, so on a dark desktop plain-text mail rendered as black on white inside a dark window and the web view's own default showed through. The colours now come from a Palette struct derived from QPalette, and are passed into the builder rather than read from qApp inside it, so the stylesheet can be tested against a known palette with no running application. Base and Text rather than Window and WindowText: the pane is a content surface like a text edit, and on many themes those differ. The secondary colours are blends of text and background, not fixed greys. That is the part that makes it work both ways round, since a #555 chosen to read as subtle on white is nearly invisible on #2b2b2b. The quote colour keeps its hue, because "this is quoted" is carried by being a different colour rather than a dimmer one, but is pulled toward the background so it stays readable instead of glowing on dark. A sender's own HTML is deliberately left alone, and a test asserts that so it cannot drift: rewriting a sender's styling would break layouts that depend on it, and a newsletter setting a white background is entitled to stay white. This themes the plain-text render and the chrome around messages, nothing more. MessageView passes its own widget palette rather than the application's, since a style sheet or a themed parent can give the pane different colours from qApp, and re-renders on PaletteChange: the document's colours are baked into its stylesheet at build time, so unlike a widget it does not restyle itself when the desktop theme changes. The load-bearing test asserts the negative, that no hex colour appears in the style block which the palette did not supply. A test checking only that the palette's colours are present passes with a leftover literal still there, and one leftover literal is the whole defect. Confirmed by mutation. Closes item 12. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07feat(tags): mark every thread in the view read, in one undoable stepDanilo M.1-1/+29
An action removing "unread" from every thread in the current view, on the toolbar, the Message menu and Ctrl+Shift+U. It deliberately ignores the selection, which makes it the one action in the window that does, and it routes through the same funnel as every other tag change, so it is one write rather than one per thread. Disabled until the query reports its total. Threads arrive in batches, so before then the model holds only what has landed, and an action saying "all" must not silently skip the rest. A greyed control says "not yet" without needing a dialog or a stall the user cannot see. The state is also set at registration, since QAction starts enabled and a window that has not run a query has nothing to act on. Two things came out differently from the plan, both forced by existing code. It carries a default binding, because everyActionHasAShortcut requires every registered action to have one: an unbound action is unreachable from the keyboard, and that invariant is deliberate, so the action was given Ctrl+Shift+U rather than the invariant relaxed. And only the threads that are actually unread are sent, because sending the rest would inflate the pending-edit count with writes that change nothing, and the quit prompt reads that count. A view with nothing unread does nothing, pushes no command and says so: an undo entry that restores nothing is worse than none, since it absorbs a Ctrl+Z meant for the previous action. undoDepthForTesting() is new and exists for a reason worth recording: undo->isEnabled() cannot answer "was a command pushed", because the undo QAction is always enabled and tests canUndo() when triggered. The first version of the no-op test asserted on it and passed against a mutant with the unread filter removed. Closes item 43. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07feat(sync): the status bar says which account is syncingDanilo M.1-7/+45
"Syncing..." was set once and never updated, so a run that takes over a minute reported nothing about what it was doing. The original diagnosis in the backlog was half wrong, and two further wrong ones were made and discarded before the real cause: plain "mbsync -a" prints NOTHING until it exits, then a single summary line. Measured on a real run, one line at 11:11:08 then 73 within the second 11:11:33, at the end of a 46-second run. So there was no stream to read for the part of a sync that takes time. It is not buffering, so stdbuf changes nothing, and the account name is not unavailable either, which was the second wrong conclusion. mbsync -V is what changes both: it announces each channel as it reaches it, which is at once the progress and the account name originally asked for. The shipped script now passes it. SyncPhaseTracker derives a short status from the output as it streams: the channel being synced, the summary counts when mbsync ends, then the notmuch reindex. It lives beside MailSync rather than in the window so the matching rules are one testable thing, and it holds no widget. Matching is loose and case-insensitive, since the wording varies by version, and nothing in it decides success or failure: the exit status remains the only authority on that. Lines are reassembled in MainWindow before being fed, because QProcess::readAll() splits wherever it happens to and a half-line would match nothing. Every status is sanitised and truncated: the channel name comes from a config file this app does not own, and a long one must not stretch the status bar. Two defects in existing code, fixed with it. setSyncBusy(true) ran after start(), so a fast run's output arrived before the per-run reset and wiped its own phase. And a first draft deferred phases while a transient message showed, which let a "Background sync completed" message armed before the sync began suppress the whole run: a running sync's state outranks an expiring event message. Verified by replaying real captured mbsync -V output through the tracker, not only against fixtures. The MainWindow test paces its script with sleeps, since a script that prints everything at once arrives in one readyRead and makes every intermediate phase unobservable. Closes item 42. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07docs: record how to find the messages item 41 affectedDanilo M.1-1/+21
Confirmed on real mail: a message whose text/html part carries a Content-Id now renders. Item 41's status drops the caveat about the reported message not being relocated. Finding an affected message is harder than it looks, which is why the search is worth recording rather than rederiving. A Content-Id on an inline image is the common case and always worked, so a plain grep for the header returns mostly noise. The narrow case is a Content-Id in the same header block as a text/html Content-Type, which needs a small awk pass over the message files. That found 96 in one inbox, all bulk senders. Also records that file: is not a notmuch search term, so a matched path cannot be turned into a query directly; the Message-ID header is the way across to an id: query. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07fix(mime): a body part carrying a Content-Id no longer renders blankDanilo M.1-1/+1
collectParts() filed any part with a Content-Id into inlineParts and returned before the text/plain and text/html branches. Setting a Content-Id on the text/html body is legal and common in bulk-sender output, and such a message parsed with both body slots empty, so hasHtml() was false, HtmlBuilder fell through to an empty plain body, and the pane rendered nothing. Both halves of the report, the blank message and "no HTML part", came from that one ordering. A content id makes a part referenceable, not undisplayable. The two are independent. The branch now registers the part and falls through rather than returning, so the body still fills its slot. Registering first keeps a part that is both the body and a cid: target reachable under its id for any sibling referencing it. Content-Disposition is deliberately not used as the discriminator: it is absent far more often than it is correct, and a body part commonly carries none. The existing attachment check remains the only test for "not a body", and the first-one-wins isEmpty() guard still stops an inline image displacing a real body, since an image matches neither text branch. Verified against a hand-written fixture whose text/html part carries a Content-Id, asserting the body renders, the id still resolves, and the sibling image is unaffected. Load-bearing by mutation: restoring the early return fails the test. The user could not relocate the message that prompted the report, so the end-to-end path is unconfirmed. Closes item 41. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07fix(tags): the Remove field suggests only tags the selection hasDanilo M.1-1/+1
Both TagDialog fields built their completer from knownTags, the whole database's tag list, so removing a tag offered every tag in existence rather than the handful the selected threads actually carry. The candidates were already in the dialog: currentTags, used until now only to render the checkbox list. The constructor now walks two (field, vocabulary) pairs instead of two fields sharing one list, with knownTags for Add and currentTags.keys() for Remove. On a multi-thread selection that is the union, not the intersection, since removing a tag two of three threads carry is a meaningful request. The setWidget and per-token prefix machinery is untouched: these fields hold a comma-separated list, and QLineEdit::setCompleter is the trap this dialog already works around. Only the candidate list changed. Completion stays a suggestion, never a whitelist, so a tag absent from the candidates still applies. Tests type keys rather than using setText, which does not drive a completer at all. Verified load-bearing by mutation: reverting the Remove vocabulary to knownTags fails the new test. Closes item 48. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06docs: record item 48, tag removal suggests every tagDanilo M.1-0/+43
The remove field's completer is built from knownTags, the whole database's tag list, because TagDialog builds both fields' completers in one loop. Only the tags a thread already carries can be removed from it. The dialog is already given currentTags and uses it to render the existing tags, so the candidate list is in hand and this needs no new plumbing.
2026-08-06fix(ui): one Sync control, and a query bar that looks finishedDanilo M.1-4/+124
Sync had two controls that behaved differently. The QPushButton beside the query bar cleared the log, opened the pane and disabled itself; the QAction behind the toolbar, menu and shortcut called start() and did nothing else, discarding its return value so a rejected start was silent. Worse, item 29's "disable Sync during a background sync" set the button only, so the toolbar entry stayed clickable through a cron sync and could only produce the script's EX_TEMPFAIL skip. startSync() is now the single handler behind every route in, and the enabled state lives on the QAction, which reaches the toolbar, the menu and the shortcut at once. It also reports when no sync command is configured rather than doing nothing. The QPushButton is gone. It read as a Search button given it sat beside a text field, which is the user's own observation and the reason the toolbar one survives instead. Its unavailable-command tooltip moved to the action, since that is the only thing that says why the control is dead. Removing it left the query field running flush to the window edge, so the saved-query buttons move from their own row onto the query row. The bar is now framed by the account dropdown on the left and the saved queries on the right, the empty row is gone, and the thread list gains the space. The field also gains setClearButtonEnabled, which is Qt's own themed clear icon rather than a hand-rolled button. A "Search" button was considered and rejected: Return already runs the query. No overflow handling for [queries], which is unbounded. Three entries fit; item 23 already specifies buttons-plus-menu and is where that belongs. CLAUDE.md's architecture diagram named four widget classes that have never existed, QueryBar, SavedQueryBar, HeaderWidget and AttachmentBar. The query row and the message header are built inline. Corrected, and the components that do exist but were missing from it added. Tests: the new action test was verified red first and load-bearing by mutation. The old button test is deleted rather than repointed, being an exact duplicate of it, and the unobservable-lock test now drives the action. The clear button and the row layout were confirmed by hand; no test clicks the icon, which is a mouse path. Backlog: 45 done and reclassified as a defect rather than a cosmetic redundancy, 47 added for the bar.
2026-08-06test: stop two tests depending on the machine they run onDanilo M.1-2/+36
Both are the same class of defect: a test that reads real machine state and so passes or fails on circumstance rather than on the code under test. Item 38. Every MainWindow a test builds constructed its SyncMonitor on the live /proc/locks, so a window observed the machine's actual sync state and the sync-button assertion failed whenever the user's cron sync happened to be running. Cron fires every ten minutes and a run lasts ~35s, which is roughly 6% of runs, and it read as flakiness. SyncMonitor already took an injectable locks path for exactly this; MainWindow did not expose it. It does now, as a test seam rather than a config key: /proc/locks is not something a user would set, and a wrong value silently disables background sync detection instead of failing loudly. The monitor is still constructed and started, per the item's own constraint. Only the table it reads is redirected, to an empty file in the test's own temporary directory. Item 46. uiStateSurvivesARestart asserted a 940px width, and the offscreen platform reports an 800x800 screen. restoreGeometry() clamps to the available area, so the width came back as 798 while the 620 height, which fits, restored untouched. That asymmetry was the tell that persistence was fine and the test was wrong. The size is now 640x560 and carries no meaning beyond differing from the default. Verified by reproducing the original conditions rather than by waiting for them: the suite run under flock -n /tmp/mbsync.lock fails item 38's assertion with the seam bypassed and passes with it in place, and item 46 now passes under offscreen where it failed. One dud mutation is recorded in the backlog, writing an unparseable line into the injected lock table does not fail the test, because lockHeldIn() correctly finds no lock in it. Suite: 15/15 offscreen with the lock held, and green on Wayland except the pre-existing querycompleter screenshot flake, which fails to grab under Wayland and passes offscreen.
2026-08-06fix(sync): hold tag edits made during a background syncDanilo M.1-0/+203
A tag edit sent while another process holds notmuch's write lock does not fail: the read-write open blocks and then succeeds. Measured against Slackware's notmuch, 9.158s against a 12s hold, status SUCCESS. Since the worker is a single thread, that blocked open holds up every read queued behind it, so the message pane freezes on whichever thread was selected first and replays the queue when the lock releases. The window now defers instead. While SyncMonitor reports a sync running, a tag change is held rather than sent, and flushed when the sync ends. The optimistic update stands in the meantime, so the row keeps its tag and the edit still counts toward the unsynced indicator, which is what the quit prompt reads. The original diagnosis was that the open fails and the edit is discarded, and a retry was built on it. That was wrong: the error branch in notmuchworker.cpp is unreachable through lock contention. The premise was taken from a plausible-looking error path without provoking the condition, and measurement disproved it. The backlog entry records this rather than quietly correcting it. Verified by hand against a real blocking open, which the tests cannot reach: they drive the deferral through the meta-object and never take a lock. Both locks held for 100s with a tag edit made during the hold. Row kept the tag, status did not expire, indicator rose, window stayed responsive, held edit sent itself on release. The 2s SyncMonitor polling window is knowingly left open: a sync starting between polls is invisible for up to 2s and an edit there still blocks. SyncMonitor::lockHeldIn() would close it at the cost of one file read per tag action, and is recorded as the option to revisit. Also fixes revertPendingTagChange() clearing the entire undo stack after any rejected write, found while working on this. Backlog: item 37 done, and item 46 added for a test that fails only under the offscreen platform, where an 800x800 screen clamps a restored 940px window. Pre-existing and unrelated; the suite is green otherwise.
2026-08-05docs: reconcile backlog with usage notes, add items 39-45Danilo M.1-2/+263
The notes at the user's end are the upstream source and had drifted seven entries ahead of this document. Each new item's cause is verified against the code rather than restated from the note. Two are worth separating from the rest: - 41 is a defect. collectParts() files any part carrying a Content-Id into inlineParts and returns before the text/plain and text/html branches, so a message whose HTML body part has a content id parses with both body slots empty. That is one cause for both halves of the observation, a blank pane and "no HTML part". - 44 cannot be planned yet. It asks to manage filters applied at sync time, and no such filters exist here: MailSync runs one command and the script is mbsync plus notmuch new. The item needs the user to say where their rules live before it has a shape. Items 37 and 38 are deliberately left out of this commit; they document work that is built but not yet hand-tested, and belong with that code.
2026-08-04fix(sync): count unsynced edits as net state, not as writesDanilo M.1-1/+23
Item 28, reported by the user: open a thread, let the automatic mark-read remove `unread`, then press Ctrl+U to put it back. The indicator read "2 unsynced change(s)" with the mail store exactly where it started. The counter incremented per confirmed write and never decremented, so any add-then-remove of the same tag inflated it. Mark-read is simply the path that fires without being asked, which is why it surfaced there. The user's call was net state: an edit and its inverse are zero outstanding changes, because what the indicator answers is whether quitting now would strand work. A QHash keyed "<messageId>\n<tag>" replaces the int, and a pair that reverts is erased rather than stored with the new direction, so the map cannot grow without bound across a long session of tagging and untagging. Keyed per (message, tag) rather than per message: removing `unread` and adding `flagged` on one message are independent changes and must not cancel each other. A change carrying no message ids cannot be netted against anything and is counted separately, since dropping it would understate the indicator, which is the direction that costs work. Both properties item 18 established still hold: a successful sync clears everything, a failed one clears nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(ui): make Delete a toggle, and expire transient status messagesDanilo M.1-2/+38
Items 16 and 33. Delete now removes the `deleted` tag when every selected thread already carries it, so pressing it twice puts a thread back. One direction for the whole selection, never per row: toggling each independently would leave a single keystroke with the selection in two states, which is worse than either outcome. Status messages are classified rather than blanket-timed, which is the substance of item 33. Events expire after six seconds and fall back to the last query's thread count: "Sync complete", "Nothing to undo", the skip notice, the per-action "Archive: 3 threads". State does not expire: "Searching...", "Syncing...", the selection count, and "Sync failed (exit N)", because an error must not vanish before it is read. A test caught a mistake in that routing. Making the per-action message transient armed the timer during select-all, since tagSelected() runs on a selection onSelectionChanged() had just described, and the count would then be replaced while it was still true. Writing the count now cancels any transient still counting down. QStatusBar::showMessage() would give the same behaviour but the label is added with addWidget() beside permanent widgets, so adopting it means reworking that arrangement. One timer beside the label is the smaller change. Both fixes verified by reverting them and watching the tests fail. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: record item 36, and mark 24/25 done in the tableDanilo M.1-2/+47
Two 0.8.0 defects could not be given regression tests because test_mainwindow has no notmuch database, so threadLoaded never fires: the queued reply repainting a blanked pane, and a local sync reporting itself as a background one. Both were verified by hand and by a standalone model, and the first guard is still untested. tests/notmuchfixture.h already does what is needed and test_notmuchworker already uses it; test_mainwindow does not. So the item is wiring, not new machinery. Records that a corpus built from real mail was considered and rejected: the rule against personal data in fixtures forbids it, hooks enforce it, the repo is public, and one surviving In-Reply-To header names a real correspondent. Minimal hand-written .eml files reproducing a message's shape are the supported route, as truncated.eml already is. Deferred by the user until a defect needs it. Wiring it with nothing to test proves nothing. The table also still showed items 24 and 25 open; both shipped in 0.8.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04fix(ui): name the default button on the quit promptDanilo M.1-1/+17
Item 31. The user could not tell which button Enter would press on the unsynced-changes dialog. The code was already correct: setDefaultButton() is called, and Qt agrees, isDefault() and hasFocus() are both true on "Sync and quit". The active style, qt6ct-style, simply draws no visible default-button decoration. The GIMP dialog offered for comparison is GTK drawing its own focus ring, a different toolkit. Naming the default in the text rather than restyling the button: overriding the appearance means fighting the user's theme, which is worse than one word. The safe option was already the default, so no behaviour changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(ui): disable Sync during a background sync, and blank the pane on EscDanilo M.1-2/+34
Items 29 and 32. 29 was a constraint item 27 specified and that shipped unbuilt: while a cron sync held the lock the Sync button stayed clickable, and pressing it could only produce the EX_TEMPFAIL skip. The progress bar and the button are now written by one updateSyncControls() taking both sync sources, which the item asked for by name: two independent assignments, one per path, means whichever finishes second wins, so a background sync ending would re-enable the button in the middle of a local run. Unknown re-enables the button, deliberately. It means /proc/locks could not be read and nothing was observed, so leaving the button disabled would strand it permanently wherever the lock cannot be seen. 32 adds a clear_pane action on Esc. It clears m_currentThreadId with the pane, not merely alongside it, or a threadLoaded still in flight would paint the thread straight back; and it cancels any pending mark-read, since a thread blanked from view must not be marked read two seconds later. The selection, the query and the undo stack are untouched. The one real risk in 32 was Escape being stolen from the query completer, the way Return was once lost to a window shortcut. Probed rather than reasoned about: a popup consumes the key before a window-level shortcut sees it, so the completer still dismisses. Every test here was verified by reverting the code it covers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: record items 28-35 from the user's notes, and how to keep them in syncDanilo M.1-1/+331
The backlog is downstream of the user's own notes, which they add to while using the app. Comparing the two turned up nine entries with no item here, two of them defects rather than enhancements: - Re-adding `unread` after the automatic mark-read counts 2 unsynced changes when the mail store is back where it started. The counter counts writes and never decrements, so any add-then-remove of the same tag inflates it (item 28). - The Sync button stays enabled while a background sync holds the lock. That was a written constraint of item 27 and shipped unbuilt, which is the strongest argument for doing this comparison at all (item 29). The rest are enhancements: a useful blank right pane, for which the user has produced the two logo images added here; a default button on the quit prompt, recorded as needing a repro because the code does set one; Esc to blank the pane; expiring status messages; a Maildir overview; and an automatic refresh after a sync. Item 35 is the one 0.8.0 deliberately did not build. A background sync reports rather than refreshes, because runCurrentQuery() clears the undo stack, the selection and the message pane. A non-destructive refresh is real work, so it is an item rather than a flag. Item 27 gains its outcome, including that its own proposed approach was the wrong one: flock -n acquires in order to test, so polling with it would have caused the exact skips the sync script reports. CLAUDE.md now carries the reconciliation step, since a note saying "X is broken" is a bug report that will sit in a personal file indefinitely unless someone goes looking. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: scrub account names from comments, tests and fixturesDanilo M.2-5/+5
Real Maildir account keys had reached comments and test data: provider-and-mailbox names across three source files, one of them carrying a surname, plus a real address used as example data in the notmuch test fixture and the design spec. The user's standing rule is that maildir and account names never reach a commit, and this is about to become a public repository, which is what makes it consequential rather than untidy. Replaced with generic keys that carry the same shape, since the length is the point in every one of these comments: a 33-character account tag is why the chip label exists and why the tag column was removed. The measurements stay. They are the evidence behind those decisions and are not personal details. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(sync): dismissable log pane, progress bar, and a skip that is not a failureDanilo M.1-0/+68
Four changes to the sync UI, three of them from using it. The log pane could not be dismissed. It is hidden at construction and shown on failure, and nothing ever hid it again, so a single failed sync left it on screen until the application restarted. It now sits in a container with its own Close button, and is 200px rather than 120, because mbsync's output is wide and repetitive and the shorter pane showed too little of it to read. It still appears only on failure, which the user confirmed is what they want. A sync gives no feedback while it runs. The status bar now carries an indeterminate progress bar for the duration, and the Sync button is disabled rather than left looking live. The bar is indeterminate on purpose: mbsync reports no percentage and the script's output is unstructured, so a bar filling left to right would be inventing a fraction nobody knows. The log is also cleared at the start of each run, since leaving the previous run's lines in place makes a stale failure look like the current one. The lock skip was reported as a failure. mailsync.sh exits when another run holds the lock, and that was exit 1, which qtmaildir reads as "sync failed": it showed the log pane and, on the exit path, told the user their changes were still unsynced. With a cron timer every ten minutes, a click landing inside a run is routine and none of that is true. The script now exits 75 (EX_TEMPFAIL) and the window reports it as its own case, saying a sync is already running. On the exit path it stays open and says plainly that the other run is most likely carrying the changes over but that this window cannot see it finish, rather than guessing either way. That last hedge is what item 27 records: the application cannot see a sync it did not start. The user chose continuous polling of the lock file over the narrower "only while quitting" version, and the entry notes that the lock is already the signal, so no status file is needed, and that a kernel lock cannot go stale where a written file can. Verified against stub binaries: a second run while the lock is held exits 75 and says SKIPPED, while the run holding it completes at 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(tags): add an Edit tags dialog on Ctrl+TDanilo M.1-1/+33
Five hardcoded tags were the only ones reachable from the UI: archive, delete, spam, flag and toggle_unread. For an application whose purpose is organising mail by tag, applying any other one meant leaving for a terminal. Item 26 of the usability backlog, raised by the user asking how to add a tag and finding they could not. One dialog rather than separate add and remove actions, at the user's choice: filing something under a new tag while dropping inbox is one thought, not two. Type tags to add or remove, comma separated, or clear a checkbox to drop a tag already on the selection without retyping its name. Both fields complete against the tag list MainWindow already holds for the query completer. Completion is a guard against typing shoppping beside shopping, never a whitelist: inventing a tag is the entire point, so any valid name goes through whether or not it exists yet. Tri-state checkboxes carry the multi-thread case, and are where the risk is. A tag on some selected threads shows partially checked, and leaving it alone changes nothing; the opposite reading would silently tag threads the user never looked at. A tag already on every thread and left checked is likewise not a change and is not sent as one. Tag names are validated before anything is applied, through a free function so the rules are testable on their own. Empty, a leading dash (notmuch's CLI reads it as removal, making such a tag a trap), whitespace and control characters are refused by name and reason. Nothing is applied until the whole set passes, since the user cannot tell which half of a partial change landed. TagDialog is pure UI: handed the vocabulary and the current state, returning two lists, contacting no worker. That is what lets its fifteen tests run without a notmuch database. Integration is a single call to the existing tagSelected(), so undo, the optimistic model update, the combined multi-row query and the completer refresh for a brand-new tag all come for free. One test assumption was wrong and the code was right: a case asserted that QStringLiteral("null\0byte") truncates at the null and reads as empty. It does not, so the null is caught as a control character. The test was corrected rather than the validator. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: add item 26, no way to tag from the UIDanilo M.1-0/+43
The user asked how to add a tag to a message and the answer is that you cannot: every tagging action writes a hardcoded name, so archive, delete, spam, flag and toggle_unread are the only tags reachable from the UI. For an application whose purpose is organising mail by tag, that is a hole worth its own item rather than being folded into item 25. The plumbing is already there. tagSelected() takes arbitrary add and remove lists, applyTagsToThreads() handles multi-row selections in one query, undo works, and the completer already holds every tag in the database, which is what makes completing the dialog's input the obvious guard against creating 'shoppping' beside 'shopping'. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: add items 24 and 25 from the user's notesDanilo M.1-0/+60
Right-click actions on the thread list, and select-all for bulk tagging. Item 24 records that there is no context menu anywhere in the application: no contextMenuEvent override and no CustomContextMenu policy in src/. The actions themselves already exist as QActions, so the work is presentation, with one trap worth naming: right-clicking does not change the selection in Qt, so a menu built naively would act on the row under the cursor while the user is looking at several selected rows. Item 25 is smaller than it sounds, and the entry says why. The thread view is already ExtendedSelection and tagSelected() already acts on every selected row through one combined query, so Ctrl+click bulk tagging works today. What is missing is a select_all action, which does not exist for the list, and any indication that multi-select is possible at all. It also carries a caution: select-all over a 10k-thread query turns a rare accident into a routine keystroke, and the combined-query design should be measured against a real query before the binding ships rather than assumed to scale. Both are the user's own observations; the plan did not carry either. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(sync): show unsynced edits and offer to sync on exitDanilo M.1-2/+53
Tagging changes the notmuch index at once, but the mail store only hears about it on the next sync, and nothing said so. Quitting with tagging outstanding was silent. Items 18 and 19 of the usability backlog, built together because the second needs the first's counter. The counter cannot be QUndoStack::isClean(), which is the obvious candidate and the wrong one: the undo stack is cleared on every query, since its entries refer to rows the new result set discards. Tag a thread, run any query, and the stack is empty while the change is still unsynced. m_pendingEdits is its own count, incremented where a write is CONFIRMED rather than where one is sent, so an optimistic update the worker later rejects cannot leave the indicator claiming an edit that never landed. Only a successful sync resets it: clearing on failure would assert the changes had reached the mail store when the sync is exactly what failed to put them there. It is shown in the status bar, hidden entirely at zero, and described as a lower bound rather than a guarantee, since an external notmuch run can carry changes over without this application noticing. On exit, sync_on_exit in [general] takes ask, always or never. Three values rather than a bool because "prompt me", "just do it" and "do nothing" are three behaviours and true/false expresses two; an unknown value warns by name, since a typo there silently changes what happens to unsynced work. The prompt offers three buttons for the same reason: a user who hit Quit by mistake needs a way back that is not "sync". A sync started at exit holds the window open until it finishes rather than being killed mid-run, and a sync that FAILS does not quit, because quitting there would discard the user's choice silently. With no sync command configured the prompt degrades to a plain warning instead of offering a sync that cannot run. This is not a destructive-action confirmation of the kind CLAUDE.md forbids. Those cover tag mutations, which keep undo instead of a dialog. This asks about losing work at the one point where undo cannot help. The tagsApplied lambda became a named slot, which is better structure and also what lets a test drive it: the worker is deliberately parentless because it moves to its own thread, so reaching it with findChild to emit the real signal cannot work, and contorting the test to try was the wrong instinct. Testing a modal needed its own care. A test that sends a close event hangs forever if an unexpected dialog opens, because the modal spins its own event loop; CloseProbe polls for activeModalWidget, closes it and records that one appeared, turning "a dialog opened" into an assertion rather than a hang. Also removes a stray qDebug left in the open_thread action by the earlier Enter-key investigation, which had reached two commits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: add items 21-23 and refine item 5 from the user's notesDanilo M.1-0/+109
Four items from the user's own notes that this document did not carry. Item 5 gains two concrete sub-items: a star column for flagged threads, mirroring the paperclip, and the observation that everything looks unread. The second is recorded with a warning rather than as a defect, because bold is already conditional on isUnread() in the model; either the list really is mostly unread or bold leaks through some other path, and that has to be reproduced before the font logic is touched. Item 21, better default shortcuts, records why the defaults moved once already: a bare letter cannot be a menu accelerator, and a bare capital parses to a key no keystroke emits. Both still constrain a second pass, as does the rule against testing reachability with synthetic input. Item 22 is the translatability audit CLAUDE.md has owed since the tr() rule was written, plus the loading machinery, which does not exist at all: no QTranslator, no .ts files, no CMake rule. Those are separate sizes and the item says so. Item 23, saving a query from the UI, carries the one real design question with it: whether the write lands in the hand-edited config or the state file. Saved queries are user intent rather than machine state, which argues against the split item 1 established, so the decision is flagged rather than assumed. It also notes that item 23 may answer postponed item 10 as a side effect, since account-scoped saved queries were exactly what item 10 proposed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(threads): mark an opened thread read after a delayDanilo M.1-2/+46
Opening a thread left it tagged unread, so the unread count never matched what had actually been read and the app was quietly wrong every day it was used. Item 6 of the usability backlog. A single-shot timer, armed when a thread is selected and restarted rather than stacked, so arrowing down a list marks only the thread still selected when it fires and not every one passed through. Configurable through mark_read_delay_ms in [general], defaulting to 2000: zero marks read at once, and any negative value disables the behaviour, which is why the value is neither clamped nor warned about at either end. The automatic change deliberately does NOT go on the undo stack. It routes through sendThreadTagChange() rather than tagSelected(), because undoing an action the user never took is worse than leaving a thread read, and toggle_unread already gives them a direct way back. It still funnels through the single applyTags path; what differs is only whether the inverse is pushed, which is a window-level decision above the worker. An explicit toggle_unread cancels any pending timer, or marking a thread unread by hand would be reversed a moment later and the key would look broken. Two guards beyond the plan, both from asking what happens when a timer outlives the thread it was armed for. Arming is skipped for a thread that is not unread, so no write is scheduled that would change nothing, and the handler re-checks that its thread is still selected and still unread before writing, so a stale timer does nothing rather than tagging the wrong thread. The plan expected the rapid-arrow case to need a database and a manual check. It needs neither: ThreadListModel takes threads through appendBatch(), so the case is unit-tested. All three tests were confirmed to fail against deliberately broken versions, one arming for read threads and one creating a timer per selection instead of restarting one. Item 7 is closed in the same pass. The user verified against real mail that HTML messages already open as HTML, which is what the item asked for, so it is recorded as done with no code changed. The prefer_html key it floated was not added: nobody has asked to default to plain text, and Ctrl+H already switches a thread by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat(message): show From/To/Cc and add a details dialogDanilo M.1-1/+32
MimeParser has filled To and Cc all along and HtmlBuilder simply never interpolated them, so both were parsed on every message and then discarded. The header strip showed the subject and a message count and nothing else, which is item 2 of the usability backlog. The header now adapts to what it can say honestly. A thread holding one message shows From, To and Cc under the subject, where every field is unambiguous. A thread holding several keeps showing the subject and the count alone: the recipient differs message to message, and once the user has replied there is no single address the thread is addressed to, so naming one would be a guess presented as a fact. Per-message detail is what the dialog is for. That dialog lists Subject, From, To, Cc, Date and Message-Id for every message, numbered when there is more than one, in a read-only plain-text widget. Plain text is the security decision, not a stylistic one: these values come from strangers and the dialog exists to show them verbatim, so the format that cannot interpret markup is the right one. The header label is RichText and every value interpolated into it is escaped, since an unescaped From injects into the application's own chrome rather than into the sandboxed page. Reached by a Details... button beside the subject and by Ctrl+Shift+D. Both, because a shortcut alone restates the complaint this backlog opened with. The binding is shifted because Ctrl+D is delete, and the destructive action keeps the key it already had rather than being moved to make room. An empty Cc omits its row instead of printing a label with nothing after it. Both header shapes were rendered to PNG and inspected, not only asserted. The new button also exposed a latent flaw in an older test: attachmentButtonLabels() identified attachment buttons by excluding the one other button's label, so it counted the details button as an attachment as soon as one existed. It now finds the bar by object name and reads only its children. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: record the item 2 decision, postpone 10, add items 18-20Danilo M.1-4/+178
Item 2 (message details) gains the user's decision on where the details go. The header adapts to what it can say honestly: a single-message thread shows From, To, Cc and Subject, while a multi-message thread keeps showing only subject and count. Everything else moves to a popup behind a button on the right of the header. An earlier draft also put a recipient line on the thread header, which forced a choice between the union of recipients and their intersection and would have needed real address parsing to compute either. The user called that overcomplicating and dropped it, so no address parsing is needed and the item is UI work over strings MimeParser already fills. The item's own "check before building" question is answered in place: To and Cc are parsed at mimeparser.cpp:344-345 and then dropped at the renderer, which never interpolates them. The larger task it warned about does not exist. Item 10 is postponed at the user's request rather than dropped: the complaint was real and the cheap first fix it proposes still stands, it is simply not wanted now. Only its startup-query half ever shipped. Items 18 and 19 come from the user's own notes and were missing here: a visual cue for unsynced edits, and a sync-on-exit prompt with a config option. 18 records a finding that shapes both: the QUndoStack looks like a record of pending edits but is cleared on every query, so it cannot drive the indicator and a separate counter is needed. Item 20 records, unspecified, that the user's mental model of the thread view differs from what was built. Nothing is designed there yet; the next step is asking what they pictured. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: document query completion config and shortcutDanilo M.1-1/+1
Records what shipped rather than what the plan drafted: path: is the only prefix beyond tag:/is:/date:/mimetype: that offers values, and completion_on_focus defaults to false. The extra_mimetypes syntax needs both separators explained, since ',' splitting is QSettings' own behaviour and '|' exists only because a description may contain a comma.
2026-08-04docs: add the query completion implementation planDanilo M.2-3/+1658
Twelve tasks, TDD throughout, tokenizer first: the parsing rules are where the defects will be and they need neither a widget nor a database to test. CompletionEntry gets its own header. Config needs it and QueryCompleter needs Config, so declaring it in querycompleter.h would make the two headers include each other. Also corrects the spec: NmTags already exists in nmraii.h, it does not need adding.
2026-08-04docs: make the mimetype completion list user-extensibleDanilo M.1-3/+44
Mimetypes are the one completion list with no enumerator and an open-ended set, so [completion] extra_mimetypes appends to the built-ins. Appending rather than replacing means a typo or a short list cannot leave completion worse off than the defaults. Entries are comma-separated with an optional description after '|'. The two separators differ because QSettings splits comma lists itself, so a description containing a comma would otherwise be torn into two entries. The other lists stay fixed: prefixes come from notmuch, paths from the configured accounts, dates are closed once symbolic and relative forms are covered, and tags are read from the database. A user-editable copy of any of them would only drift from its source. For prefixes specifically, the upgrade path is deriving the list from the installed notmuch, not making it editable.
2026-08-04docs: spec query bar completion, require translatable stringsDanilo M.1-0/+240
Design for backlog item 17. Completion covers query prefixes, tag values, date values, path values and mimetype values, each carrying a description so the bar documents the query language while it is typed. A new QueryCompleter class owns it, with the cursor-context tokenizer as a pure function so the parsing rules are testable without a widget or a database. NotmuchWorker gains an all-tags call, which did not exist. Addresses for from:/to: are out of scope: libnotmuch exposes no all-addresses call. Both prefixes still appear so the vocabulary reads complete. Account maildirs belong to path:, not folder:. Account::scopedQuery builds path:"<maildir>/**", and folder: is a different matcher in notmuch, against the folder name rather than the directory path. Also records the translatable-strings rule in CLAUDE.md. Existing code is not yet audited against it.
2026-08-04build: add a SlackBuild under assets/slackbuildDanilo M.1-1/+1
Packages the application for Slackware, following SBo conventions with two deliberate departures: the tag is _danix rather than _SBo and the package type is txz rather than tgz, since this is not an SBo submission. sbolint reports exactly those two as errors and nothing else; the template comments it warned about are gone. Written against the install layout the build really produces, checked by staging it: one binary, one .desktop entry and one scalable icon, no libraries and no man or info pages. The template's .la removal, man and info compression and perllocal.pod cleanup would all act on nothing here, so they are left out rather than carried along as dead code. doinst.sh keeps only the desktop-database and icon-cache updates. The download URL and checksum are verified rather than assumed: sbodl fetches the tarball and reports "md5sum matches OK". Adds QTMAILDIR_BUILD_TESTS, defaulting to ON so the ordinary build is unchanged. A packaging build has no use for the test binaries, and building them pulls in Qt6::Test to produce nothing that ships. Note the 0.4.0 tarball predates this option, so with that source the flag is accepted but does nothing; the README says so. notmuch is the only dependency outside Slackware. Qt6 including WebEngine, gmime and cmake are all stock, which is what REQUIRES reflects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat: make attachments reachable from the message paneDanilo M.1-1/+47
The attachment bar had been an empty placeholder since it was written: MessageView created it and added it to the layout, and nothing ever put anything in it. MimeParser had been extracting attachments the whole time and Attachment::saveTo() already carried the path-traversal guard, so the backend needed calling rather than writing. The bar holds one "Attachments (N)..." button whatever the count. One button per file was built first and was wrong: a thread with sixteen of them made the bar as wide as the window, pushed the splitter over and left the thread list a few pixels wide. The button opens a dialog listing message number, filename and size with a Save each, and a "Save all..." when there is more than one. Save all writes into a new subdirectory named "<date> <subject>" inside a parent the user picks, rather than dropping sixteen files loose among whatever is already there. Zipping was considered and rejected: Qt ships no zip API, so a real archive meant a new build dependency or shelling out to /usr/bin/zip at runtime, and a subdirectory answers the actual requirement. The picker names the subfolder before the user commits to a location. The subject is attacker-controlled and becomes a directory name, so attachmentFolderName() sits beside the other guards in mimeparser.cpp: it strips separators, control characters and leading dots, caps the length, and falls back to a generated name. Its test asserts that every hostile subject still resolves inside the parent directory. Two defects surfaced while using it, both silent: saveTo() overwrites an existing file, and several messages in one thread commonly attach the same filename. Saving that thread destroyed six of sixteen files while reporting all sixteen as saved. The batch path now uses saveWithoutOverwriting(), which appends " (2)" before the extension and keeps a compound extension whole. Qt::RFC2822Date rejects a Date header that carries a timezone comment, "+0200 (CEST)", which is legal per RFC 5322 and common in real mail. Qt refuses the entire string rather than ignoring the comment, so every such message lost its date prefix. Comments are stripped before parsing. Opening an attachment in its default application is deliberately not included: handing a file from a stranger to xdg-open is a different security decision from writing it where the user asked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04docs: add backlog items 15 to 17 from usage notesDanilo M.1-0/+103
Attachments turned out to be a real gap rather than a discoverability one. MessageView creates the attachment bar and adds it to the pane, but nothing ever populates it: m_attachmentBar appears nowhere else in the codebase, so it has never displayed anything. MimeParser already extracts attachments and Attachment::saveTo() already carries the path-traversal guard, so the backend needs calling, not writing. Item 16 makes delete a toggle, with the open question of what a mixed selection should do. Item 17 needs a new worker call, since there is no way to list tags today. Also records that this document's numbering and the user's own notes have diverged, so a reference to "item 13" stays resolvable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat: choose the startup query by nameDanilo M.1-0/+15
The app opened whichever saved query sorted first alphabetically, which is not a choice anyone made: [queries] is read through childKeys(), so savedQueries().first() means "Flagged" before "Inbox" before "Unread" rather than anything the user expressed. [general] startup_query names the entry to open and defaults to Unread, so a fresh install comes up on the unified unread list. Saved-query button order is untouched and stays alphabetical. A name matching no saved query falls back to the first one rather than starting with an empty view. That is reported as a problem only when the user actually wrote the name; the built-in default naming a query they never created is not something they got wrong, and warning about it would fire on every launch of a config that has no Unread entry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04feat: own the message-pane zoom and persist itDanilo M.1-1/+33
Zoom was Chromium's, not the application's: the web view handled the keys natively and never told anyone, so there was no value to save. qtmaildir now owns it. Zoom in, out and reset are real actions, in the View menu and rebindable through [keys], and the factor is persisted to the UI state file. Ctrl+wheel over the body zooms and Ctrl+middle-click resets, both filtered by ancestry from an application-level filter: the events are delivered to an internal QQuickWidget the web view creates lazily, so a filter on the view itself never sees them. The factor is clamped to 0.5 - 3.0, and NaN, infinity, zero and negative values fall back to 1.0, since a corrupt state file must not be able to leave the pane unreadable with no visible way back. Both risks the plan flagged turned out not to exist, verified by probe rather than assumed. The application QAction wins over the web view's native zoom key, so the tracked factor cannot diverge from what is on screen. And the factor survives setHtml(), so the web view is the single source of truth and needs no reapply per render. A third finding is worth recording because it produced a wrong fix first. A probe using QTest::keyClick() reported Ctrl++ as a dead binding, and a test was written asserting that. Both were wrong: Ctrl++ is exactly what the '+' key emits on an Italian layout, confirmed against the real keyboard, and it is the shipped default. Whether a symbol needs Shift is a property of the layout, not of Qt, and keyClick() reproduces neither. The test now only checks that every default parses, and the comment in defaultBindings() says not to re-derive this from synthetic input. Ctrl+= is a second binding for reset, skipped when [keys] gives it to something else. Also fixes a pre-existing bug the new config key exposed. [general] entries were read as "general/<key>", which matches nothing: QSettings' INI backend treats a section literally named [general] as its own fallback section and strips the prefix. notmuch_config had therefore never worked. Both keys are now read without it; the file format is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>