From 6ca8974eb9bf9856e9366f5bc54bb2860a725214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gjermund=20H=C3=B8s=C3=B8ien=20Wiggen?= Date: Tue, 9 Jun 2026 13:38:28 +0200 Subject: [PATCH] feat: add edit mode toggle to dashboard page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Edit/Done toggle button in header (pencil icon) - Widget delete buttons only visible in edit mode - Add widget button only visible in edit mode - Empty state prompts to enter edit mode instead of adding directly - Default is view mode — clean, no accidental deletes Co-Authored-By: Claude Opus 4.8 --- web/src/app/dashboards/[id]/page.tsx | 54 +++++++++++++++++++--------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/web/src/app/dashboards/[id]/page.tsx b/web/src/app/dashboards/[id]/page.tsx index 8f66e13..1438430 100644 --- a/web/src/app/dashboards/[id]/page.tsx +++ b/web/src/app/dashboards/[id]/page.tsx @@ -4,6 +4,7 @@ import { useState, useEffect, use, useCallback } from "react"; import { useRouter } from "next/navigation"; import Link from "next/link"; import { + PencilIcon, PlusIcon, Trash2Icon, RefreshCwIcon, @@ -58,6 +59,7 @@ export default function DashboardPage({ params }: { params: Promise<{ id: string const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [autoRefresh, setAutoRefresh] = useState(false); + const [editMode, setEditMode] = useState(false); const [teams, setTeams] = useState([]); // Add widget dialog @@ -231,6 +233,15 @@ export default function DashboardPage({ params }: { params: Promise<{ id: string
+ - + {editMode && ( + + )}
@@ -262,10 +275,17 @@ export default function DashboardPage({ params }: { params: Promise<{ id: string

No widgets yet

- + {editMode ? ( + + ) : ( + + )}
) : (
@@ -276,14 +296,16 @@ export default function DashboardPage({ params }: { params: Promise<{ id: string style={widgetGridStyle(widget.position)} > {renderWidget(widget)} - + {editMode && ( + + )}
))}