Draw a wall panel at the size it was drawn for
Docs / docs (push) Successful in 21s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m41s
Playwright Tests / test-playwright (2, 2) (push) Failing after 1m40s
pre-commit / pre-commit (push) Failing after 3m16s
Test Backend / test-backend (push) Successful in 2m18s
Compose Smoke Test / test-compose (push) Successful in 30s
Playwright Tests / merge-reports (push) Canceled after 0s
Docs / docs (push) Successful in 21s
Playwright Tests / test-playwright (1, 2) (push) Failing after 2m41s
Playwright Tests / test-playwright (2, 2) (push) Failing after 1m40s
pre-commit / pre-commit (push) Failing after 3m16s
Test Backend / test-backend (push) Successful in 2m18s
Compose Smoke Test / test-compose (push) Successful in 30s
Playwright Tests / merge-reports (push) Canceled after 0s
A dashboard whose canvas matches the screen came out at 95% of it: the panel and view routes inset the canvas by a further 16px, on top of the margin the grid already keeps from its own edges. Two margins, one of them costing the scale. The padding now applies only to the stacked phone layout, which has no canvas to shrink. A slider's tick labels are the third row of a control that has three, and the first thing a short tile runs out of; `ticks: false` drops them and keeps the reading and the track. The house's two sliders set it. The 1024x600 preset is named for what it is rather than for a diagonal it may not have — the same resolution is sold as a seven-inch panel and as a ten-inch one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012n6CehUsHYYUXJ48rxaD18
This commit is contained in:
@@ -26,9 +26,16 @@ export const COLUMN_CHOICES = [6, 8, 12, 16, 24]
|
|||||||
/** The panel a dashboard is drawn for, if the document does not say. */
|
/** The panel a dashboard is drawn for, if the document does not say. */
|
||||||
export const DEFAULT_CANVAS = { width: 1920, height: 1080 }
|
export const DEFAULT_CANVAS = { width: 1920, height: 1080 }
|
||||||
|
|
||||||
/** Panels worth a name; anything else is typed in as two numbers. */
|
/**
|
||||||
|
* Panels worth a name; anything else is typed in as two numbers.
|
||||||
|
*
|
||||||
|
* Named for what they are, not for a diagonal: 1024x600 is sold as a seven-inch
|
||||||
|
* panel and as a ten-inch one, and the dashboard is laid out in pixels either
|
||||||
|
* way. A canvas set to the screen it hangs on now draws at 1:1 — the routes
|
||||||
|
* that show a panel no longer inset it.
|
||||||
|
*/
|
||||||
export const CANVAS_PRESETS = [
|
export const CANVAS_PRESETS = [
|
||||||
{ label: '7" panel', width: 1024, height: 600 },
|
{ label: "Wall panel", width: 1024, height: 600 },
|
||||||
{ label: '10" tablet', width: 1280, height: 800 },
|
{ label: '10" tablet', width: 1280, height: 800 },
|
||||||
{ label: "Full HD", width: 1920, height: 1080 },
|
{ label: "Full HD", width: 1920, height: 1080 },
|
||||||
{ label: '10" tablet, portrait', width: 800, height: 1280 },
|
{ label: '10" tablet, portrait', width: 800, height: 1280 },
|
||||||
|
|||||||
@@ -494,7 +494,11 @@ function SliderWidget({ widget, dashboard }: WidgetProps) {
|
|||||||
max={num(cfg.max, 100)}
|
max={num(cfg.max, 100)}
|
||||||
step={num(cfg.step, 1)}
|
step={num(cfg.step, 1)}
|
||||||
unit={unit}
|
unit={unit}
|
||||||
ticks
|
// On by default, because a slider without them says how far along it
|
||||||
|
// is and not what that means. Off is for a short tile: they are the
|
||||||
|
// last row of a control that has three, and on a seven-inch panel
|
||||||
|
// that row is the difference between fitting and being cut off.
|
||||||
|
ticks={cfg.ticks !== false}
|
||||||
label={widget.title || target}
|
label={widget.title || target}
|
||||||
disabled={locked}
|
disabled={locked}
|
||||||
onCommit={send}
|
onCommit={send}
|
||||||
|
|||||||
@@ -81,9 +81,13 @@ function PanelRoute() {
|
|||||||
data-touch={root["data-touch"]}
|
data-touch={root["data-touch"]}
|
||||||
data-palette={root["data-palette"]}
|
data-palette={root["data-palette"]}
|
||||||
className={cn(
|
className={cn(
|
||||||
"relative h-svh w-full bg-background p-4 text-foreground",
|
"relative h-svh w-full bg-background text-foreground",
|
||||||
root.className,
|
root.className,
|
||||||
stacked ? "overflow-y-auto" : "overflow-hidden",
|
// Padding only when stacked. A canvas is already held off its own
|
||||||
|
// edges by the grid inset, and a second margin outside it costs the
|
||||||
|
// scale: a dashboard drawn for this screen would come out at 95% of
|
||||||
|
// the screen it was drawn for.
|
||||||
|
stacked ? "overflow-y-auto p-4" : "overflow-hidden",
|
||||||
)}
|
)}
|
||||||
style={root.style}
|
style={root.style}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -63,9 +63,11 @@ function PanelView() {
|
|||||||
data-touch={root["data-touch"]}
|
data-touch={root["data-touch"]}
|
||||||
data-palette={root["data-palette"]}
|
data-palette={root["data-palette"]}
|
||||||
className={cn(
|
className={cn(
|
||||||
"h-svh w-full bg-background p-4 text-foreground",
|
"h-svh w-full bg-background text-foreground",
|
||||||
root.className,
|
root.className,
|
||||||
stacked ? "overflow-y-auto" : "overflow-hidden",
|
// See `panel.$id`: the canvas keeps its own margin, so a second one
|
||||||
|
// here only shrinks it.
|
||||||
|
stacked ? "overflow-y-auto p-4" : "overflow-hidden",
|
||||||
)}
|
)}
|
||||||
style={root.style}
|
style={root.style}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user