[eric] dashboard: don't wipe layout mid-drag + never route to a phantom (deleted) dashboard id (dragging cards was silently broken by a spurious layout reset)

This commit is contained in:
ciregenz
2026-07-15 18:07:38 -07:00
parent c50947edad
commit d4db6e7c9d
2 changed files with 13 additions and 8 deletions
@@ -255,7 +255,9 @@ const AppShell: React.FC = () => {
dispatch(setPendingBrowserUrl(url));
const lastId = (window as any).__openswarm_last_dashboard_id as string | undefined;
const firstDashboard = dashboardList[0];
const targetId = lastId || firstDashboard?.id;
// Only navigate to lastId if it's a REAL dashboard: a stale localStorage id for a deleted dashboard used to route to /dashboard/<phantom>, which 404s and re-fires the layout wipe (drops your cards / breaks a drag).
const lastIsReal = !!lastId && dashboardList.some((d) => d.id === lastId);
const targetId = (lastIsReal ? lastId : undefined) || firstDashboard?.id;
if (targetId) {
navigate(`/dashboard/${targetId}`);
} else {