Touch is a panel setting, and the rail grows with it
It described the wrong object. A dashboard is a document that may hang on a
hallway tablet and in a desk browser at the same time, and only one of those
has fingers on it — so the flag moves off `DashboardDef.settings` and onto
`PanelDef` as a plain bool, ticked in the Panels dialog. `useCanvasRoot` takes
it as an argument rather than reading the document, and `/panel/{id}` is the
only surface with a panel to ask.
Dropping the message binding with it is deliberate: nothing drove it, and a
flow deciding whether a screen has fingers on it was never the point. A stored
`settings.touch` is inert rather than migrated, which `_check_settings`
skipping unknown names already guaranteed.
The rail was the other half. It had no touch behaviour at all and its 40px
buttons met neither branch of the 44/32 rule. `[data-touch] .dui-rail{-item}`
in `ui/core/core.css` spends the padding and the gap on the buttons instead,
so they reach the 44px target and the rail comes out taller at exactly the
same width — `RAIL_INSET` never moves, and the arrangement under it does not
either.
Also closes the panels-dialog icon gap: `DashboardSummary` carries the `icon`
now, so the dialog draws each assigned dashboard's rail glyph beside its
checkbox. `initials()` went from three identical copies in the looks to one in
`Dashboard/icons.ts`, so the dialog and the rail fall back the same way.
This commit is contained in:
@@ -1521,7 +1521,6 @@ function PalettePicker({
|
||||
/** How a setting's own value reads in the "nothing is driving it" line. */
|
||||
function valueLabel(name: SettingName, value: unknown): string {
|
||||
if (name === "locked") return value === true ? "read-only" : "editable"
|
||||
if (name === "touch") return value === true ? "touch friendly" : "pointer"
|
||||
if (name === "look") return lookOf(value)
|
||||
if (name === "background") return value ? "that image" : "no image"
|
||||
if (name === "palette") {
|
||||
@@ -1560,7 +1559,6 @@ export function DashboardPanel({
|
||||
const locked = settingOf(dashboard, "locked")
|
||||
const look = settingOf(dashboard, "look")
|
||||
const background = settingOf(dashboard, "background")
|
||||
const touch = settingOf(dashboard, "touch")
|
||||
const paletteSetting = settingOf(dashboard, "palette")
|
||||
const palette = parsePalette(paletteSetting.value)
|
||||
|
||||
@@ -1765,28 +1763,6 @@ export function DashboardPanel({
|
||||
/>
|
||||
</PanelSection>
|
||||
|
||||
<PanelSection
|
||||
title="Touch"
|
||||
help="Bigger controls, and nothing that only happens on hover, for a panel that is touched rather than pointed at. A phone gets this anyway; a wall panel cannot say so for itself."
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2 text-sm">
|
||||
Touch friendly
|
||||
<Switch
|
||||
checked={touch.value === true}
|
||||
aria-label="Touch friendly"
|
||||
data-testid="dashboard-touch"
|
||||
onCheckedChange={(value) =>
|
||||
setSetting("touch", { ...touch, value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<SettingBinding
|
||||
name="touch"
|
||||
setting={touch}
|
||||
onChange={(setting) => setSetting("touch", setting)}
|
||||
/>
|
||||
</PanelSection>
|
||||
|
||||
<PanelSection
|
||||
title="Lock"
|
||||
help="Locked, the controls are still shown but stop publishing, and the surface says so. This is a read-only surface, not a permission: what a paired screen may reach is decided by its own credential."
|
||||
|
||||
Reference in New Issue
Block a user