fix(panel): convert sensors popover to native Singularity widgets, make it responsive - #27
Conversation
…ake it responsive Extracted from PR singularityos-lab#26 (OCS wallpaper browser), which bundled these sensors-popover changes alongside unrelated wallpaper work. Squashes four commits from that branch that touched only panel.vala: - convert popover to native Singularity.Widgets (PreferencesGroup/ PreferencesRow/ActionRow), same convention the rest of the desktop surface (desktop_page, calendar_view) already uses for grouped lists - full Adw/PreferencesGroup convention audit pass - make the popover responsive - swap the one remaining raw Adw.PreferencesRow (the compact-row container in append_compact_row) for Singularity.Widgets.PreferencesRow, so this surface is 100% libsingularity widgets, no direct libadwaita Behaviour preserved: every severity threshold, MAX_ROWS_PER_GROUP cap, polling interval, schema-key guard, map/unmap gate, and the synchronous-refresh-on-popover-open path are unchanged. The heat bar stays a raw Gtk.DrawingArea (Gtk.LevelBar's battery-style level-low/level-high semantics paint every short bar red -- documented inline where make_heat_bar() is defined).
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
mirkobrombin
left a comment
There was a problem hiding this comment.
This also removes the severity colors from the panel summary, and the PR body exposes Claude attribution, so restore the existing status semantics and remove that metadata before re-review.
The widget conversion in abdfe43 restyled the compact chip onto the panel clock's typography (`clock` / `clock-button`, inherited colour), which silently dropped the per-metric severity colouring `main` already shipped: temperature coloured by its own sensor's thermal severity and memory by capacity severity, so a glance at the panel shows WHICH figure needs attention without opening the popover. Restores, byte-identical to `main`: `theme_color_hex()`, `markup_segment()`, `severity_color_name()`, the `primary_kind` / `primary_severity` selection (which keeps the colour describing the number actually displayed, including the hottest-reading fallback), the `use_markup` chip assembly, and the `sensors-indicator` / `sensors-summary` / `flat` classes it depends on. The popover work this PR exists for is untouched -- `PreferencesRow` rows, the two-column responsive layout, and the monitor-derived sizing all remain. `git diff main` now shows no delta in any severity, colour or markup code path. Assisted-by: Claude Code:claude-opus-5 AI scope: Re-inserted the four dropped severity-colour members and the chip-assembly block verbatim from main, then verified by diff that no colour, severity or markup code path still differs from main.
|
Thanks — both fair, and the severity-colour one was a real regression on my side, not a deliberate change. Severity colours restored (e2e323f). The cause was that I also restyled the compact panel chip onto the clock's typography (
PR body cleaned. The trailing attribution block is gone. Going forward I'll use the disclosed form you prefer on commits, which e2e323f already carries: Verification on the new head: |
b51a24e to
e2e323f
Compare
mirkobrombin
left a comment
There was a problem hiding this comment.
The widget conversion still has no completed visual check, so please attach narrow and wide screenshots of the real sensor popover before merge.
|
@mirkobrombin Visual check completed. These are headless captures of the real
The captures show the native GTK rows, inherited stock theme states ( Narrow (single column)Wide (two columns)The image-hosting branch contains only these two PNG artifacts; no code from the integrated source tree was committed to this PR branch. |


Summary
Split out of #26 (OCS wallpaper browser), which had accidentally bundled sensors-popover work alongside the unrelated wallpaper/Bing browser changes -- per review feedback on that PR, this is the sensors-only portion, isolated to
src/components/panel/panel.vala(no other file is touched, and no wallpaper code is present here).SensorsIndicatorpopover from a hand-builtGtk.Box/Label/Buttontree toSingularity.Widgets.PreferencesGroup/PreferencesRow/ActionRow-- the same controls the rest of the desktop surface (desktop_page.vala,calendar_view.vala) already uses for grouped lists.Adw.PreferencesRow(inappend_compact_row()) is swapped forSingularity.Widgets.PreferencesRow, so this surface is 100% libsingularity widgets with no direct libadwaita usage.Behaviour preserved: every severity threshold,
MAX_ROWS_PER_GROUPcap, polling interval, schema-key guard, map/unmap gate, and the synchronous-refresh-on-popover-open path are unchanged. The heat bar stays a rawGtk.DrawingArea(Gtk.LevelBar's battery-style level-low/level-high semantics paint every short bar red -- documented inline wheremake_heat_bar()is defined).Follow-up: panel summary severity colours restored (b51a24e)
The first revision of this PR also restyled the compact panel chip onto the clock's typography, which silently dropped the per-metric severity colouring
mainalready ships. That was an unintended regression and has been reverted:theme_color_hex(),markup_segment(),severity_color_name(), theprimary_kind/primary_severityselection and theuse_markupchip assembly are now byte-identical tomain, as are thesensors-indicator/sensors-summary/flatCSS classes they depend on.git diff main -- src/components/panel/panel.valashows no delta in any severity, colour or markup code path; only the popover widget conversion and responsive layout remain.Test plan
meson setup+meson compileclean on a fresh checkout (arm64 build host) -- linkssingularity-desktopwith no errors and no newpanel.valawarnings beyond the pre-existing ones (local functions are experimental, the GTK 4.10/4.12 deprecations, all of whichmainalso emits).meson test-- 8/8 pass.