Round dashboards: one face at a time, a face per widget type, paged by swipe, dots and keys; slider reading; face row in the editor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8b8cb5cda9
commit
84071ee106
@@ -6,7 +6,6 @@ import {
|
||||
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"
|
||||
@@ -28,6 +27,7 @@ export function PanelSurface({
|
||||
stacked,
|
||||
rail,
|
||||
touch,
|
||||
onDashboard,
|
||||
}: {
|
||||
dashboard: Dashboard
|
||||
/** A landscape arrangement scaled onto a phone comes out at about a fifth of
|
||||
@@ -39,14 +39,23 @@ export function PanelSurface({
|
||||
rail?: React.ReactNode
|
||||
/** Whether the screen this hangs on is touched. Stated by the panel route. */
|
||||
touch?: boolean
|
||||
/** A round dashboard has no rail: it is swiped up and down to the panel's
|
||||
* others instead. */
|
||||
onDashboard?: (by: number) => void
|
||||
}) {
|
||||
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(
|
||||
() => <DashboardView dashboard={dashboard} rail={hasRail} />,
|
||||
[dashboard, hasRail],
|
||||
() => (
|
||||
<DashboardView
|
||||
dashboard={dashboard}
|
||||
rail={hasRail}
|
||||
onDashboard={onDashboard}
|
||||
/>
|
||||
),
|
||||
[dashboard, hasRail, onDashboard],
|
||||
)
|
||||
return (
|
||||
<div className="relative size-full">
|
||||
@@ -71,12 +80,7 @@ export function PanelSurface({
|
||||
) : (
|
||||
// The panel's own surface, scaled to fit. No dots: nothing is being
|
||||
// arranged here.
|
||||
<CanvasSurface
|
||||
dashboard={dashboard}
|
||||
rail={rail}
|
||||
face={<RoundFace dashboard={dashboard} />}
|
||||
touch={touch}
|
||||
>
|
||||
<CanvasSurface dashboard={dashboard} rail={rail} touch={touch}>
|
||||
{canvas}
|
||||
</CanvasSurface>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user