diff --git a/src/govoplan_dashboard/backend/manifest.py b/src/govoplan_dashboard/backend/manifest.py index c18e428..a716f60 100644 --- a/src/govoplan_dashboard/backend/manifest.py +++ b/src/govoplan_dashboard/backend/manifest.py @@ -156,7 +156,10 @@ manifest = ModuleManifest( body=( "A Dashboard layout belongs to the active tenant, account, and focused View. " "Configuring changes only a local draft until Save layout is selected; Cancel or " - "Discard restores the last saved arrangement. Widget removal removes only the placement, " + "Discard restores the last saved arrangement. The page action bar always reports whether " + "the draft is saved, unsaved, or currently saving; Save and Cancel remain visible in stable " + "positions and are disabled with an explanation when no draft change exists. Leaving while " + "dirty invokes the shared save-or-discard guard. Widget removal removes only the placement, " "not the module data represented by the widget. Reset restores the defaults announced by " "currently active modules and remains reversible until save. A widget is offered only when " "its module, focused View surface, and permission contract are available. Widgets never grant " diff --git a/webui/src/features/dashboard/DashboardPage.tsx b/webui/src/features/dashboard/DashboardPage.tsx index 8f3e277..58ca25d 100644 --- a/webui/src/features/dashboard/DashboardPage.tsx +++ b/webui/src/features/dashboard/DashboardPage.tsx @@ -16,6 +16,7 @@ import { DocumentationHelpLink, LoadingFrame, MetricCard, + PageActionBar, PageLayout, dashboardWidgetsForModules, hasAnyScope, @@ -443,53 +444,46 @@ export default function DashboardPage({ return ( - - {!configuring && ( - <> - - - - )} - {configuring && ( - <> - - - - )} - - } + actions={configuring ? ( + } + discardAction={{ label: <> Cancel, onClick: discardChanges }} + saveAction={{ label: <> Save layout, onClick: () => void persistLayout() }} + /> + ) : ( + setRefreshKey((value) => value + 1)} + disabled={loading} + disabledReason={loading ? DASHBOARD_I18N.loading : undefined} + > + Refresh + + )} + helpAction={} + primaryActions={( + + )} + /> + )} >