Float the dashboard rail along the bottom on a phone

Below md a dashboard stacks to one column and dropped its rail. The rail is
now a horizontal row in the dashboard's own look, floated over the bottom
of the screen on /panel/{id} and above the dock in the app's view, with
44px items, sideways scrolling when it overflows, and padding so the last
tile clears it; a panel's read-only notice moves up out of its way. The
three looks share the geometry from ui/core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
2026-10-06 00:22:28 +02:00
co-authored by Claude Opus 5.5
parent 2c1ad395de
commit d7ca933478
10 changed files with 108 additions and 65 deletions
@@ -147,8 +147,26 @@ export type RailProps = {
active: boolean
link: LinkProps
}[]
/** A row rather than a column, for a phone; whoever draws it places it. */
horizontal?: boolean
}
/**
* Where a rail runs, shared by the looks, which only paint it.
*
* A column centred down the canvas's left edge, as tall as what it carries: a
* rail of two stretched to the height of the panel is mostly empty pill. Below
* `md` there is no column to spare, so it is a row instead, floated along the
* bottom by its caller. More dashboards than fit still scroll, but no bar is
* ever drawn — a wall panel is swiped, and there is no room.
*/
export const railGeometry = (horizontal = false) =>
`pointer-events-auto z-10 flex items-center gap-1 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${
horizontal
? "max-w-full flex-row overflow-x-auto"
: "absolute left-3 top-1/2 max-h-[calc(100%-1.5rem)] w-12 -translate-y-1/2 flex-col overflow-y-auto"
}`
export type NoticeProps = { children: React.ReactNode }
/** The ambient ground under the widgets, or the image that replaces it. */
@@ -83,6 +83,12 @@
height: 1.5rem;
}
/* The row a phone gets has no column to fit, and a phone is touched. */
.dui-rail[data-orientation="horizontal"] .dui-rail-item {
width: 2.75rem;
height: 2.75rem;
}
/*
* Pulled up half a step, so the title reads from the centre of the corner
* radius rather than from below it — and the body, which is what anyone is
@@ -23,7 +23,7 @@ import type {
NoticeProps,
RailProps,
} from "../core/contract"
import { TESTID } from "../core/contract"
import { railGeometry, TESTID } from "../core/contract"
import { LOOK } from "../core/motion"
/** The page colour is the ground; only an image is drawn over it. */
@@ -110,19 +110,13 @@ export function Frame({
)
}
export function Rail({ entries }: RailProps) {
export function Rail({ entries, horizontal }: RailProps) {
return (
<nav
aria-label="Dashboards on this panel"
data-testid={TESTID.rail}
className={cn(
"dui-rail fx-rail pointer-events-auto absolute left-3 top-1/2 z-10 flex max-h-[calc(100%-1.5rem)] w-12 -translate-y-1/2 flex-col items-center gap-1 p-1",
// As tall as what it carries, centred in the column it reserves: a
// rail of two stretched to the height of the panel is mostly empty
// pill. More dashboards than the panel is tall still scroll, but no
// bar is ever drawn — a wall panel is swiped, and there is no room.
"overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
)}
data-orientation={horizontal ? "horizontal" : undefined}
className={cn("dui-rail fx-rail", railGeometry(horizontal))}
>
{entries.map((entry) => {
const Glyph = ICONS[entry.icon ?? ""]
@@ -149,7 +143,9 @@ export function Rail({ entries }: RailProps) {
</span>
</Link>
</TooltipTrigger>
<TooltipContent side="right">{entry.label}</TooltipContent>
<TooltipContent side={horizontal ? "top" : "right"}>
{entry.label}
</TooltipContent>
</Tooltip>
)
})}
@@ -22,7 +22,7 @@ import type {
NoticeProps,
RailProps,
} from "../core/contract"
import { TESTID } from "../core/contract"
import { railGeometry, TESTID } from "../core/contract"
import { LOOK } from "../core/motion"
/**
@@ -143,19 +143,13 @@ export function Frame({
)
}
export function Rail({ entries }: RailProps) {
export function Rail({ entries, horizontal }: RailProps) {
return (
<nav
aria-label="Dashboards on this panel"
data-testid={TESTID.rail}
className={cn(
"dui-rail gl-surface gl-rail pointer-events-auto absolute left-3 top-1/2 z-10 flex max-h-[calc(100%-1.5rem)] w-12 -translate-y-1/2 flex-col items-center gap-1 p-1",
// As tall as what it carries, centred in the column it reserves: a
// rail of two stretched to the height of the panel is mostly empty
// pill. More dashboards than the panel is tall still scroll, but no
// bar is ever drawn — a wall panel is swiped, and there is no room.
"overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
)}
data-orientation={horizontal ? "horizontal" : undefined}
className={cn("dui-rail gl-surface gl-rail", railGeometry(horizontal))}
>
{entries.map((entry) => {
const Glyph = ICONS[entry.icon ?? ""]
@@ -186,7 +180,9 @@ export function Rail({ entries }: RailProps) {
</span>
</Link>
</TooltipTrigger>
<TooltipContent side="right">{entry.label}</TooltipContent>
<TooltipContent side={horizontal ? "top" : "right"}>
{entry.label}
</TooltipContent>
</Tooltip>
)
})}
@@ -22,7 +22,7 @@ import type {
NoticeProps,
RailProps,
} from "../core/contract"
import { TESTID } from "../core/contract"
import { railGeometry, TESTID } from "../core/contract"
import { LOOK } from "../core/motion"
/** Material's ground is the surface colour itself; only an image is drawn. */
@@ -109,19 +109,13 @@ export function Frame({
)
}
export function Rail({ entries }: RailProps) {
export function Rail({ entries, horizontal }: RailProps) {
return (
<nav
aria-label="Dashboards on this panel"
data-testid={TESTID.rail}
className={cn(
"dui-rail m3-rail pointer-events-auto absolute left-3 top-1/2 z-10 flex max-h-[calc(100%-1.5rem)] w-12 -translate-y-1/2 flex-col items-center gap-1 p-1",
// As tall as what it carries, centred in the column it reserves: a
// rail of two stretched to the height of the panel is mostly empty
// pill. More dashboards than the panel is tall still scroll, but no
// bar is ever drawn — a wall panel is swiped, and there is no room.
"overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
)}
data-orientation={horizontal ? "horizontal" : undefined}
className={cn("dui-rail m3-rail", railGeometry(horizontal))}
>
{entries.map((entry) => {
const Glyph = ICONS[entry.icon ?? ""]
@@ -155,7 +149,9 @@ export function Rail({ entries }: RailProps) {
</span>
</Link>
</TooltipTrigger>
<TooltipContent side="right">{entry.label}</TooltipContent>
<TooltipContent side={horizontal ? "top" : "right"}>
{entry.label}
</TooltipContent>
</Tooltip>
)
})}