Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7c109eb
[Dashboard] Start squad run for feature 220
claude Nov 30, 2026
186bec4
Add spec for feature 220
claude Nov 30, 2026
a83c861
Log spec escalation for feature 220
claude Nov 30, 2026
26cba88
Update spec for feature 220
claude Nov 30, 2026
9a38795
Fix spec plan-check findings for feature 220
claude Nov 30, 2026
c403ceb
Add spec challenge notes for feature 220
claude Nov 30, 2026
fba854d
Add plan and tasks for feature 220
claude Nov 30, 2026
33f4fe9
Add plan and tasks for feature 220
claude Nov 30, 2026
9b7c8e1
Log plan challenge for feature 220
claude Nov 30, 2026
7d15fb0
Revise plan for feature 220
claude Nov 30, 2026
efc2918
Add Berry tests for G1
claude Nov 30, 2026
2db5c23
Implement Berry tokens, ring gauge and sparkline dot (G1)
claude Nov 30, 2026
9d511f2
Log G1 coverage step
claude Nov 30, 2026
644e9bb
Add Berry look tests for G2
claude Nov 30, 2026
624dafc
Add Berry look rules (G2)
claude Nov 30, 2026
0fbf43b
Add AC13 test and split Berry tests (G2)
claude Nov 30, 2026
76c58e1
Document the Berry theme and add screenshots
claude Nov 30, 2026
50a1b4b
Log gate stamp for feature 220
claude Nov 30, 2026
31efd3d
Fix wording in the dashboard area document
claude Nov 30, 2026
14ce3b3
Log review decision
claude Nov 30, 2026
33b6769
Add Berry hover border tests
claude Nov 30, 2026
8c0e7f1
Add Berry hover border rule
claude Nov 30, 2026
0c547d9
Log review fix
claude Nov 30, 2026
49c5994
Log gate stamp after review fix
claude Nov 30, 2026
01b28ef
Log delta review
claude Nov 30, 2026
af88acb
Accept the Berry decision records
claude Nov 30, 2026
06eb9bf
Log PR approval
claude Nov 30, 2026
9dcd10e
Remove squad working record
claude Nov 30, 2026
e91b044
Rename shadowing identifier in the gauge test
claude Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ The Console theme, light and dark:
![PiMonitor dashboard, Console theme, light](docs/dashboard-console-light.png)
![PiMonitor dashboard, Console theme, dark](docs/dashboard-console-dark.png)

The Berry theme, light and dark:

![PiMonitor dashboard, Berry theme, light](docs/dashboard-berry-light.png)
![PiMonitor dashboard, Berry theme, dark](docs/dashboard-berry-dark.png)

## Features

- **CPU usage** - overall and per-core percentage, with a trend sparkline
Expand Down Expand Up @@ -59,7 +64,7 @@ The Console theme, light and dark:
metric sampling
- **Light/dark mode toggle** - follows the OS setting by default, with a
manual override remembered in the browser
- **Choosable themes** - Clear and Console (a monospace, outlined look), picked
- **Choosable themes** - Clear, Console (a monospace, outlined look) and Berry (soft, one accent colour), picked
in the Customize dialog, remembered in the browser
- **Configurable dashboard layout** - show/hide and reorder metric cards
from a settings modal, remembered in the browser
Expand Down
44 changes: 35 additions & 9 deletions docs/areas/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ client of the [HTTP API](http-api.md) like any third-party integration and has n

