Skip to content

feat(sensors): DPI-aware column density, bordered sections - #2

Open
perlowja wants to merge 1 commit into
singularityos-lab:mainfrom
perlowja:feat/sensors-responsive-columns
Open

perlowja wants to merge 1 commit into
singularityos-lab:mainfrom
perlowja:feat/sensors-responsive-columns

Conversation

@perlowja

@perlowja perlowja commented Sep 18, 2026

Copy link
Copy Markdown

Two related restorations to the sensors popover detail layout, both regressed when sensors moved from panel.vala into its own plugin:

  1. Column count now derives from monitor scale factor as well as logical width, up to 3 columns instead of a fixed 1-or-2 split on one logical-width breakpoint. Ports the density calculation from a working, screenshot-verified prototype (a SensorsIndicator variant, merged once already as fix(panel): convert sensors popover to native Singularity widgets, make it responsive singularity-shell#27, simplified when sensors moved into this plugin).
  2. begin_detail_section() applies sensors-resource-section (style: bordered frame for stacked popover sections libsingularity#15) so each resource-pool section renders as a bordered card -- restores styling from an earlier unmerged NCZ patch (singularity-shell df20256) that never survived the plugin rewrite.

Section placement keeps the existing always-balance-the-shortest-column approach, generalized from 2 fixed fields to an array sized by the computed column count. The scrolled-window fallback for unusually many rows is unchanged.

Depends on singularityos-lab/libsingularity#15.

Verified: full ninja -C builddir build succeeds (0 errors) against a fresh subproject checkout of libsingularity (with #15's CSS class applied locally for the build).

Assisted-by: Claude Code:claude-sonnet-5
AI scope: generalized the column layout to N columns with scale-factor awareness, wired the outline CSS class into begin_detail_section().

AI assistance: disclosed

@perlowja
perlowja force-pushed the feat/sensors-responsive-columns branch from 510ee51 to 2ef5167 Compare September 18, 2026 20:14
Two related restorations to the sensors popover's detail layout, both
regressed when sensors moved from panel.vala into its own plugin:

1. Column count now derives from the monitor scale factor as well as
   logical width (see configure_detail_layout()), up to 3 columns
   instead of a fixed 1-or-2 split at one logical-width breakpoint. A
   scaled HiDPI panel can therefore use more columns than a native
   low-resolution display at the same logical width. Ports the density
   calculation from a working, screenshot-verified prototype
   (SensorsIndicator, merged upstream once already as #27, later
   simplified when sensors moved into this plugin).

2. begin_detail_section() now applies the sensors-resource-section CSS
   class (singularityos-lab/libsingularity#15) so each resource-pool
   section reads as a bordered card, restoring styling from an earlier
   unmerged NCZ patch (df20256) that never survived the plugin rewrite.

Section-to-column placement stays the same always-balance-the-shortest-
column approach already in place, just generalized from 2 fixed fields
(detail_left/detail_right) to an array sized by the new column count.
The scrolled-window safety net for unusually many rows on a short
display is unchanged.

Depends on singularityos-lab/libsingularity#15 for the CSS class.

awareness, wired the outline CSS class into begin_detail_section().

Assisted-by: Claude Code:claude-sonnet-5
AI-Scope: Ported DPI-aware balanced column layout (get_scale_factor()-based density calc, up to 3 columns) for the sensors panel from a prior NCZ prototype.
@perlowja
perlowja force-pushed the feat/sensors-responsive-columns branch from 2ef5167 to ebed25c Compare September 18, 2026 20:15
@perlowja

Copy link
Copy Markdown
Author

@mirkobrombin bumping this one - restores the bordered-section styling and DPI-aware column density that got dropped when sensors moved from panel.vala into this plugin. Depends on libsingularity#15 for the CSS class.

@mirkobrombin

Copy link
Copy Markdown
Member

The scale factor logic is backwards: popovers are laid out in logical pixels, so multiplying by scale gives HiDPI screens more columns on less space (1280 logical @2x gets 3 columns, a ~1056px popover). Keep the logical-only calculation. Also move .sensors-resource-section into the plugin's own CSS provider (compact_rows_provider), libsingularity#15 is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants