From 955c273565521d9559e5760ca252a77c53a7aaa9 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 9 Aug 2026 09:54:00 +0200 Subject: feat(ui): make the toolbar icon size configurable 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 --- .../plans/2026-08-03-post-0.1.0-usability.md | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'docs/superpowers') diff --git a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md index 52cc023..ba0ade5 100644 --- a/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md +++ b/docs/superpowers/plans/2026-08-03-post-0.1.0-usability.md @@ -115,6 +115,7 @@ taking that too literally. | 55 | In a narrow window the message pane is invisible | presentation | XS | open | | 56 | No action carries an icon, so the toolbar reserves space for nothing | presentation | S | **done** | | 57 | "Flag" would read better as "Important" or "Starred" | presentation | XS | **done** | +| 58 | `message_zoom` documents a 0.5 to 3.0 range and enforces none of it | correctness | XS | open | Sizes are rough: XS under an hour, S a sitting, M a session. @@ -3542,6 +3543,39 @@ guard proving the thread did not already carry it. Mutating the tag to `important` fails it, and also fails two pre-existing held-edit tests, which is independent confirmation that `flagged` is load-bearing across the suite. +## 58. `message_zoom` documents a 0.5 to 3.0 range and enforces none of it + +**Observed:** not by the user. Found on 2026-08-09 while adding +`toolbar_icon_size`, by reading `message_zoom` as the model for a bounded +numeric key and noticing it is not bounded. + +**Cause, verified in code.** `src/config.cpp:79-90` parses the value with +`toDouble()` and assigns it on success. The parse failure is reported, but +nothing checks the range. The README documents "0.5 to 3.0" (`README.md`, the +`[general]` block), and `m_messageZoom` is never clamped anywhere else: +`src/mainwindow.cpp:145` passes it straight to the saved-state default. + +So `message_zoom = 500` is accepted and applied. Unlike the toolbar icon size, +this one is recoverable, since the zoom is adjustable from the UI and the +adjusted value is what gets saved, but the first render is unusable. + +**Approach.** Clamp with a report, exactly as `toolbar_icon_size` does +(`src/config.cpp`, the `kMinToolbarIconSize`/`kMaxToolbarIconSize` block). Both +ends already have documented bounds, so this is applying the README's own +numbers. + +**Constraints.** + +- Report rather than silently clamp. Silence is how this went unnoticed: the + key parses, so nothing ever said the value was not being honoured. +- Do not extend this to `mark_read_delay_ms`, whose zero and negative values are + meaningful and deliberately unclamped (`src/config.cpp:96-102`). + +**Verification.** `test_config` already has the pattern in +`toolbarIconSizeIsClampedAndReported`; mirror it. Note that +`messageZoomDefaultsAndValidates` exists and passes today, so it is asserting +only on the parse and not on the range. + ## Deferred, unsized, or split out Items noted while triaging but not part of the original list. Same numbering -- cgit v1.2.3