- CPU usage, temperature, memory, swap and each filesystem are colored `crit` when the value is greater than or
equal to the matching `*_crit` threshold from `/api/v1/config`, otherwise `warn` when greater than or equal to the
`*_warn` threshold, otherwise `ok` β€” the same comparison the alert engine uses. The levels are the same in every theme; only the color of `ok` differs: green in Clear, `--text` in Console, where color marks only `warn` and `crit` (*Look*, [0043](../decisions/0043-console-colour-only-for-warn-and-crit.md)).
`*_warn` threshold, otherwise `ok` β€” the same comparison the alert engine uses. The levels are the same in every theme; only the color of `ok` differs: green in Clear, `--text` in Console, where color marks only `warn` and `crit` (*Look*, [0043](../decisions/0043-console-colour-only-for-warn-and-crit.md)); Berry is colored as Clear.
- The load-average gauges (1, 5 and 15 min) run from 0 to the CPU core count and are colored against the CPU
thresholds scaled to the core count (`cores Γ— cpu_warn_percent / 100`, `cores Γ— cpu_crit_percent / 100`).
- Coloring follows the raw value of every poll and is independent of alert state: a value can be colored `crit`
Expand Down Expand Up @@ -207,7 +207,7 @@ client of the [HTTP API](http-api.md) like any third-party integration and has n
### Theme

