aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
8 hoursbuild: point the SlackBuild at the 0.4.1 tarballHEADmasterDanilo M.1-3/+3
The URL and checksum are taken from the published snapshot rather than predicted: sbodl fetches it and reports "md5sum matches OK", and the tarball is confirmed to carry the QTMAILDIR_BUILD_TESTS option, so -DQTMAILDIR_BUILD_TESTS=OFF now takes effect where it was silently ignored with 0.4.0. The copy of the .info inside the v0.4.1 snapshot itself still names 0.4.0, since a snapshot cannot contain its own checksum. That copy is not the one anyone builds from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 hoursrelease: 0.4.1v0.4.1Danilo M.4-5/+18
Packaging only. The 0.4.0 tarball predated QTMAILDIR_BUILD_TESTS, so a package built from it accepted -DQTMAILDIR_BUILD_TESTS=OFF and ignored it. This tag is the first whose source honours the flag. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 hoursbuild: add a SlackBuild under assets/slackbuildDanilo M.8-4/+218
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>
8 hoursrelease: 0.4.0v0.4.0Danilo M.3-1/+62
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 hoursMerge branch 'feature/attachments'Danilo M.13-5/+794
Attachments become reachable: a paperclip column marks the threads that carry one, and the message pane's attachment bar, an empty placeholder since it was written, now lists them with save and save-all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 hoursfeat: make attachments reachable from the message panefeature/attachmentsDanilo M.7-3/+639
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>
8 hoursfeat: show a paperclip for threads with attachmentsDanilo M.6-2/+155
An attachment was only discoverable by opening the thread. A narrow leftmost column now marks the threads that carry one. No new worker query is involved: notmuch applies the "attachment" tag while indexing, so ThreadSummary already holds what this needs. The marker is a glyph rather than an icon resource, which ships no new asset and inherits the row font, so it strikes through with a doomed thread like every other cell. It falls back to "*" where the system font cannot draw U+1F4CE, since an unrenderable codepoint reads as breakage rather than as a marker. Two silent Qt behaviours had to be handled, both found by probe: QHeaderView::restoreState() returns true for a blob saved against fewer columns and applies the old widths shifted one place right. Adding a column in front would therefore have mangled every existing saved layout with no error to detect it by. The column count is now stored beside the blob and a mismatch discards it, so the widths reset once on upgrade instead of landing on the wrong columns. QHeaderView's default minimumSectionSize is 58px on this platform, and setColumnWidth() clamps to it without reporting the smaller value back, so the column could not be narrow at all until it was lowered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursdocs: 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>
9 hoursrelease: 0.3.0v0.3.0Danilo M.2-1/+52
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursMerge branch 'feature/ui-state-persistence'Danilo M.14-12/+701
Persistence cluster from the post-0.1.0 usability backlog: window, splitter and column geometry survive restart, the message pane owns its zoom and remembers it, and the startup query is chosen by name instead of by alphabetical accident. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
9 hoursfeat: choose the startup query by namefeature/ui-state-persistenceDanilo M.6-3/+148
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>
9 hoursfeat: own the message-pane zoom and persist itDanilo M.13-3/+385
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>
10 hoursfeat: persist window, splitter and column widthsDanilo M.4-6/+168
Resizing the window, the splitter or a thread-list column was undone by the next launch. State now round-trips through a separate settings file at ~/.local/state/qtmaildir/uistate.conf, written on close and read at startup. The state file is deliberately not the user's config: a base64 geometry blob does not belong in a hand-edited file, and rewriting that file on exit would drop its comments and key order, which QSettings does not preserve. Two details that are easy to get wrong: QStandardPaths::StateLocation appends both the organization and the application name, and both are "qtmaildir" here, so it resolves to ~/.local/state/qtmaildir/qtmaildir. The path is built from GenericStateLocation instead, matching Config::defaultPath(). Restore runs after buildMenus() rather than at the end of buildUi(): QMainWindow::restoreState() matches toolbars by object name and silently drops the position of one that does not exist yet. Every restore is conditional on a non-empty blob, so a missing or rejected state file leaves the built-in defaults instead of producing a zero-size window. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
10 hoursrelease: 0.2.0v0.2.0Danilo M.2-4/+33
10 hoursMerge branch 'feature/qaction-menus'Danilo M.30-169/+2174
Menus, a toolbar and a generated shortcut reference, built on converting the action registry from a hash of callbacks to QActions. Along the way: three default key bindings that had never fired, a shortcut dialog taller than the screen, thread list columns that could not be resized, no visible feedback that a tag action had landed, and a tags column so wide it was unreadable. Backlog items 3, 8, 9, 13 and 14 done; 11 partly.
10 hoursfeat: use the application iconfeature/qaction-menusDanilo M.8-4/+141
The icon was committed in a previous session and referenced nowhere: no qrc, no .desktop entry, no setWindowIcon. It is wired up now, as a window icon, a desktop entry, and install rules placing both into hicolor and share/applications. resources.qrc belongs to the executable rather than to qtmaildir_lib. A qrc compiled into a static library registers itself from a global initialiser, and the linker discards that object because nothing references it: the build succeeded, qInitResources_resources() was present in the .a, and QFile::exists(":/icons/qtmaildir.svg") still returned false at runtime. Verified loading at 16, 32 and 64 pixels after the move. Toolbar and menu actions take icons from the system theme by their standard names, so they match the rest of the desktop rather than shipping bespoke art. A theme lacking one leaves that action as text, which still works.
10 hoursfeat: let an account set its chip colour and labelDanilo M.4-2/+77
Two optional keys in an [account.<key>] stanza. color fills the chip, label sets its text. Both belong to the account rather than to [tagcolors] because an account tag is a different taxonomy: which mailbox a thread arrived in, not what state it is in. label is display only. "account-privateemail-danilo.macri" is a lot of row for one bit of information, but the notmuch tag is never renamed, so existing queries and external tagging are unaffected. Unset falls back to the account key, and an empty label is ignored rather than rendering a blank chip.
10 hoursfeat: render tags as chips instead of a text columnDanilo M.13-15/+1052
Spelled out per row, tags ran to 500 pixels of largely repeated text and took most of the thread list's width. The column is gone; tags render as coloured chips split by what they actually mean. An account tag says which mailbox a thread arrived in, and draws as a chip in front of the subject. A functional tag says what state a thread is in, and those fill one row under the message pane. One row keeps the message area from shifting between threads with different tag counts, so whatever does not fit collapses into a +N chip that names the rest in its tooltip. TagColors resolves a colour by exact tag first, then by top-level prefix, so a single "shopping" entry covers shopping/amazon and shopping/nike while shopping/amazon can still override its own. That matters at 96 tags. Built-in defaults cover the usual state tags, and anything left unconfigured falls back to a hash of the name, stable so a chip does not change colour as the list scrolls.
10 hoursfeat: make every thread list column resizableDanilo M.1-7/+10
Subject was Stretch, which computes its own width and discards a drag, so it alone could not be resized. Every column is Interactive now. Nothing absorbs spare width as a consequence, so the view scrolls horizontally instead of squeezing columns when their total exceeds the viewport. Per-pixel, so scrolling does not jump a column at a time.
11 hoursfix: let the thread list columns be resized againDanilo M.1-4/+9
Tags, Date and From were set to ResizeToContents while fixing the pushed-off-screen Tags column. That mode computes the width itself and discards a drag, so the columns stopped being resizable. Verified: with ResizeToContents a request for 250px yields 150, with Stretch 478, with Interactive 250. The reorder alone already fixed the original bug, since Subject stretches and is last, so nothing can be pushed past it. Locking the other three was unnecessary and also blocked the saved-column-widths item, which needs widths a user can actually set. They are Interactive again, with starting widths a drag overrides.
11 hoursfeat: show that a tag action landedDanilo M.7-5/+218
Selecting a thread and hitting Delete changed nothing on screen, so there was no way to tell the action had stuck. The tag was always applied: applyTagChange() emitted dataChanged across the row, and the Tags column did update. But Subject was set to stretch while Tags came after it, so Subject took all free width and pushed Tags out of view. The feedback lived in the one column that could not be seen. Columns are now Tags, Date, From, Subject, with Subject stretching last so nothing can be pushed off the right edge. A thread tagged deleted or spam fills its whole row, muted red or orange with white struck-through text, through the background, foreground and font roles, so no cue depends on one column remaining visible. Strike-through accompanies the fill on purpose: it survives a theme that overrides backgrounds and reads without colour. Bold for unread still composes with it. Archive adds no tag, so an archived row is left unstyled for now.
11 hoursfix: keep the shortcut reference inside the screenDanilo M.1-12/+45
Fourteen actions in one table made a dialog taller than the display, which pushed its own title bar off the top. The rows are split into two columns of seven, with the closing note spanning both. QMessageBox is replaced by a plain QDialog. The message box wraps its text at a narrow fixed width, which broke every description into a column of single words and was most of the height: 719x1084 before, 1426x366 after.
11 hoursfeat: add menus, a toolbar and a shortcut referenceDanilo M.8-130/+439
Actions were a QHash of std::function dispatched by an event filter, which nothing could put in a menu. They are QActions now, bound from KeyMap so a [keys] override reaches the menus as well as the keyboard. Menu bar covers every action; the toolbar carries only Sync, Archive, Delete and Undo. Help > Keyboard shortcuts is generated from the actions, so it shows what the keys really do rather than a copy that drifts. spam and load_remote gained defaults, having been unreachable without a hand-written binding. The event filter is gone. Probing showed QAction shortcuts are dispatched before the focused widget sees the key, so they beat QAbstractItemView's type-to-search without one, and Qt already suppresses plain-letter shortcuts while an editable widget has focus. Dropping the filter's blanket guard also lets Ctrl+Q work while the query bar has focus. registeredActionNames() is derived from the actions rather than hand-maintained, so the two drift tests it needed are replaced by checks that a configured binding reaches its action. No confirmation dialogs: tag mutations still answer to undo.
11 hoursfix: bind shortcuts users can actually pressDanilo M.3-32/+225
Typing a capital emits Shift+<key>, but QKeySequence::fromString() folds the case of a bare letter away: "N" parsed to plain Key_N, a combination no keystroke produces. The N, F and G defaults (toggle_unread, flag and sync) therefore never fired, and neither would any hand-written capital in [keys]. normalizeSequence() rewrites a bare capital to Shift+<letter> and is shared by the defaults and the override pass. As a side effect "y" and "Y" become distinct keys rather than a collision that dropped one. Defaults move to modifier shortcuts throughout. A single letter cannot be a QAction shortcut without stealing that letter from every text field in the window, and the menus in the next commit need real accelerators. defaultBindings() is now the one source of truth for them.
14 hoursdocs: add post-0.1.0 usability backlog and app iconDanilo M.2-0/+354
Collects the items found while actually using 0.1.0. Two clusters dominate: state that does not survive restart (splitter, zoom, account selection) and actions reachable only by memorized keys. The plan is open by design rather than a fixed release scope. Numbering is stable so notes referring to an item keep meaning the same thing. Decisions recorded while triaging: - UI state goes to its own file, not qtmaildir.conf. That file is hand-edited and rewriting it on exit would eat comments QSettings does not preserve. - Auto-mark-read stays off the undo stack. An explicit toggle_unread action already exists, so Ctrl+Z need not undo an action the user never took. - Zoom is Chromium's, not ours. No setZoomFactor call exists in src/, so persisting it means taking ownership of zoom first. Icon is a tag rather than an envelope, since tagging is the core interaction and an envelope would not distinguish it from any other mail client. Verified legible at 16x16, which is where it is mostly seen.
14 hoursdocs: remove personal details from the verification recordDanilo M.3-20/+21
The manual verification notes named the real threads used to test against a live mailbox. Most of it was incidental, but one was not: the automated sender identified in items 12, 13 and 16-18 is a healthcare provider's patient-notification service, and naming it disclosed a medical relationship. Also removed a correspondent's username, a locatable GitHub thread id, a real maildir name in the spec's example config, and absolute home paths. Every finding is restated generically and none lost substance: "a message with 3 inline cid: parts" carries the same technical weight as naming the sender did. Counts and timings are kept deliberately, since those are the evidence behind the claims rather than anything identifying. Commit history and the v0.1.0 tag were checked and were already clean, so no history rewrite is needed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: add README, changelog and release procedurev0.1.0Danilo M.3-0/+351
README covers what the project deliberately does not do (no POP, IMAP or SMTP, no send in v1, no confirmation dialogs), the verified dependency versions, build and test commands, the full config format with the reasons behind its two surprises, the keybinding table, and the security posture of the message view. Two facts in it were checked rather than assumed: the `spam` and `load_remote` actions are registered but have no default binding, so they are documented as unreachable until bound; and the attachment path guard does exist as described. The Release build was also verified to pass all 11 test binaries, which matters because Q_ASSERT compiles out there and one of the cid: invariants leans on an assertion in debug. CHANGELOG.md follows Keep a Changelog and records 0.1.0 along with the current known limitations. docs/RELEASING.md records what semver means for a mail client (the config format and action names are the public interface) and the steps, including that the version is bumped in exactly one place. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursfeat: surface the version and adopt semantic versioningDanilo M.2-1/+9
The version was declared in the project() call and used nowhere. It is now generated into version.h from that single declaration, so nothing repeats the literal, and it reaches the places it is actually wanted: --version, --help, the window title, and QApplication. --version and --help are answered before the web engine schemes are registered and before QApplication is constructed. Printing one line does not need a GUI, and both must work on a machine where the GUI cannot open. Staying at 0.1.0 rather than calling this 1.0.0: under semver, 0.x is where the interface may still change, and for this project the interface is the config file format and the bindable action names. Both are one manual verification pass old. 1.0.0 becomes a deliberate decision to stop changing them under users. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursAdd GPLv2-only license and per-file headersDanilo M.41-1/+1101
Confirmed with the maintainer as v2-only rather than v2-or-later. LICENSE is the official text from gnu.org. Every file under src/ and tests/ carries the matching notice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: record manual verification items 16-20Danilo M.1-15/+66
Tag mutation (16-18) verified against three low-stakes 2023 notifications, with the index inspected before and after every step and the mailbox returned to its exact starting state. Bulk archive resolved two threads in one combined query, and undo re-resolved thread ids while those threads were outside the displayed result set, which is the case that design exists for. Sync (19-20) verified with the real mailsync.sh. start() does not block, a concurrent run is refused, and a run colliding with the flock returns exit 1 in 2 ms without corrupting anything. One caveat recorded rather than fixed: the script redirects its output to its own logfile, so MailSync captures nothing and the log pane stays empty even on failure. qtmaildir shows what the command emits and this command emits nothing; piping instead of redirecting in mailsync.sh would populate the pane with no change here. Twenty-one of twenty-two items now verified. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: record item 15 and summarise the manual passDanilo M.1-4/+41
Eleven of twenty-two items verified. Items 16-18 remain deferred until the tag-mutation path can be run with someone watching, 19-20 need a sync script, and 13 is unreachable with this mailbox and covered by a unit test instead. Records what the pass was worth: three defects, each living in the gap between components that were individually tested and correct. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: correct the commit hash for the keyboard fixDanilo M.1-1/+1
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: record item 12 and item 14 with the keyboard fixDanilo M.1-2/+31
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursfix: let key bindings win over the thread list's type-to-searchDanilo M.1-0/+9
With the thread list focused, 'h' jumped to the next thread whose subject began with "h" instead of toggling HTML, and j, k, a, d, N, F, u and G were swallowed the same way. The keymap only worked when focus happened to be somewhere else. installEventFilter(this) was on the MainWindow, and a window-level filter only sees key presses the focused child did not consume. QAbstractItemView consumes plain letters for its type-to-search feature, so it took them first. The filter is now installed on the thread view as well, which puts the keymap ahead of that search. The existing query-bar guard in eventFilter() still keeps ordinary typing working there. Found by the maintainer while walking task 13 item 14, and confirmed fixed on screen. No regression test: a QTest::keyClick attempt passed both with and without the fix, because synthetic key posting does not reproduce the focus and consumption path that causes the bug. A test that cannot fail is worse than none, so it was dropped rather than kept for appearances. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
15 hoursdocs: record manual verification items 4, 6-11Danilo M.1-6/+96
Items 4, 6, 7, 8, 9, 10 pass. Item 11 failed and was fixed in 9d13346. Two findings worth keeping beyond the pass/fail: The blank message pane (items 6, 9, 10) is exactly what this checklist existed for. Every layer was correct in isolation and the pane still showed nothing, because setHtml() does not navigate to the base URL it is given. No unit test would have caught it; the first click did. Item 7's initial failure was the checklist's fault, not the code's. The suggested query term came from the thread's subject line, so notmuch correctly matched all 22 messages and expanding them all was right. A test query has to partition on something that varies per message. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursfix: drop cached remote images when switching threadsDanilo M.1-0/+20
Granting remote content on one thread, moving to another and coming back showed the images again with the banner gone. The grant is documented as never sticky, and it was not: verified against a local HTTP server that the image is fetched exactly once, under the grant, and never re-requested. The interceptor's policy was correct throughout and allowRemote was false on return. The images came from the engine's decoded-image cache, which is keyed on the document and consulted before any request exists, so the interceptor is never asked. Policy right, pane lying. clearHttpCache() empties the profile's store but not that one. Loading about:blank first discards the previous document along with its cached images. This belongs in showThread() rather than render(): render() also runs for the remote-content grant itself, where throwing the document away would discard exactly what the user just asked to see. Found by the task 13 checklist (item 11) and confirmed fixed by the maintainer on screen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursfix: render the message pane at allDanilo M.5-7/+209
Clicking a thread left the pane blank. Two independent bugs, both from the same false premise: that setHtml() navigates to the base URL it is given. It does not. setHtml() navigates to a data: URL carrying the markup and applies the base URL afterwards, purely as the document's origin. Verified empirically on Qt 6.11. Built on that wrong assumption were: - MessagePage::acceptNavigationRequest compared the navigation's URL against documentUrl() and rejected everything else, so the document load was refused. It now accepts a typed main-frame navigation, which is one we initiated ourselves. - RequestInterceptor exempted exactly the qtmaildir: base URL and denied everything else, so the data: document load was blocked too. The interceptor fix is scoped to ResourceTypeMainFrame rather than allowing the data: scheme outright. A blanket allow would have been a real hole: a message body can write <img src="data:..."> or an iframe, and the existing dataSchemeBlocked test in test_interceptor.cpp was right to fail when that was tried. Sub-resource data: URLs remain denied. Note this was never working. The drafted version had the same defect in a different spelling (it compared url.scheme() rather than the whole URL, and would have rejected the data: navigation just the same), and task 11 shipped with no runtime test to catch it. test_messageview.cpp now pins all three facts: the document loads, its text reaches the page, and a data: image inside a hostile body stays blocked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursdocs: record manual verification resultsDanilo M.1-0/+124
Covers the items verifiable without a person at the screen. Items 4, 6-15 need eyes on the rendering, 16-18 write to the live index and wait for the maintainer, and 19-20 need a sync script that does not exist on this machine yet. Item 5's premise turned out to be wrong rather than the code: notmuch accepts `tag:` and returns 1,917 threads, so there is no error to report. The CLI agrees exactly, as it does on tag:inbox. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursfix: only interrupt startup for real configuration problemsDanilo M.4-8/+123
Found while walking the task 13 checklist against real mail. Item 1 ("startup shows no configuration warnings with a valid config") failed: with a perfectly valid config that simply had no [sync] command, every launch opened a blocking modal that had to be dismissed before the window could be used. Config now separates the two cases. A problem is something configured but wrong (a sync command that does not exist, an account with no maildir); those still open a dialog, as does every KeyMap warning, since each one means a binding the user wrote is being ignored. A notice is an optional feature simply not being configured; it reports to the status bar only. Nothing is broken in that case, and a modal on every launch teaches the user to dismiss dialogs unread, which defeats the ones that matter. problems() is a subset of warnings(), so callers wanting everything need only the latter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursfeat: add MainWindow wiring query, list, message, and syncDanilo M.6-3/+756
Wires the worker thread, thread list, message pane, sync process and undo stack together, and replaces the placeholder main() with real startup: custom URL schemes registered before QApplication, a libnotmuch ABI check, and config loading. Four fixes against the drafted version: - onWorkerError() only set a status label. Its own comment elsewhere claimed it reverted the optimistic update, and the spec requires that; it did not, so a rejected write left the list showing a tag the database never received. The pending change is now recorded and rolled back, and a confirmed tagsApplied clears it so a later unrelated error cannot undo a write that succeeded. - runCurrentQuery() cleared the model but left the undo stack pointing at rows that no longer exist. Undoing after a new query would have written to the database while the visible list stayed put. The stack is cleared with the model. - m_currentMessages was assigned on every thread load and never read. Removed. - buildUi() connected sync output to m_syncLog and errors to m_statusLabel before either existed. Both are constructed before the wiring now. cidPrefix generation lives here, this being its only producer in the application, and is pinned by tests: it must never contain '!' and must be distinct per message, which are the invariants the cid: namespacing rests on. A second test holds registeredActionNames() against KeyMap::knownActions(), since those two hand-maintained lists drifting either way silently breaks a user's key binding. Mutation-verified that dropping an action fails the test by name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursfeat: add MessageView with locked-down web engine profileDanilo M.7-0/+524
Off-the-record profile, JavaScript off, deny-by-default interceptor, and a page subclass that hands link clicks to the system browser so a message can never navigate the pane. Honours the obligation task 5 recorded: the interceptor trusts exactly one qtmaildir: URL and fails closed otherwise, so setHtml() and setDocumentUrl() must agree or the pane renders nothing. Rather than pairing those calls at each site, every load goes through one setDocument() and the URL comes from a single documentUrl() accessor. Verified against the real interceptor that this URL is allowed while siblings, subpaths, remote and file: are not. Three fixes against the drafted version: - showError() called setHtml() with a base URL but never setDocumentUrl(), so an error card would have rendered blank. Now impossible to repeat. - clear() and showError() left the previous thread's inline parts in the scheme handler and its cids in the interceptor. Both now empty the policy, so no thread's parts outlive it. - MessagePage trusted the whole qtmaildir: scheme for typed navigations, which is the same blanket-trust mistake task 5 removed from the interceptor. It now matches the exact document URL. The parts-flattening is extracted into buildThreadCidMap() so it can be tested without a live profile, and a cidPrefix containing '!' is sanitized rather than trusted, since Q_ASSERT is compiled out in release and this map decides which bytes a message can name. The sanitizer escapes '_' before replacing '!', because a plain replace would map "m0!x" and "m0_x" onto one key and merge two messages, which is the very collision the namespacing exists to prevent. Mutation-verified: the naive replace fails the distinctness test, and dropping the sanitizer trips the assert. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
16 hoursdocs: fold deferred findings into the task 13 checklistDanilo M.1-5/+23
Adds two checks the earlier tasks turned up but only recorded in passing: - Item 21: config.cpp validates the sync command by splitting on a space, while MailSync splits it with QProcess::splitCommand. A quoted program path containing a space makes the two disagree. The failure is safe (sync disables itself) but the message misleads, so the check is to confirm the behaviour and then pick a side. - Item 22: deleting the sync script while running exercises the launch failure path, which config's load-time validation cannot cover. Also corrects two claims the plan had outgrown: task 13 is no longer the notmuch layer's only coverage now that task 8 tests against a throwaway database, and cron runs every 10 minutes rather than hourly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 hoursfeat: add MailSync process wrapperDanilo M.7-6/+374
Runs the configured sync script through QProcess, merging stdout and stderr into one log so a failing mbsync run has something to show. The script is never run through a shell: the command is a config value, and splitCommand keeps its arguments literal. Two fixes against the drafted version: - start() no longer calls waitForStarted(). It blocked the UI thread for up to five seconds, which contradicts the spec's requirement that the UI stay usable during sync, and it swallowed launch failures into a bare false return. A missing script now surfaces asynchronously through errorOccurred as finished(false, -1) with an explanatory log line, so the spinner cannot hang with nothing to explain it. - Removed a double-emit guard I had added on the assumption that QProcess follows errorOccurred(FailedToStart) with finished(). Verified it does not: FailedToStart is emitted instead of finished, never before it. The guard was dead state and the comment justifying it was wrong. Also corrects the sync interval throughout: the user's cron runs every 10 minutes, not hourly. The shorter interval strengthens the flock rationale rather than weakening it, since collisions with a manual sync are that much more likely. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 hoursfeat: add ThreadListModel with batch appendDanilo M.5-0/+458
QAbstractTableModel over query results, appended in batches so a large query paints its first screenful immediately. Tag changes apply locally for optimistic UI; reverting a failed write means calling applyTagChange again with added and removed swapped, which the round-trip test pins. Two additions to the drafted version: - A ThreadIdRole, so a view's QModelIndex maps back to the thread id the worker speaks without every caller reaching around the model. - data() checks its own row and column bounds. Qt will not hand out an out-of-range index and invalidates persistent ones on reset, so this is unreachable defence rather than a live path; the test says so instead of pretending to cover it. Verified by mutation that the empty-batch guard, the ThreadIdRole, and the full-row dataChanged range each fail exactly one test when removed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 hoursfeat: add NotmuchWorker with batched queries and tag mutationDanilo M.6-0/+920
Owns the only notmuch database handle. Queries run read-only and emit threads in batches of 200 with a generation counter so the UI can discard superseded results. Tag mutation closes the read-only handle, opens read-write, applies, and closes, holding the process-wide write lock for milliseconds rather than blocking a concurrent `notmuch new`. Tested against a throwaway database built in a QTemporaryDir, superseding the spec's original "no unit test" position: applyTags is the only code here that writes to a notmuch index. The fixture never touches ~/Mail or ~/.notmuch-config. Two fixes against the drafted implementation, both caught by mutating the code and confirming exactly one test failed: - loadThread conflated "no query given" with "query matched nothing in this thread", so filtering a thread down to zero matches rendered every message expanded. Tracked with an explicit haveMatchSet flag. - applyTags now documents why a stale message id must skip rather than abort: notmuch_database_find_message reports SUCCESS with a null message for an unknown id, and the live ids alongside it still need tagging. Note for fixture authors: notmuch synchronizes maildir flags with tags at index time, so a file named `...:2,S` is indexed without the unread tag no matter what [new] tags requests. Unread fixture messages go in new/. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 hoursdocs: add CLAUDE.md with build commands and architectureDanilo M.1-0/+124
Records the non-obvious constraints that require reading several files to reconstruct: the two-thread split with no notmuch pointer crossing it, generation counters instead of cancellation, the close-before-reopen ordering the exclusive write lock forces, and the web view's fail-closed interceptor contract. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
32 hoursdocs: unit-test NotmuchWorker against a throwaway databaseDanilo M.2-6/+22
The spec deferred NotmuchWorker to manual verification on the grounds that testing it needs a real notmuch database. Building a fake one in a temporary directory answers that objection, so Task 8 now gets real coverage. This is the only code in the project that writes to a notmuch index, so a bug there corrupts real mail state. It was the wrong place to have the weakest verification. Task 13's manual checklist stays, as confirmation against real data rather than as the only coverage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
32 hoursfeat: add cross-thread value types and notmuch RAII wrappersDanilo M.2-0/+102
ThreadSummary, MessageRef, and TagChange are plain-value structs that carry query results across the worker/UI thread boundary via queued signals. NmHandle<T, Destroy> wraps libnotmuch's C handles (query, threads, messages, thread, message, tags) so early returns in the query paths can't leak.
32 hoursfix: enforce !-free cidPrefix invariant at both concatenation sitesDanilo M.4-1/+98
The cid: namespacing scheme (cid:<prefix>!<id>) is only unambiguous because the prefix half is guaranteed free of '!': the first '!' in the result is always the separator, so an attacker-controlled Content-ID containing '!' only extends the id half rather than colliding with a different prefix. That invariant previously existed only as a comment. Add Q_ASSERT_X at both independent call sites that perform this concatenation (CidSchemeHandler::namespacedKey and HtmlBuilder::namespaceCids) so a future prefix generator that violates it traps in debug builds, per Task 5's precedent of not letting one unit's correctness depend silently on another's future behaviour. Since Q_ASSERT compiles out in release, pin the property that actually matters release builds too test: distinct (prefix, id) pairs across a documented "m<index>" prefix set and hostile Content-IDs (containing '!', percent- encoded '!', empty, leading/trailing '!') never collide, and the key always splits at its first '!' back to the exact original prefix.
32 hoursfeat: add HTML builder and cid: scheme handlerDanilo M.7-0/+544
HtmlBuilder renders parsed messages (and whole threads, as one document, so newsletter threads don't spawn one Chromium process per message) into the HTML string the web view loads. Plain text is escaped and quote lines marked; the cid: rewrite is namespaced per message ("<prefix>!<id>") so two thread messages sharing a Content-ID don't collide. Hardened namespaceCids beyond the initial sketch after attacking it: handles unquoted cid: attribute values, background=/poster= (not just src/href), and CSS url(cid:...) in both style="" attributes and <style> blocks, all case-insensitively. Replaced the greedy [^"']+ capture with per-quote-style alternation so two cid: refs on one line can't bleed into each other. CidSchemeHandler serves cid: requests from the thread's inline-parts map, keyed by the same namespaced string, replaced wholesale per thread.