diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-15 11:46:58 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-15 11:46:58 +0200 |
| commit | d4e4cebbefdce5f575954594461dc707492b2dd8 (patch) | |
| tree | b71ae3b6f66bf661b60dfc565eb9949f5f778f95 /README.md | |
| parent | aecb22de0c6644380ea3b1e909c864fd24501dc7 (diff) | |
| download | qtmaildir-d4e4cebbefdce5f575954594461dc707492b2dd8.tar.gz qtmaildir-d4e4cebbefdce5f575954594461dc707492b2dd8.zip | |
feat(startup): add startup_account, the account the dropdown opens on
Answers "start me in work - Inbox rather than All accounts - Inbox". The key
names an account by its [account.<key>] suffix and the dropdown is set to it
before the startup query runs; because a built-in filter composes with the
dropdown, that is the whole mechanism and the key never reaches a query
builder. Validated on load: a name matching no account is reported and cleared,
since the dropdown has no entry for it and would sit on All accounts without
saying why.
Which side applies the scope depends on what the startup entry is, and getting
it wrong is silent in both directions. A generated filter comes back from
resolvedQuery() already scoped, so letting runQuery() apply the dropdown again
gives path:"work/**" and (path:"work/**" and (tag:inbox)). A saved query does
not, because resolvedQuery() ignores the account key for one, so claiming it
was already scoped leaves it unscoped with the dropdown pointing at Work.
The first of those shipped in this session's working tree and passed its test,
because the assertion used contains() and the double-scoped string contains the
scope too. It asserts the exact query now. The second was found by writing the
test for the case rather than by reading, and is covered by
aStartupAccountAlsoScopesASavedStartupQuery.
The README's startup_query documentation was wrong on two counts after the
previous commit: the fallback is the Unread filter rather than the first query
in the file, and the name can now match a built-in filter.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -106,10 +106,19 @@ identity. ; point: once you zoom with Ctrl+wheel or Ctrl+/Ctrl-, that is remembered ; separately and this value no longer applies. ; message_zoom = 1.0 -; Optional. Which saved query to open at startup, by name. Defaults to -; Unread. Falls back to the first saved query if no query by this name -; exists, and warns if you named one explicitly. +; Optional. Which query to open at startup, by name. Defaults to Unread. +; Matches your own saved queries first, then the built-in filters (Unread, +; Inbox, Important, Sent), so either can be named here. Falls back to the +; Unread filter if no query by this name exists, and warns if you named one +; explicitly. ; startup_query = Unread +; Optional. Which account the dropdown starts on, by key: the suffix of an +; [account.<key>] section. Unset means All accounts. Combined with a +; startup_query naming a built-in filter, this opens the application on that +; account's view of it, so startup_account = work with startup_query = Inbox +; starts in "work - Inbox". It only sets the STARTING scope: clicking a saved +; query that names no account still clears the selection, as it always does. +; startup_account = work ; Optional. Toolbar icon size in pixels, 16 to 64. Defaults to 24. The ; toolbar follows your desktop's toolbar button style, so if that is set to ; "icon only" this is the whole size of the control; 16 matches what most @@ -262,9 +271,11 @@ drop your comments and reorder your keys. One behaviour changes with the move. Buttons used to appear in alphabetical order, because the INI backend returns keys sorted and preserving file order -would have meant hand-rolling a parser. They now follow the file. If -`startup_query` names a query that does not exist, the fallback is likewise the -first query in the file rather than the alphabetically first one. +would have meant hand-rolling a parser. They now follow the file. + +`startup_query` looks at your saved queries first and then at the built-in +filters, so it can name either; yours wins if both carry the same name. A name +matching neither falls back to the **Unread** filter. ### Sent mail |
