aboutsummaryrefslogtreecommitdiffstats
path: root/mail-overview/Accounts.qml
AgeCommit message (Collapse)AuthorFilesLines
9 hoursfix(mail-overview): parse account sections by walking linesDanilo M.1-19/+30
Two bugs, both found by actually running the shell rather than reading the code. shell.qml used Connections without importing QtQuick, so the config failed to load outright: "Connections is not a type". That one was loud, and it only affected the temporary verification probe. The parser was the real bug and it was quiet. Section bodies were matched as "everything up to the next [", which is wrong for this file: accounts whose folders are named like [Gmail]/Bozze end their body at that bracket, before the label line is reached. Three of the five accounts therefore fell back to displaying their raw key, and nothing reported a problem because falling back is a legitimate path for an account that genuinely has no label. Replaced with a line walk. It says what it means, its only state is which section is open, and it was checked against the real config before being trusted: all five accounts now resolve both label and colour. An attempted fix with a lazy quantifier and a lookahead made things worse, dropping every label, which is the argument for the boring version. Verified in a running shell: five accounts in config order with their labels, counts summing exactly to the global notmuch count, no unknowns, and the config stays loaded for the full timeout rather than exiting silently. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWL8JYHu7yhAdtx5pU9PMU
9 hoursfeat(mail-overview): account model singletonDanilo M.1-0/+204
Accounts.qml is the data layer for the mail drawer: it parses accounts from qtmaildir.conf rather than hardcoding them, so adding an account there needs no edit here. The key runs to the closing bracket, not the first dot, because at least one configured key contains a dot of its own; matching only up to the first dot would silently truncate it and drop that account's mail from every count. Counting uses the account-<key> notmuch tag, not a path glob. notmuch deduplicates by message id, so a message delivered to two of the configured addresses is one message with two file paths: a path glob would count it under both accounts and the per-account rows would sum higher than the global total the waybar icon already shows (measured elsewhere as 102 vs 101). The tag is a property of the message, so it is singular and the rows always sum to the header exactly. An unknown count is -1, never 0. notmuch has one failure mode with no distinct exit status: a rejected query fragment can still return 0 exit and empty output, and an empty string must not become a zero, which would render as "no unread mail" instead of "count unavailable". Output is validated as a non-negative integer before being trusted. Includes a temporary console-log probe in shell.qml, added deliberately for runtime verification of this model outside the drawer UI (Task 4). It stays until the user has run and confirmed it against real notmuch output, then gets removed in a follow-up commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWL8JYHu7yhAdtx5pU9PMU