aboutsummaryrefslogtreecommitdiffstats
path: root/mail-overview/shell.qml
AgeCommit message (Collapse)AuthorFilesLines
9 hoursfeat(mail-overview): the drawerDanilo M.1-14/+0
Builds the panel body on the house idiom the other two components already use: a fullscreen transparent PanelWindow holding a dim backdrop, with the real content as a Rectangle anchored inside it. The idiom is worth the seemingly oversized window because it hands us two behaviours for free. Click-outside-to-close is just a MouseArea filling the backdrop, and the drawer only needs its own MouseArea to swallow clicks so they do not fall through. Escape works because the window actually covers the screen and can take exclusive keyboard focus. exclusionMode is Normal here, unlike the Ignore the other two components set. Waybar claims an exclusive zone at the top of this screen, and the mail icon lives in it, so respecting that zone positions the drawer immediately below the bar without this file hardcoding, or even knowing, the bar's height. It also means the backdrop begins below waybar, so the bar itself does not dim while its own drawer is open, which reads correctly: the icon you clicked stays lit. Focus sits on an inner Item with focus: true, not on the window. Setting WlrLayershell.keyboardFocus is necessary but not sufficient, because key events in QML are delivered to a focused item and never to a window, so Keys.onEscapePressed on the PanelWindow would never fire. This cost time in the vm-manager panel and the same shape is used here deliberately. Thread rows are deliberately read-only, with no click handler. qtmaildir takes no arguments, so there is no way to ask it to open a particular thread and a clickable row would promise navigation it cannot deliver. The rows are a preview; the button opens the client at its own idea of where to start. show() refreshes before opening rather than relying on a timer. The panel is opened rarely and the shell is autostarted for the whole session, so the counts are almost always stale by the time anyone looks at them, and a refresh on open is both cheaper and fresher than polling. Also removes the temporary console probe from shell.qml, which existed only to verify the account model parsed and counted correctly. The drawer now displays the same data, so the probe has no job left. Dropping it also drops the QtQuick import, which nothing else in that file needed. Button.qml is an unmodified copy of vm-manager's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWL8JYHu7yhAdtx5pU9PMU
9 hoursfix(mail-overview): parse account sections by walking linesDanilo M.1-0/+1
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/+13
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
9 hoursfeat(mail-overview): component skeleton with the keepalive windowDanilo M.1-0/+24
Nothing is drawn yet. This commit exists on its own because the thing most likely to be wrong at this stage is invisible: a config whose only window is hidden exits straight after logging Configuration Loaded, reporting no error, and the symptom is a keybind that appears to do nothing. Theme.qml is a verbatim copy of the one in appearance. It is a fallback for before the generated palette is read, not a palette to grow; deduplicating the four copies is a separate change. Not yet run: the user runs the shell themselves, so loading and IPC are verified in their session rather than here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWL8JYHu7yhAdtx5pU9PMU