Grow the editor's canvas to reach widgets below its edge

A widget that fell off the panel, after the canvas was made smaller, was
drawn under the clip and could only be re-packed with Reflow. Editing, the
canvas now extends to the lowest widget and scrolls, with the panel's own
edge dashed and the area past it hatched, so the widget can be dragged
back. The scale stays the panel's, and view mode is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 16:05:23 +02:00
co-authored by Claude Opus 5.5
parent 4ae8535cbb
commit 361b9d8e74
4 changed files with 74 additions and 5 deletions
@@ -561,6 +561,11 @@ export function DashboardEditor({
// now falls past its bottom edge drawn under the clip. A round face has no
// grid to fall off.
const clipped = round ? [] : layout.filter((item) => item.y + item.h > rows)
// Editing, the canvas grows to reach them, so they can be dragged back.
const reach =
edit && clipped.length
? Math.max(...clipped.map((item) => item.y + item.h))
: undefined
const shown = Math.max(
0,
widgets.findIndex((widget) => widget.id === (selected ?? face)),
@@ -669,7 +674,7 @@ export function DashboardEditor({
) : null}
</div>
) : (
<CanvasSurface dashboard={draft} dots={edit} rail={rail}>
<CanvasSurface dashboard={draft} dots={edit} rail={rail} reach={reach}>
{(scale) =>
!edit ? (
<DashboardView dashboard={draft} rail={hasRail} />