Stagger a rectangular panel's new dashboard by rail order
Changing dashboard kept the grid mounted, so every new tile rose at once. The grid is drawn afresh per dashboard and its tiles come in row by row: from below, top row first, for one further down the rail, and from above, bottom row first, for one further up, as a round panel's dashboards slide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -30,6 +30,7 @@ export function PanelSurface({
|
||||
touch,
|
||||
onDashboard,
|
||||
around,
|
||||
turned,
|
||||
}: {
|
||||
dashboard: Dashboard
|
||||
/** A landscape arrangement scaled onto a phone comes out at about a fifth of
|
||||
@@ -45,6 +46,9 @@ export function PanelSurface({
|
||||
* others instead, whose names are `around` it. */
|
||||
onDashboard?: (by: number) => void
|
||||
around?: [string | undefined, string | undefined]
|
||||
/** Which way along the rail this dashboard was reached: down (1) or up
|
||||
* (-1). */
|
||||
turned?: number
|
||||
}) {
|
||||
const hasRail = Boolean(rail)
|
||||
const stack = stacked && !isRound(dashboard)
|
||||
@@ -57,9 +61,10 @@ export function PanelSurface({
|
||||
rail={hasRail}
|
||||
onDashboard={onDashboard}
|
||||
around={around}
|
||||
turned={turned}
|
||||
/>
|
||||
),
|
||||
[dashboard, hasRail, onDashboard, around],
|
||||
[dashboard, hasRail, onDashboard, around, turned],
|
||||
)
|
||||
return (
|
||||
<div className="relative size-full">
|
||||
@@ -76,7 +81,7 @@ export function PanelSurface({
|
||||
{/* Padded here rather than by the route: the stack overflows this
|
||||
box, so only padding inside the overflow clears the rail. */}
|
||||
<div className={cn("relative", rail && "pb-24")}>
|
||||
<DashboardView dashboard={dashboard} stacked />
|
||||
<DashboardView dashboard={dashboard} stacked turned={turned} />
|
||||
</div>
|
||||
{rail ? (
|
||||
// No column to spare on a phone, so the rail is a row floating
|
||||
|
||||
Reference in New Issue
Block a user