- A theme is a named set of palette tokens, chosen independently of the mode. The registered themes are listed once,
in `PIMONITOR_THEMES` of `theme-init.js`: Clear, the default (the first entry), and Console (`console`), second.
in `PIMONITOR_THEMES` of `theme-init.js`: Clear, the default (the first entry), Console (`console`), second, and Berry (`berry`), third.
- The default is the absence of the `data-style` attribute on `<html>`; any other theme sets `data-style` to its id.
- The choice is stored in `localStorage` under `pimonitor-style` (the theme's id). A stored value that is no
registered id (unknown, differently cased, unreadable) means Clear; it is kept in storage unchanged, never
Expand All @@ -225,17 +225,27 @@ client of the [HTTP API](http-api.md) like any third-party integration and has n
`--shadow` and `--dialog-shadow` are `0 0 0 transparent` instead of `none`, which would make the
`box-shadow` list of `.theme-toggle:hover` invalid. Its look beyond tokens is rules in `style.css` whose every
selector starts with `:root[data-style="console"]`; only the unit gap `.metric-unit::before` is an unscoped rule.
- Berry (soft, rounded, one accent) has the same three blocks, with a raspberry `--accent` and every `--accent-<card>`
equal to it, and its look beyond tokens is rules whose every selector starts with `:root[data-style="berry"]`,
without `!important`. Its light `--ok-ink` is `#166534`, darker than Clear's, so the Pi-hole pill reaches 4.5:1
([0045](../decisions/0045-berry-light-ok-ink-darker-for-pill-contrast.md)); its dark `--shadow` is
`0 0 0 transparent`, like Console's.
- Every palette block of every theme also declares `--card-border` (Clear's and Console's equal their `--border`;
Berry's is transparent in light and `#2c2832` in dark), `--pill-tint` (20 % in Clear and Console), `--gauge-shape`
(`half`) and `--spark-dot-size` (8); the unscoped card, header-button and dialog borders and the badge tints read
them, so Clear and Console look as before.
- Reasons: [0038](../decisions/0038-dashboard-mode-and-theme-as-token-overrides.md),
[0041](../decisions/0041-theme-choice-per-browser-as-pimonitor-style.md),
[0042](../decisions/0042-theme-registry-in-theme-init-js.md).
[0042](../decisions/0042-theme-registry-in-theme-init-js.md),
[0044](../decisions/0044-berry-one-accent-status-colours-for-values.md).

### Look

- The canvas renderers read exactly these custom properties through `themeColor`, `themeNumber` and `themeKeyword`
of `theme-init.js`: the colors `--accent`, `--muted`, `--card-bg`, `--track`, `--border`, `--ok-fill`, `--warn` and
`--crit`; the numbers `--spark-fill-alpha` (0 to 1), `--spark-line-width` (0.5 to 6) and `--gauge-width` (1 to
12); the keywords `--spark-shape` (`line`, `step`), `--spark-fill` (`fade`, `flat`), `--spark-dot` (`ring`,
`none`), `--spark-grid` (`none`, `lines`) and `--gauge-cap` (`round`, `butt`). An empty or unparseable value, a
`--crit`; the numbers `--spark-fill-alpha` (0 to 1), `--spark-line-width` (0.5 to 6), `--gauge-width` (1 to
12) and `--spark-dot-size` (2 to 16); the keywords `--spark-shape` (`line`, `step`), `--spark-fill` (`fade`, `flat`), `--spark-dot` (`ring`,
`none`), `--spark-grid` (`none`, `lines`), `--gauge-cap` (`round`, `butt`) and `--gauge-shape` (`half`, `ring`). An empty or unparseable value, a
number outside its range or a word outside its list is replaced by Clear's light value; any valid value, `0`
included, is used as is.
- Every color comes from a token of the palette blocks of `style.css` (light, explicit dark and OS dark, the two
Expand All @@ -245,21 +255,35 @@ client of the [HTTP API](http-api.md) like any third-party integration and has n
- Status text (values, percentages, badges, the alert banner, the API-key error) uses the `*-ink` variant of
`ok`/`warn`/`crit`; bar fills and the card border of an alerting card use the base color (for `ok`: `--ok` on Clear's bars, `--ok-fill` on the gauge arc and on Console's bars). Text on an accent fill
uses `--on-accent`.
- Berry colors status as Clear does (`ok` green, `warn` amber, `crit` red) and only the accent is one color: its
`--ok-fill` equals `--ok`, and no status value, bar or percentage takes `--accent`
([0044](../decisions/0044-berry-one-accent-status-colours-for-values.md)).
- Console colors `ok` text with `--text` (`.metric-ok` and the new-version column of the update list); color
appears only for `warn` and `crit`, plus the Pi-hole status dot (green when up to date, amber with an update).
The ok fill of the gauge arc and of Console's bars is `--ok-fill`: Clear's green (equal to its `--ok`, which Clear's bars use), Console's `--text`
([0043](../decisions/0043-console-colour-only-for-warn-and-crit.md)).
- A bar label shows the percentage emphasised, colored only at `warn` and `crit`, and the byte sizes muted beside it.
- The load gauge draws an arc of `--gauge-width` (Clear 9 px with round caps, Console 5 px with butt caps) on the
`--track` color and shows its value inside the arc; the value's font size scales with the gauge width in both
themes.
`--track` color and shows its value inside the arc; the value's font size scales with the gauge width in Clear
and Console.
Berry draws the load gauge as a ring (`--gauge-shape: ring`, read at every draw): a full-circle track of the
smaller canvas side with the same 9 px width and round caps, a value arc clockwise from 12 o'clock over the same
0 to core-count scale and the same thresholds, nothing drawn at 0 and a closed ring at the maximum; its canvas is
88 px high, the value is centred in it, and its font (12 to 18 px) shrinks with the gauge so it fits the ring down to
the narrowest gauge.
- A sparkline (and the detail chart) is a line of `--spark-line-width` with a fill and, as the theme says, a dot
with a ring at the newest point, inset so the dot is never clipped. Clear: a 2 px line, a fill fading towards the
bottom and the dot. Console: a 1.5 px stepped line (each point held to the next x), a flat low-opacity fill, a
solid baseline with two dashed lines at 25 % and 62.5 % of the height, and no dot.
solid baseline with two dashed lines at 25 % and 62.5 % of the height, and no dot. Berry: a 2.5 px line, a fade fill
and a 10 px dot (`--spark-dot-size`; 8 px in Clear and Console). The plot is inset by the dot's radius plus its 3 px
ring: 7 px in Clear and Console, 8 px in Berry.
- A metric value of CPU usage and temperature is a number element (`.metric-number`) and, when there is a unit, a
unit element (`.metric-unit`), built by `createElement` and `textContent`. Clear separates them by a space
(`.metric-unit::before`); Console sets the unit 15 px, muted, 4 px apart without the space.
- Berry's cards are 22 px round with no border in light (a soft shadow) and a 1 px border without shadow in dark;
card headings are sentence case, 15 px; values are 38 px; badges and the Pi-hole status are pills tinted with
`--pill-tint`, and the alert badge capitalizes its first letter. The Updates card is a wrapping row with the
button beside the count, and the Pi-hole section and the network rows are inset tiles on `--bg`.
- Console's bars are 12 px high and square, drawn as a repeating gradient of 6 px segments with 2 px gaps on the
track and on the fill, both from the track's left edge; its card heading is a 44 px strip with a bottom border
across the card, and in a clickable card the whole strip is the button.
Expand Down Expand Up @@ -315,6 +339,8 @@ client of the [HTTP API](http-api.md) like any third-party integration and has n
- [0041](../decisions/0041-theme-choice-per-browser-as-pimonitor-style.md): theme choice per browser
- [0042](../decisions/0042-theme-registry-in-theme-init-js.md): theme registry in `theme-init.js`
- [0043](../decisions/0043-console-colour-only-for-warn-and-crit.md): in Console, colour only for `warn` and `crit`
- [0044](../decisions/0044-berry-one-accent-status-colours-for-values.md): Berry has one accent, status colours stay for values
- [0045](../decisions/0045-berry-light-ok-ink-darker-for-pill-contrast.md): Berry's light `--ok-ink` is darker for pill contrast

## Not here

Expand Down
Binary file added docs/dashboard-berry-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dashboard-berry-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- **Status:** Accepted
- **Date:** 2026-11-28
- **Area:** Dashboard
- **Source:** Issue #217, issue #218, issue #219
- **Source:** Issue #217, issue #218, issue #219, issue #220
- **Supersedes:** β€”

## Context
Expand Down Expand Up @@ -32,14 +32,20 @@ names, and each design has to be swappable without touching the markup or the sc
β€” no theme ever adds a rule. Cost: Console changes fonts, border styles, bar patterns, heading layout and hidden
elements; about thirty more tokens would enter all three blocks of every theme, Clear's included, where most
name a property Clear does not use.
6. **A value that differs between a theme's modes as a new token read by the unscoped rule** (considered for Berry,
issue #220, whose card border is invisible in light and a hairline in dark mode, and whose badge tint is 16 % in
light and 18 % in dark mode) β€” Clear and Console get the token with the value their rule had, so their look stays.
The alternative, a scoped rule per mode, repeats each rule three times (light, explicit dark, OS dark).

## Decision

Option 1. Light/dark is the *mode*; its storage key `pimonitor-theme` and attribute `data-theme` keep their names,
since renaming them would reset every stored choice. The look is described in
[Dashboard](../areas/dashboard.md#look); the per-card colours are tokens of the palette blocks like every other
colour. What a theme changes beyond a token value (a font family, a dashed border, a segmented bar, a hidden element)
is a rule scoped to `:root[data-style="<id>"]` that uses only tokens (issue #219).
is a rule scoped to `:root[data-style="<id>"]` that uses only tokens (issue #219); a value that differs between a
theme's modes is a token, which an unscoped rule may read when every other theme's blocks give it that rule's former
value (option 6, issue #220).

## Consequences

Expand Down
39 changes: 39 additions & 0 deletions docs/decisions/0044-berry-one-accent-status-colours-for-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 0044: Berry uses one accent colour; status colours stay reserved for values

- **Status:** Accepted
- **Date:** 2026-11-30
- **Area:** Dashboard
- **Source:** Issue #220
- **Supersedes:** β€”

## Context

The theme Berry (issue #220) is a soft look built around one raspberry accent. Clear gives every card a colour of its
own on its icon chip ([0039](0039-card-colour-only-on-icon-chip.md)), and Console draws the `ok` level in the text
colour ([0043](0043-console-colour-only-for-warn-and-crit.md)). Berry's accent is a red, and so is `crit`: if the
accent also coloured values, bars or gauge arcs, a reader could not tell a healthy value from a critical one by colour.
The levels and thresholds are shared by every theme and must not change.

## Options considered

1. **One accent for every piece of chrome, the status colours only for values, fills and arcs, as in Clear** β€” the
logo, the icon chips, the sparklines, links, the primary buttons and the focus rings take `--accent`; every
`--accent-<card>` token equals it; values, bars and gauge arcs keep Clear's green, amber and red. Cost: the cards
lose the colour cue that tells them apart in Clear.
2. **Clear's per-card colours with Berry's shapes** β€” keeps the cue. Cost: ten hues beside the accent, the opposite of
the single-accent look the issue asks for.
3. **The accent also for values in the `ok` level, as Console uses its text colour** β€” the calmest page. Cost: a
raspberry `ok` value beside a red `crit` value differ by hue alone, which the issue forbids.

## Decision

Option 1. While Berry is active every chrome element that is coloured takes `--accent`, and values, bar fills and gauge
arcs take the status colour of their level exactly as in Clear; the accent is never the colour of a value, a fill or
an arc. The rules are in [Dashboard](../areas/dashboard.md#look).

## Consequences

- The icon-chip rule of 0039 still holds: the chip shows the card's colour token, which in Berry is the accent.
- Wherever `crit` appears in Berry it is carried by text as well (a value, a badge, the banner), so the two reds never
stand alone.
- The sparklines and the openHAB memory chart are drawn in the accent: they show a trend, not a level.
33 changes: 33 additions & 0 deletions docs/decisions/0045-berry-light-ok-ink-darker-for-pill-contrast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 0045: Berry's light `ok` ink is one step darker than the issue's palette

- **Status:** Accepted
- **Date:** 2026-11-30
- **Area:** Dashboard
- **Source:** Issue #220
- **Supersedes:** β€”

## Context

Issue #220 gives Berry's light `--ok-ink` as `#15803d`, Clear's value, and asks for text contrast of at least 4.5:1.
Berry draws the Pi-hole status as a pill: `ok` ink on `--ok` at 16 % inside an inset tile on `--bg`. With `#15803d`
that pair reaches only 3.79:1 (4.20:1 over `--card-bg`), and since `--ok-ink` on plain `--bg` is already 4.47:1, no
lighter tint can fix it. Every other pair of the issue's palette passes.

## Options considered

1. **A darker ink, `#166534`, in Berry's light blocks only** β€” the next darker green of the same family; every `ok`
text pair passes (5.38:1 on the pill tint over `--bg`). Cost: a documented departure from the issue's table for one
token.
2. **The `ok` pill's text in `--text`** β€” no new value. Cost: the pill's text loses its level colour, unlike the
`warn` pill beside it.
3. **Accept 3.79:1** β€” the issue's value. Cost: text below the contrast the issue itself requires.

## Decision

Option 1, chosen by the Product Manager: Berry's light `--ok-ink` is `#166534`; its dark `--ok-ink` and every other
token keep the issue's values. The palette is in [Dashboard](../areas/dashboard.md#theme).

## Consequences

- Clear and Console keep `#15803d`; the contrast test computes Berry's pairs from its own blocks, pill and banner
tints included, so a later palette edit cannot drop below 4.5:1 unnoticed.
2 changes: 2 additions & 0 deletions docs/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ once in the [area document](../areas/README.md) of the record's area, and the re
| [0041](0041-theme-choice-per-browser-as-pimonitor-style.md) | The theme choice is a per-browser preference, stored as `pimonitor-style` and applied as `data-style` | Accepted | 2026-11-28 |
| [0042](0042-theme-registry-in-theme-init-js.md) | The theme registry and the canvas token readers live once in `theme-init.js` | Accepted | 2026-11-28 |
| [0043](0043-console-colour-only-for-warn-and-crit.md) | In Console, colour is reserved for `warn` and `crit` | Accepted | 2026-11-29 |
| [0044](0044-berry-one-accent-status-colours-for-values.md) | Berry uses one accent colour; status colours stay reserved for values | Accepted | 2026-11-30 |
| [0045](0045-berry-light-ok-ink-darker-for-pill-contrast.md) | Berry's light `ok` ink is one step darker than the issue's palette | Accepted | 2026-11-30 |
<!-- project:end index -->
27 changes: 16 additions & 11 deletions internal/web/assets/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
// vendoring a charting library: the dashboard only needs a handful of
// small trend lines, not zoom/pan/tooltip interactivity.

// The ring around the newest-point dot, in px beyond the dot's radius.
const SPARK_DOT_RING = 3;

// sparkStyle reads the sparkline drawing properties of the active theme and
// returns { shape, lineWidth, fill, fillAlpha, dot, grid, cardBg, border }.
// returns { shape, lineWidth, fill, fillAlpha, dot, dotSize, grid, cardBg, border }.
function sparkStyle() {
return {
shape: themeKeyword('--spark-shape', ['line', 'step']),
lineWidth: themeNumber('--spark-line-width', 0.5, 6),
fill: themeKeyword('--spark-fill', ['fade', 'flat']),
fillAlpha: themeNumber('--spark-fill-alpha', 0, 1),
dot: themeKeyword('--spark-dot', ['ring', 'none']),
dotSize: themeNumber('--spark-dot-size', 2, 16),
grid: themeKeyword('--spark-grid', ['none', 'lines']),
cardBg: themeColor('--card-bg'),
border: themeColor('--border'),
Expand Down Expand Up @@ -88,14 +92,15 @@ function fillSparkline(ctx, xy, height, color, style) {
}

// drawSparkDot draws the newest-point dot at `last` ({ x, y }) with a ring in
// `cardBg`.
function drawSparkDot(ctx, last, color, cardBg) {
// the card colour; `style` is the result of sparkStyle. The dot's diameter is
// style.dotSize, the ring is SPARK_DOT_RING px wider all around.
function drawSparkDot(ctx, last, color, style) {
ctx.beginPath();
ctx.arc(last.x, last.y, 7, 0, 2 * Math.PI);
ctx.fillStyle = cardBg;
ctx.arc(last.x, last.y, style.dotSize / 2 + SPARK_DOT_RING, 0, 2 * Math.PI);
ctx.fillStyle = style.cardBg;
ctx.fill();
ctx.beginPath();
ctx.arc(last.x, last.y, 4, 0, 2 * Math.PI);
ctx.arc(last.x, last.y, style.dotSize / 2, 0, 2 * Math.PI);
ctx.fillStyle = color;
ctx.fill();
}
Expand Down Expand Up @@ -128,17 +133,17 @@ function drawSparkline(canvas, points, opts) {
max += 1;
}

// The plot is inset far enough that the newest-point dot (radius 4 plus a
// 3 px ring) stays inside the canvas at the right, top and bottom edges.
const pad = 7;
// The plot is inset far enough that the newest-point dot (its radius plus
// the 3 px ring) stays inside the canvas at the right, top and bottom edges.
const style = sparkStyle();
const pad = style.dotSize / 2 + SPARK_DOT_RING;
const stepX = (cssWidth - pad * 2) / (points.length - 1);

const yFor = v => {
const t = (v - min) / (max - min);
return cssHeight - pad - t * (cssHeight - pad * 2);
};

const style = sparkStyle();
const xy = points.map((p, i) => ({ x: pad + i * stepX, y: yFor(p.v) }));

if (style.grid !== 'none') {
Expand All @@ -154,7 +159,7 @@ function drawSparkline(canvas, points, opts) {
ctx.stroke();

if (style.dot !== 'none') {
drawSparkDot(ctx, xy[xy.length - 1], color, style.cardBg);
drawSparkDot(ctx, xy[xy.length - 1], color, style);
}
}

Expand Down
Loading