Draw the panel as a panel

Five things a wall panel showed that a wall panel should not.

**A tile's body no longer clips.** It scrolled, and a box that scrolls
also cuts whatever crosses its edge — which took the glow off a lit
button at exactly the width where the button filled its tile, and off a
gauge's arc at exactly the height where the dial filled its own. Only
what is written or listed asks for a scroller now; everything else is a
picture drawn to fit, and what overflows is left to the frame, which
clips at the tile's edge where a shadow has already faded out. The
slider's phantom scrollbar goes with it.

**The selector is a selector.** Named for what it does rather than what
it is, and the choice it is holding is held in the dashboard's own
primary — a pill that slides between the options rather than a grey one
that had to be looked for. The stored type is untouched, so no document
changes meaning.

**The arrangement is held off the panel's edges**, by the same distance
it holds between two widgets. The ground is not held off with it: a
background covers the whole panel, and only what is arranged on it has
a margin. No stored panel loses a row to it.

**The rail is drawn on the panel.** It was chrome bolted to the edge of
the screen beside the canvas — in the app's own design rather than the
dashboard's, and on a scaled canvas not even lined up with it. It now
takes a column out of the canvas the way the margin does, scaled with
it and wearing its look. Which cell each widget sits in is unchanged;
only how big a cell is.

Two of these were the same mistake twice: an unlayered rule stating
`position` for everything wearing a class — `.gl-surface` on a rail
placed by a utility, and a blanket lift over every child of a pressable
on a pill placed by `layoutId`. Both now say it one element at a time.
This commit is contained in:
2026-08-24 10:44:53 +02:00
parent fea57064f9
commit 6238728dce
18 changed files with 389 additions and 173 deletions
+31
View File
@@ -374,6 +374,30 @@ test("a reading is written to its own precision while it is moving", async ({
await publish(page, w("setpoint"), 21.5)
})
test("the arrangement is held off the panel's edges", async ({ page }) => {
await openPanel(page)
const canvas = (await page.getByTestId("canvas-surface").boundingBox())!
const tiles = await page.getByTestId("widget-frame").all()
const boxes = await Promise.all(tiles.map((tile) => tile.boundingBox()))
// A tile sits as far from the edge of the screen as it does from its
// neighbour. The scale is whatever fits the viewport, so the margin is
// asserted as "some room" rather than a pixel count.
for (const box of boxes) {
expect(box!.x, "a tile is flush against the left edge").toBeGreaterThan(
canvas.x + 1,
)
expect(box!.y, "a tile is flush against the top edge").toBeGreaterThan(
canvas.y + 1,
)
expect(
box!.x + box!.width,
"a tile is flush against the right edge",
).toBeLessThan(canvas.x + canvas.width - 1)
}
})
test("a widget is drawn inside its tile rather than scrolled", async ({
page,
}) => {
@@ -647,6 +671,13 @@ for (const scheme of ["light", "dark"] as const) {
await expect(surface).toHaveAttribute("data-palette", "")
await expect(page.getByTestId("canvas-ground")).toBeVisible()
// The margin holds the arrangement off the edges; it does not hold the
// ground off with it, because a background covers the whole panel.
const canvas = (await surface.boundingBox())!
const ground = (await page.getByTestId("canvas-ground").boundingBox())!
expect(Math.round(ground.width)).toBe(Math.round(canvas.width))
expect(Math.round(ground.height)).toBe(Math.round(canvas.height))
const primary = await page
.getByTestId("bar-fill")
.first()