Drop the dashboard's Setup health banner

The status bar already shows the setup score on every page and opens
the same review, so the banner repeated it at the top of the dashboard.
Dashboard layout baselines updated.
This commit is contained in:
Juan Denis committed 2026-11-14 14:09:29 -05:00
1 parent 119e0e0f05
commit 026b963c41
26 files changed
+18 -390

No files matched your search

@@ -1,116 +0,0 @@
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import api from '../../services/api';
import { ShieldAlert, ShieldCheck, ChevronRight, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
// Compact "how set-up is this panel" card for the dashboard (admin-only).
// Reads GET /setup-health and shows the score + the top open items, each
// deep-linking to its fix. Collapses to a slim "all set" line when clean —
// no dead card.
const DISMISS_KEY = 'serverkit.setupHealth.dismissed';
const SetupHealthWidget = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [dismissed, setDismissed] = useState(() => {
try { return localStorage.getItem(DISMISS_KEY) === '1'; } catch { return false; }
});
useEffect(() => {
let cancelled = false;
api.getSetupHealth()
.then((res) => { if (!cancelled) setData(res); })
.catch(() => { /* non-admin or error — widget stays quiet */ })
.finally(() => { if (!cancelled) setLoading(false); });
return () => { cancelled = true; };
}, []);
if (dismissed) return null;
if (loading || !data || !data.summary) {
return (
<div className="setup-health-widget setup-health-widget--loading" role="status">
<ShieldCheck size={16} />
<span>{t('app.setupHealthWidget.setupHealth', 'Setup health')}</span>
<span className="setup-health-widget__muted">
{loading
? t('common.checking', 'Checking…')
: t('app.setupHealthWidget.unavailable', 'Unavailable')}
</span>
</div>
);
}
const { summary } = data;
const openCount = Number(summary.critical_open || 0) + Number(summary.recommended_open || 0);
const dismiss = () => {
setDismissed(true);
try { localStorage.setItem(DISMISS_KEY, '1'); } catch { /* ignore */ }
};
// Clean → slim "all set" line, not a big empty card.
if (openCount === 0) {
return (
<Button variant="unstyled"
type="button"
className="setup-health-widget setup-health-widget--clean"
onClick={() => navigate('/monitoring/doctor')}
>
<ShieldCheck size={16} />
<span className="setup-health-widget__cleanlabel">
{t('app.setupHealthWidget.allSet', 'Setup complete:')} {summary.score}{t('app.setupHealthWidget.setupHealth2', '% setup health')}
</span>
<ChevronRight size={14} />
</Button>
);
}
return (
<div className="setup-health-widget">
<ShieldAlert size={16} className="setup-health-widget__icon" />
<span className="setup-health-widget__title">{t('app.setupHealthWidget.setupHealth', 'Setup health')}</span>
<span className="setup-health-widget__score">{summary.score}%</span>
<progress max="100" value={summary.score} aria-label={t('app.setupHealthWidget.progress', 'Setup health progress')} />
<span className="setup-health-widget__summary">
{summary.critical_open > 0 && t(
'app.setupHealthWidget.criticalCount',
'{{count}} critical',
{ count: summary.critical_open },
)}
{summary.critical_open > 0 && summary.recommended_open > 0 && ' · '}
{summary.recommended_open > 0 && t(
'app.setupHealthWidget.recommendedCount',
'{{count}} recommended',
{ count: summary.recommended_open },
)}
</span>
<span className="setup-health-widget__spacer" />
<Button
type="button"
variant="outline"
size="sm"
onClick={() => navigate('/monitoring/doctor')}
title={t('app.setupHealthWidget.moreInDoctor', 'more in Doctor')}
>
{t('app.setupHealthWidget.review', 'Review')}
</Button>
<Button variant="unstyled"
type="button"
className="setup-health-widget__dismiss"
onClick={dismiss}
aria-label={t('common.actions.dismiss', 'Dismiss')}
title={t('app.setupHealthWidget.dismissHint', 'Dismiss (setup health stays in the status bar)')}
>
<X size={14} />
</Button>
</div>
);
};
export default SetupHealthWidget;
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "أدخل اسم النطاق أولاً"
},
"setupHealthWidget": {
"allSet": "كل شيء جاهز —",
"criticalCount": "{{count}} حرجة",
"dismissHint": "تجاهل — تبقى صحة الإعداد في شريط الحالة",
"moreInDoctor": "المزيد في دكتور",
"progress": "تقدم صحة الإعداد",
"recommendedCount": "{{count}} موصى بها",
"review": "مراجعة",
"setupHealth": "صحة الإعداد",
"setupHealth2": "صحة الإعداد٪",
"unavailable": "غير متاح"
"setupHealth": "صحة الإعداد"
},
"setupStepAccount": {
"adminEmail": "البريد الإلكتروني المشرف",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "আগে ডোমেইনের নাম লিখুন"
},
"setupHealthWidget": {
"allSet": "সব প্রস্তুত -",
"criticalCount": "{{count}}টি গুরুতর",
"dismissHint": "খারিজ করুন — সেটআপ স্বাস্থ্য স্ট্যাটাস বারে থাকে",
"moreInDoctor": "ডাক্তারে আরও",
"progress": "সেটআপ স্বাস্থ্যের অগ্রগতি",
"recommendedCount": "{{count}}টি প্রস্তাবিত",
"review": "পর্যালোচনা",
"setupHealth": "সেটআপ স্বাস্থ্য",
"setupHealth2": "% সেটআপ স্বাস্থ্য",
"unavailable": "অনুপলব্ধ"
"setupHealth": "সেটআপ স্বাস্থ্য"
},
"setupStepAccount": {
"adminEmail": "অ্যাডমিন ইমেইল",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Zuerst einen Domainnamen eingeben"
},
"setupHealthWidget": {
"allSet": "Alles klar –",
"criticalCount": "{{count}} kritisch",
"dismissHint": "Verwerfen — der Setup-Zustand bleibt in der Statusleiste",
"moreInDoctor": "mehr in Doktor",
"progress": "Fortschritt des Setup-Zustands",
"recommendedCount": "{{count}} empfohlen",
"review": "Überprüfen",
"setupHealth": "Setup-Zustand",
"setupHealth2": "% Setup-Zustand",
"unavailable": "Nicht verfügbar"
"setupHealth": "Setup-Zustand"
},
"setupStepAccount": {
"adminEmail": "Admin-E-Mail",
+1 -9
View File
@@ -6437,16 +6437,8 @@
"usedForCertificateExpiryRemindersFrom": "Used for certificate expiry reminders from Let's Encrypt."
},
"setupHealthWidget": {
"allSet": "Setup complete:",
"criticalCount": "{{count}} critical",
"dismissHint": "Dismiss (setup health stays in the status bar)",
"moreInDoctor": "more in Doctor",
"progress": "Setup health progress",
"recommendedCount": "{{count}} recommended",
"review": "Review",
"setupHealth": "Setup health",
"setupHealth2": "% setup health",
"unavailable": "Unavailable"
"setupHealth": "Setup health"
},
"setupStepAccount": {
"adminEmail": "Admin email",
+1 -9
View File
@@ -6161,16 +6161,8 @@
"enterADomainNameFirst": "Introduce primero un nombre de dominio"
},
"setupHealthWidget": {
"allSet": "Todo listo —",
"criticalCount": "{{count}} críticos",
"dismissHint": "Descartar — el estado de la configuración permanece en la barra de estado",
"moreInDoctor": "más en Doctor",
"progress": "Progreso del estado de la configuración",
"recommendedCount": "{{count}} recomendados",
"review": "Revisar",
"setupHealth": "Estado de la configuración",
"setupHealth2": "% de estado de la configuración",
"unavailable": "No disponible"
"setupHealth": "Estado de la configuración"
},
"setupStepAccount": {
"adminEmail": "Correo electrónico del administrador",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Saisissez d'abord un nom de domaine"
},
"setupHealthWidget": {
"allSet": "Tout est prêt -",
"criticalCount": "{{count}} critiques",
"dismissHint": "Ignorer — la santé de la configuration reste dans la barre d'état",
"moreInDoctor": "plus dans Docteur",
"progress": "Progression de la santé de la configuration",
"recommendedCount": "{{count}} recommandés",
"review": "Examiner",
"setupHealth": "État de santé de la configuration",
"setupHealth2": "% de santé de la configuration",
"unavailable": "Indisponible"
"setupHealth": "État de santé de la configuration"
},
"setupStepAccount": {
"adminEmail": "E-mail de l'administrateur",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Masukkan nama domain terlebih dahulu"
},
"setupHealthWidget": {
"allSet": "Semua siap —",
"criticalCount": "{{count}} kritis",
"dismissHint": "Tutup — kesehatan penyiapan tetap ada di bilah status",
"moreInDoctor": "lebih lanjut di Dokter",
"progress": "Progres kesehatan penyiapan",
"recommendedCount": "{{count}} direkomendasikan",
"review": "Tinjau",
"setupHealth": "Kesehatan Penyiapan",
"setupHealth2": "% kesehatan penyiapan",
"unavailable": "Tidak tersedia"
"setupHealth": "Kesehatan Penyiapan"
},
"setupStepAccount": {
"adminEmail": "Email Admin",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Inserisci prima un nome di dominio"
},
"setupHealthWidget": {
"allSet": "Tutto pronto -",
"criticalCount": "{{count}} critici",
"dismissHint": "Ignora — l'integrità della configurazione resta nella barra di stato",
"moreInDoctor": "di più in Dottore",
"progress": "Avanzamento dell'integrità della configurazione",
"recommendedCount": "{{count}} consigliati",
"review": "Rivedi",
"setupHealth": "Stato della configurazione",
"setupHealth2": "% integrità configurazione",
"unavailable": "Non disponibile"
"setupHealth": "Stato della configurazione"
},
"setupStepAccount": {
"adminEmail": "E-mail dell'amministratore",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "먼저 도메인 이름을 입력하세요"
},
"setupHealthWidget": {
"allSet": "모든 설정 —",
"criticalCount": "심각 {{count}}개",
"dismissHint": "닫기 — 설정 상태는 상태 표시줄에 유지됩니다",
"moreInDoctor": "닥터에서 더 보기",
"progress": "설정 상태 진행률",
"recommendedCount": "권장 {{count}}개",
"review": "검토",
"setupHealth": "설정 상태",
"setupHealth2": "% 설정 상태",
"unavailable": "사용할 수 없음"
"setupHealth": "설정 상태"
},
"setupStepAccount": {
"adminEmail": "관리자 이메일",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Najpierw wpisz nazwę domeny"
},
"setupHealthWidget": {
"allSet": "Wszystko gotowe —",
"criticalCount": "{{count}} krytycznych",
"dismissHint": "Odrzuć — kondycja konfiguracji pozostaje na pasku stanu",
"moreInDoctor": "więcej w Doktorze",
"progress": "Postęp kondycji konfiguracji",
"recommendedCount": "{{count}} zalecanych",
"review": "Przejrzyj",
"setupHealth": "Kondycja konfiguracji",
"setupHealth2": "% kondycji konfiguracji",
"unavailable": "Niedostępne"
"setupHealth": "Kondycja konfiguracji"
},
"setupStepAccount": {
"adminEmail": "Adres e-mail administratora",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Informe primeiro um nome de domínio"
},
"setupHealthWidget": {
"allSet": "Tudo pronto -",
"criticalCount": "{{count}} críticos",
"dismissHint": "Dispensar — a integridade da configuração permanece na barra de status",
"moreInDoctor": "mais em Doutor",
"progress": "Progresso da integridade da configuração",
"recommendedCount": "{{count}} recomendados",
"review": "Revisar",
"setupHealth": "Integridade da configuração",
"setupHealth2": "% de integridade da configuração",
"unavailable": "Indisponível"
"setupHealth": "Integridade da configuração"
},
"setupStepAccount": {
"adminEmail": "E-mail do administrador",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Сначала введите имя домена"
},
"setupHealthWidget": {
"allSet": "Все готово —",
"criticalCount": "{{count}} критических",
"dismissHint": "Скрыть — состояние настройки остаётся в строке состояния",
"moreInDoctor": "подробнее в Докторе",
"progress": "Ход настройки",
"recommendedCount": "{{count}} рекомендуемых",
"review": "Просмотреть",
"setupHealth": "Состояние настройки",
"setupHealth2": "% работоспособности настройки",
"unavailable": "Недоступно"
"setupHealth": "Состояние настройки"
},
"setupStepAccount": {
"adminEmail": "Электронная почта администратора",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "กรอกชื่อโดเมนก่อน"
},
"setupHealthWidget": {
"allSet": "เรียบร้อยแล้ว —",
"criticalCount": "วิกฤต {{count}} รายการ",
"dismissHint": "ปิดทิ้ง — สถานะสุขภาพการตั้งค่ายังอยู่ในแถบสถานะ",
"moreInDoctor": "เพิ่มเติมในคุณหมอ",
"progress": "ความคืบหน้าสถานะการตั้งค่า",
"recommendedCount": "แนะนำ {{count}} รายการ",
"review": "ตรวจสอบ",
"setupHealth": "สถานะการตั้งค่า",
"setupHealth2": "% ความสมบูรณ์ของการตั้งค่า",
"unavailable": "ไม่พร้อมใช้งาน"
"setupHealth": "สถานะการตั้งค่า"
},
"setupStepAccount": {
"adminEmail": "อีเมล์ผู้ดูแลระบบ",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Önce bir alan adı girin"
},
"setupHealthWidget": {
"allSet": "Her şey hazır —",
"criticalCount": "{{count}} kritik",
"dismissHint": "Kapat — kurulum durumu durum çubuğunda kalır",
"moreInDoctor": "Doktor'da daha fazlası",
"progress": "Kurulum durumu ilerlemesi",
"recommendedCount": "{{count}} önerilen",
"review": "İncele",
"setupHealth": "Kurulum Durumu",
"setupHealth2": "% kurulum durumu",
"unavailable": "Kullanılamıyor"
"setupHealth": "Kurulum Durumu"
},
"setupStepAccount": {
"adminEmail": "Yönetici E-postası",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "Hãy nhập tên miền trước"
},
"setupHealthWidget": {
"allSet": "Mọi thứ đã sẵn sàng —",
"criticalCount": "{{count}} nghiêm trọng",
"dismissHint": "Bỏ qua — sức khỏe thiết lập vẫn nằm trên thanh trạng thái",
"moreInDoctor": "thêm trong Bác sĩ",
"progress": "Tiến độ tình trạng thiết lập",
"recommendedCount": "{{count}} được khuyến nghị",
"review": "Xem lại",
"setupHealth": "Tình trạng thiết lập",
"setupHealth2": "% tình trạng thiết lập",
"unavailable": "Không khả dụng"
"setupHealth": "Tình trạng thiết lập"
},
"setupStepAccount": {
"adminEmail": "Email quản trị",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "请先输入域名"
},
"setupHealthWidget": {
"allSet": "一切就绪——",
"criticalCount": "{{count}} 个严重问题",
"dismissHint": "忽略 — 设置健康状况会保留在状态栏中",
"moreInDoctor": "在医生中查看更多",
"progress": "设置健康状况进度",
"recommendedCount": "{{count}} 个建议项",
"review": "查看",
"setupHealth": "设置健康状况",
"setupHealth2": "% 设置健康状况",
"unavailable": "不可用"
"setupHealth": "设置健康状况"
},
"setupStepAccount": {
"adminEmail": "管理员电子邮件",
+1 -9
View File
@@ -6160,16 +6160,8 @@
"enterADomainNameFirst": "請先輸入網域名稱"
},
"setupHealthWidget": {
"allSet": "一切就緒——",
"criticalCount": "{{count}} 個嚴重",
"dismissHint": "關閉——設定健康狀態會保留在狀態列中",
"moreInDoctor": "前往 [診斷] 檢視更多資訊",
"progress": "設定健康進度",
"recommendedCount": "{{count}} 個建議",
"review": "檢視",
"setupHealth": "設定健康狀況",
"setupHealth2": "% 設定健康狀況",
"unavailable": "不可用"
"setupHealth": "設定健康狀況"
},
"setupStepAccount": {
"adminEmail": "管理員信箱",
-8
View File
@@ -20,7 +20,6 @@ import ChangeBar from '../components/ds/ChangeBar';
import ShortcutSheet from '../components/ds/ShortcutSheet';
import EmptyState from '../components/EmptyState';
import PluginSlot from '../components/PluginSlot';
import SetupHealthWidget from '../components/dashboard/SetupHealthWidget';
import { DashGrid } from '../components/dashboard/grid/DashGrid';
import { WidgetLibrary } from '../components/dashboard/grid/WidgetLibrary';
import { WidgetEditor } from '../components/dashboard/grid/WidgetEditor';
@@ -489,13 +488,6 @@ const Dashboard = () => {
{/* Extension slot: widgets contributed to the top of the dashboard */}
<PluginSlot name="dashboard.top" />
{/* Setup health. Deliberately NOT a placeable board widget: an
unfirewalled box must be visible without the operator first
opting into a widget, and the card collapses to a single "all
set" line once everything is done, so it costs nothing when
clean. Admin-only — the endpoint is too. */}
{isAdmin && <SetupHealthWidget />}
{/* Board tabs + board-wide controls */}
<div className="skw-bar">
{/* One selector for every dashboard, however many there are: a
+1 -3
View File
@@ -18,7 +18,6 @@
.sk-viewpick,
.ui-select-trigger,
.settings-nav-item,
.setup-health-widget__dismiss,
.detail-tabs__tab,
[role='tab'],
input.ui-input,
@@ -30,8 +29,7 @@
.quick-create,
.sk-notif__bell,
.sk-gridicon,
.skw-iconbtn,
.setup-health-widget__dismiss {
.skw-iconbtn {
min-width: $control-lg;
}
@@ -1,109 +0,0 @@
// ============================================
// SETUP HEALTH — dashboard card
// Compact "how set-up is this panel" card: score + top open items, each
// deep-linking to its fix. Collapses to a slim "all set" line when clean.
// Sits above the board as a direct child of .dashboard-page (a flex column),
// so vertical rhythm comes from that container's gap — no margin here.
// ============================================
.setup-health-widget {
display: flex;
align-items: center;
gap: $space-3;
min-width: 0;
padding: $space-2 $space-2 $space-2 $space-3;
border: 1px solid var(--border-soft, #{$border-default});
border-radius: $radius-card;
background: var(--surface, #{$bg-card});
&__title {
color: $text-primary;
font-size: $text-sm;
font-weight: $font-weight-semibold;
white-space: nowrap;
}
&__score {
color: var(--amber);
font-size: $text-xs;
font-weight: $font-weight-semibold;
font-variant-numeric: tabular-nums;
}
&__icon {
flex: 0 0 auto;
color: var(--amber);
}
> progress {
width: 88px;
height: 4px;
overflow: hidden;
border: 0;
border-radius: $radius-full;
background: var(--surface-3);
appearance: none;
&::-webkit-progress-bar { background: var(--surface-3); }
&::-webkit-progress-value { background: var(--amber); }
&::-moz-progress-bar { background: var(--amber); }
}
&__summary,
&__muted {
overflow: hidden;
color: $text-tertiary;
font-size: $text-xs;
text-overflow: ellipsis;
white-space: nowrap;
}
&__spacer {
flex: 1;
}
&__dismiss {
display: grid;
width: $control-sm;
height: $control-sm;
flex: 0 0 auto;
place-items: center;
border: 0;
border-radius: $radius-control;
background: transparent;
color: $text-tertiary;
cursor: pointer;
@include focus-ring();
&:hover { color: $text-primary; background: $bg-hover; }
}
// Slim "all set" state — a single clickable line, not a dead card.
&--clean {
flex-direction: row;
align-items: center;
gap: $space-2;
cursor: pointer;
color: $success;
font-size: $text-sm;
font-weight: $font-weight-medium;
&:hover {
border-color: var(--border-default, #{$border-default});
}
}
&__cleanlabel {
flex: 1;
color: $text-secondary;
}
&--loading {
min-height: 46px; // geometry: reserves the loaded banner's height (no layout jump)
}
@media (max-width: $breakpoint-md) {
> progress,
&__summary { display: none; }
}
}
-1
View File
@@ -88,7 +88,6 @@
@import 'components/_resource-picker'; // scoped ResourceRef combobox
@import 'components/_datagrid'; // DataGrid list surface (sk-grid*, ds/grid/)
@import 'components/_dashboard-widgets'; // configurable dashboard grid (skw-* namespace)
@import 'components/_setup-health'; // dashboard setup-health card + account nudge
@import 'components/_global-statusbar'; // unified VS Code-style shell status edge + panels
@import 'components/_widget-editor'; // wide preview+settings widget drawer (skwe-* namespace)
@import 'components/_system-notices';
Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 30 KiB