Keep the lock off the stacked editor while a dashboard is arranged

The phone path draws through DashboardView in both modes, so a locked
dashboard came out with dead controls while it was being arranged — the
canvas path hands editing to its own grid and never mounts the lock.
DashboardView takes `editing` and skips LockedProvider for it; reading a
locked dashboard stacked still locks. Guarded in mobile.spec.ts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1moruzue2kTJd3uVisgNk
This commit is contained in:
2026-08-28 19:27:55 +02:00
co-authored by Claude Opus 5
parent 9d11e01a48
commit 1feaa1f6cb
3 changed files with 72 additions and 12 deletions
@@ -461,6 +461,7 @@ export function DashboardEditor({
<DashboardView
dashboard={draft}
stacked
editing={edit}
renderWidget={edit ? pickable : undefined}
/>
</div>
@@ -306,6 +306,7 @@ export function DashboardView({
renderWidget,
stacked,
rail,
editing,
}: {
dashboard: Dashboard
renderWidget?: (widget: WidgetDef) => React.ReactNode
@@ -313,6 +314,9 @@ export function DashboardView({
stacked?: boolean
/** Whether the panel carries a rail, which takes a column of the canvas. */
rail?: boolean
/** Being arranged rather than used, so the lock is not mounted — the
* stacked editor draws through here, where the canvas draws its own grid. */
editing?: boolean
}) {
const all = widgetsOf(dashboard)
if (all.length === 0) {
@@ -337,20 +341,26 @@ export function DashboardView({
: all
const columns = columnsOf(dashboard)
const grid = (
<PaletteProvider dashboard={dashboard}>
<WidgetGrid
dashboard={dashboard}
widgets={widgets}
columns={columns}
stacked={stacked}
rail={rail}
renderWidget={renderWidget}
/>
</PaletteProvider>
)
return (
<LookProvider dashboard={dashboard}>
<LockedProvider dashboard={dashboard}>
<PaletteProvider dashboard={dashboard}>
<WidgetGrid
dashboard={dashboard}
widgets={widgets}
columns={columns}
stacked={stacked}
rail={rail}
renderWidget={renderWidget}
/>
</PaletteProvider>
</LockedProvider>
{editing ? (
grid
) : (
<LockedProvider dashboard={dashboard}>{grid}</LockedProvider>
)}
</LookProvider>
)
}