Merge remote-tracking branch 'origin/main'
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m22s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m12s
pre-commit / pre-commit (push) Failing after 2m33s
Test Backend / test-backend (3.12) (push) Successful in 5m1s
Test Backend / test-backend (3.14) (push) Successful in 4m52s
Compose Smoke Test / test-compose (push) Successful in 33s
Playwright Tests / merge-reports (push) Successful in 1m32s
Docs / docs (push) Successful in 20s
Playwright Tests / test-playwright (1, 2) (push) Failing after 4m22s
Playwright Tests / test-playwright (2, 2) (push) Successful in 2m12s
pre-commit / pre-commit (push) Failing after 2m33s
Test Backend / test-backend (3.12) (push) Successful in 5m1s
Test Backend / test-backend (3.14) (push) Successful in 4m52s
Compose Smoke Test / test-compose (push) Successful in 33s
Playwright Tests / merge-reports (push) Successful in 1m32s
This commit is contained in:
@@ -15,6 +15,7 @@ import type { WidgetDef } from "@/client"
|
||||
import { slotsFor } from "@/components/Common/UplotChart"
|
||||
import { duration, fadeIn } from "@/lib/motion"
|
||||
import { useShortcuts } from "@/lib/shortcuts"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { useClock } from "./ClockWidget"
|
||||
import type { Dashboard } from "./DashboardView"
|
||||
import { useBoundValue, useBoundValues } from "./dataContext"
|
||||
@@ -40,7 +41,7 @@ import {
|
||||
text,
|
||||
} from "./ui/core/config"
|
||||
import { TESTID } from "./ui/core/contract"
|
||||
import { useLook } from "./ui/core/look"
|
||||
import { LookProvider, useCanvasRoot, useLook } from "./ui/core/look"
|
||||
import { LOOK } from "./ui/core/motion"
|
||||
import {
|
||||
ANNOUNCE_MS,
|
||||
@@ -334,12 +335,7 @@ export function RoundPanel({
|
||||
return (
|
||||
// Keyed by name, so a neighbour becomes the one shown, and back,
|
||||
// without being drawn afresh: its own face memory and all.
|
||||
<div
|
||||
key={page.name}
|
||||
className="absolute inset-0"
|
||||
style={{ translate: `0 ${at * size}px` }}
|
||||
inert={at !== 0}
|
||||
>
|
||||
<TrackPage key={page.name} dashboard={page} at={at} size={size}>
|
||||
<PaletteProvider dashboard={page}>
|
||||
{editing ? (
|
||||
view
|
||||
@@ -347,13 +343,52 @@ export function RoundPanel({
|
||||
<LockedProvider dashboard={page}>{view}</LockedProvider>
|
||||
)}
|
||||
</PaletteProvider>
|
||||
</div>
|
||||
</TrackPage>
|
||||
)
|
||||
})}
|
||||
</motion.div>
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* One dashboard on a round panel's track, in its own look.
|
||||
*
|
||||
* The canvas states the look, theme and palette of the dashboard shown, so a
|
||||
* neighbour beside it, or the one a turn is leaving, would wear those too.
|
||||
* Each page restates its own instead. The ground stays the canvas's, which
|
||||
* changes over as soon as the turn begins.
|
||||
*/
|
||||
function TrackPage({
|
||||
dashboard,
|
||||
at,
|
||||
size,
|
||||
children,
|
||||
}: {
|
||||
dashboard: Dashboard
|
||||
/** Its place on the track, in screens from the one shown. */
|
||||
at: number
|
||||
size: number
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
// Touch belongs to the screen, so it is the canvas's whichever page this is.
|
||||
const { touch } = useLook()
|
||||
const root = useCanvasRoot(dashboard, touch)
|
||||
return (
|
||||
<LookProvider dashboard={dashboard} touch={touch}>
|
||||
<div
|
||||
data-look={root["data-look"]}
|
||||
data-touch={root["data-touch"]}
|
||||
data-palette={root["data-palette"]}
|
||||
className={cn("absolute inset-0 text-foreground", root.className)}
|
||||
style={{ ...root.style, translate: `0 ${at * size}px` }}
|
||||
inert={at !== 0}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</LookProvider>
|
||||
)
|
||||
}
|
||||
|
||||
/** A dashboard's icon and title: what a panel shows for a moment of a
|
||||
* dashboard it has just landed on. Opaque, so the face under it does not
|
||||
* read through the name. */
|
||||
|
||||
Reference in New Issue
Block a user