Round dashboards: shape and ring, the ring drawn and turned in every look, Knob preset and face guide in the editor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Melvin Strobl
2026-10-14 14:23:55 +02:00
co-authored by Claude Opus 5.5
parent f067fb60d4
commit 8b8cb5cda9
21 changed files with 1447 additions and 57 deletions
@@ -4,7 +4,9 @@ import type { Dashboard } from "@/components/Dashboard/DashboardView"
import {
CanvasSurface,
DashboardView,
isRound,
} from "@/components/Dashboard/DashboardView"
import { RoundFace } from "@/components/Dashboard/RingWidget"
import { useDashboardLocked } from "@/components/Dashboard/settings"
import { useUi } from "@/components/Dashboard/ui"
import { LookProvider } from "@/components/Dashboard/ui/core/look"
@@ -29,7 +31,8 @@ export function PanelSurface({
}: {
dashboard: Dashboard
/** A landscape arrangement scaled onto a phone comes out at about a fifth of
* its size, which reads as nothing at all. Stack it instead. */
* its size, which reads as nothing at all. Stack it instead. Never a round
* one: a knob's face is about a phone's width already. */
stacked?: boolean
/** The way between this panel's dashboards, drawn on the canvas itself, or
* along the bottom of the screen when stacked. */
@@ -38,6 +41,7 @@ export function PanelSurface({
touch?: boolean
}) {
const hasRail = Boolean(rail)
const stack = stacked && !isRound(dashboard)
// Stable, so the canvas can keep the tiles it already built when one of the
// dashboard's own settings re-renders the route above this.
const canvas = useCallback(
@@ -46,7 +50,7 @@ export function PanelSurface({
)
return (
<div className="relative size-full">
{stacked ? (
{stack ? (
// Nothing scales a stack, so there is no canvas element here to state
// the look on: this branch mounts what `CanvasSurface` mounts for the
// other one, touch included.
@@ -67,13 +71,18 @@ export function PanelSurface({
) : (
// The panel's own surface, scaled to fit. No dots: nothing is being
// arranged here.
<CanvasSurface dashboard={dashboard} rail={rail} touch={touch}>
<CanvasSurface
dashboard={dashboard}
rail={rail}
face={<RoundFace dashboard={dashboard} />}
touch={touch}
>
{canvas}
</CanvasSurface>
)}
{/* Outside the canvas, so it needs the look stated for it. */}
<LookProvider dashboard={dashboard} touch={touch}>
{stacked && rail ? (
{stack && rail ? (
// Lifted clear of the rail floating along the bottom.
<div className="pointer-events-none absolute inset-x-0 top-0 bottom-20">
<LockNotice dashboard={dashboard} />