diff --git a/frontend/src/i18n/locales/ar.json b/frontend/src/i18n/locales/ar.json index 4dafa187..548d8449 100644 --- a/frontend/src/i18n/locales/ar.json +++ b/frontend/src/i18n/locales/ar.json @@ -1664,7 +1664,6 @@ "couldNotReset": "لا يمكن إعادة التعيين", "couldNotSave": "لا يمكن الحفظ", "dashboardSaved": "تم حفظ لوحة المعلومات", - "delete": "حذف {{name}}", "deleteRemovesIt": "يؤدي الحذف إلى إزالتها", "discard": "ينبذ", "dragHeadersToMoveDragThe": "اسحب الرؤوس للتحرك · اسحب الزاوية لتغيير حجمها · انقر فوق عنصر واجهة المستخدم لتكوينه", diff --git a/frontend/src/i18n/locales/bn.json b/frontend/src/i18n/locales/bn.json index 37123ea9..b78da98b 100644 --- a/frontend/src/i18n/locales/bn.json +++ b/frontend/src/i18n/locales/bn.json @@ -1664,7 +1664,6 @@ "couldNotReset": "রিসেট করা যায়নি", "couldNotSave": "বাঁচাতে পারেনি", "dashboardSaved": "ড্যাশবোর্ড সংরক্ষিত", - "delete": "{{name}} মুছুন", "deleteRemovesIt": "মুছলে এটি সরানো হয়", "discard": "বাতিল করুন", "dragHeadersToMoveDragThe": "সরাতে হেডার টেনে আনুন · আকার পরিবর্তন করতে কোণে টেনে আনুন · এটি কনফিগার করতে একটি উইজেট ক্লিক করুন", diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json index 3f447879..13f285bb 100644 --- a/frontend/src/i18n/locales/de.json +++ b/frontend/src/i18n/locales/de.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Konnte nicht zurückgesetzt werden", "couldNotSave": "Konnte nicht gespeichert werden", "dashboardSaved": "Dashboard gespeichert", - "delete": "{{name}} löschen", "deleteRemovesIt": "Löschen entfernt es", "discard": "Verwerfen", "dragHeadersToMoveDragThe": "Ziehen Sie die Kopfzeilen, um sie zu verschieben. Ziehen Sie die Ecke, um die Größe zu ändern. Klicken Sie auf ein Widget, um es zu konfigurieren", diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 01865912..60c83ef8 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -1704,8 +1704,10 @@ "buildThisDashboard": "Build this dashboard", "couldNotReset": "Couldn't reset the board.", "couldNotSave": "Couldn't save the board.", + "dashboardName": "Dashboard name", "dashboardSaved": "Dashboard saved", - "delete": "Delete {{name}}", + "dashboards": "Dashboards", + "deleteDashboard": "Delete dashboard", "deleteRemovesIt": "Delete removes it", "discard": "Discard", "dragHeadersToMoveDragThe": "Drag headers to move · drag the corner to resize · click a widget to configure it", @@ -1718,9 +1720,11 @@ "reconnecting": "Reconnecting", "refresh": "· refresh", "refreshNow": "Refresh now", + "renameDashboard": "Rename dashboard", "resetToTheShippedLayout": "Reset to the shipped layout", "restoreDefaultLayout": "Restore default layout", "restoreTheShippedLayout": "Restore the shipped layout", + "switchDashboard": "Switch dashboard", "switchServer": "Switch server", "thisBoardHasNoShippedDefault": "This board has no shipped default.", "thisBoardHasNoWidgetsYet": "This board has no widgets yet. Add one, or restore the layout it shipped with.", diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json index e18271e6..5022e965 100644 --- a/frontend/src/i18n/locales/es.json +++ b/frontend/src/i18n/locales/es.json @@ -1664,7 +1664,6 @@ "couldNotReset": "No se pudo restablecer", "couldNotSave": "No se pudo guardar", "dashboardSaved": "Panel guardado", - "delete": "Eliminar {{name}}", "deleteRemovesIt": "Eliminar lo quita", "discard": "Descartar", "dragHeadersToMoveDragThe": "Arrastra los encabezados para mover · arrastra la esquina para redimensionar · haz clic en un widget para configurarlo", diff --git a/frontend/src/i18n/locales/fr.json b/frontend/src/i18n/locales/fr.json index 20c9a802..33b86fe1 100644 --- a/frontend/src/i18n/locales/fr.json +++ b/frontend/src/i18n/locales/fr.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Impossible de réinitialiser", "couldNotSave": "Impossible d'enregistrer", "dashboardSaved": "Tableau de bord enregistré", - "delete": "Supprimer {{name}}", "deleteRemovesIt": "Supprimer le retire", "discard": "Jeter", "dragHeadersToMoveDragThe": "Faites glisser les en-têtes pour déplacer · faites glisser le coin pour redimensionner · cliquez sur un widget pour le configurer", diff --git a/frontend/src/i18n/locales/id.json b/frontend/src/i18n/locales/id.json index 9f3b49a7..dfd0bd30 100644 --- a/frontend/src/i18n/locales/id.json +++ b/frontend/src/i18n/locales/id.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Tidak dapat menyetel ulang", "couldNotSave": "Tidak dapat menyimpan", "dashboardSaved": "Dasbor disimpan", - "delete": "Hapus {{name}}", "deleteRemovesIt": "Hapus akan menghilangkannya", "discard": "Membuang", "dragHeadersToMoveDragThe": "Seret header untuk dipindahkan · seret sudut untuk mengubah ukurannya · klik widget untuk mengonfigurasinya", diff --git a/frontend/src/i18n/locales/it.json b/frontend/src/i18n/locales/it.json index d160e4ba..25bce685 100644 --- a/frontend/src/i18n/locales/it.json +++ b/frontend/src/i18n/locales/it.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Impossibile reimpostare", "couldNotSave": "Impossibile salvare", "dashboardSaved": "Pannello di controllo salvato", - "delete": "Elimina {{name}}", "deleteRemovesIt": "Elimina la rimuove", "discard": "Scartare", "dragHeadersToMoveDragThe": "Trascina le intestazioni per spostare · trascina l'angolo per ridimensionare · fai clic su un widget per configurarlo", diff --git a/frontend/src/i18n/locales/ko.json b/frontend/src/i18n/locales/ko.json index a43ba1b0..e63b9e49 100644 --- a/frontend/src/i18n/locales/ko.json +++ b/frontend/src/i18n/locales/ko.json @@ -1664,7 +1664,6 @@ "couldNotReset": "재설정할 수 없습니다.", "couldNotSave": "저장할 수 없습니다.", "dashboardSaved": "대시보드가 저장되었습니다", - "delete": "{{name}} 삭제", "deleteRemovesIt": "삭제하면 제거됩니다", "discard": "폐기", "dragHeadersToMoveDragThe": "이동하려면 헤더를 드래그하세요. 크기를 조정하려면 모서리를 드래그하세요. 위젯을 클릭하여 구성하세요.", diff --git a/frontend/src/i18n/locales/pl.json b/frontend/src/i18n/locales/pl.json index 6334d872..b59e02b5 100644 --- a/frontend/src/i18n/locales/pl.json +++ b/frontend/src/i18n/locales/pl.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Nie udało się zresetować", "couldNotSave": "Nie udało się zapisać", "dashboardSaved": "Panel został zapisany", - "delete": "Usuń {{name}}", "deleteRemovesIt": "Usunięcie go usuwa", "discard": "Wyrzucać", "dragHeadersToMoveDragThe": "Przeciągnij nagłówki, aby przenieść · przeciągnij róg, aby zmienić rozmiar · kliknij widżet, aby go skonfigurować", diff --git a/frontend/src/i18n/locales/pt.json b/frontend/src/i18n/locales/pt.json index 07f55f45..da1e0e05 100644 --- a/frontend/src/i18n/locales/pt.json +++ b/frontend/src/i18n/locales/pt.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Não foi possível redefinir", "couldNotSave": "Não foi possível salvar", "dashboardSaved": "Painel salvo", - "delete": "Excluir {{name}}", "deleteRemovesIt": "Excluir o remove", "discard": "Descartar", "dragHeadersToMoveDragThe": "Arraste os cabeçalhos para mover · arraste o canto para redimensionar · clique em um widget para configurá-lo", diff --git a/frontend/src/i18n/locales/ru.json b/frontend/src/i18n/locales/ru.json index 5d17f9c0..514675d1 100644 --- a/frontend/src/i18n/locales/ru.json +++ b/frontend/src/i18n/locales/ru.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Не удалось сбросить", "couldNotSave": "Не удалось сохранить", "dashboardSaved": "Панель управления сохранена.", - "delete": "Удалить {{name}}", "deleteRemovesIt": "Удаление уберёт её", "discard": "Отказаться", "dragHeadersToMoveDragThe": "Перетащите заголовки для перемещения · перетащите угол, чтобы изменить размер · щелкните виджет, чтобы настроить его", diff --git a/frontend/src/i18n/locales/th.json b/frontend/src/i18n/locales/th.json index a2550730..e0282976 100644 --- a/frontend/src/i18n/locales/th.json +++ b/frontend/src/i18n/locales/th.json @@ -1664,7 +1664,6 @@ "couldNotReset": "ไม่สามารถรีเซ็ตได้", "couldNotSave": "ไม่สามารถบันทึกได้", "dashboardSaved": "บันทึกแดชบอร์ดแล้ว", - "delete": "ลบ {{name}}", "deleteRemovesIt": "การลบจะนำออก", "discard": "ทิ้ง", "dragHeadersToMoveDragThe": "ลากส่วนหัวเพื่อย้าย · ลากมุมเพื่อปรับขนาด · คลิกวิดเจ็ตเพื่อกำหนดค่า", diff --git a/frontend/src/i18n/locales/tr.json b/frontend/src/i18n/locales/tr.json index 0a018a06..cefc45fb 100644 --- a/frontend/src/i18n/locales/tr.json +++ b/frontend/src/i18n/locales/tr.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Sıfırlanamadı", "couldNotSave": "Kaydedilemedi", "dashboardSaved": "Kontrol paneli kaydedildi", - "delete": "{{name}}'yi sil", "deleteRemovesIt": "Silmek onu kaldırır", "discard": "At", "dragHeadersToMoveDragThe": "Taşımak için başlıkları sürükleyin · yeniden boyutlandırmak için köşeyi sürükleyin · yapılandırmak için bir widget'ı tıklayın", diff --git a/frontend/src/i18n/locales/vi.json b/frontend/src/i18n/locales/vi.json index 08283584..4a63d1b0 100644 --- a/frontend/src/i18n/locales/vi.json +++ b/frontend/src/i18n/locales/vi.json @@ -1664,7 +1664,6 @@ "couldNotReset": "Không thể đặt lại", "couldNotSave": "Không thể lưu", "dashboardSaved": "Đã lưu trang tổng quan", - "delete": "Xóa {{name}}", "deleteRemovesIt": "Xóa sẽ loại bỏ nó", "discard": "Loại bỏ", "dragHeadersToMoveDragThe": "Kéo tiêu đề để di chuyển · kéo góc để thay đổi kích thước · nhấp vào tiện ích để định cấu hình nó", diff --git a/frontend/src/i18n/locales/zh-Hans.json b/frontend/src/i18n/locales/zh-Hans.json index af8755f4..191300a7 100644 --- a/frontend/src/i18n/locales/zh-Hans.json +++ b/frontend/src/i18n/locales/zh-Hans.json @@ -1664,7 +1664,6 @@ "couldNotReset": "无法重置", "couldNotSave": "无法保存", "dashboardSaved": "仪表板已保存", - "delete": "删除{{name}}", "deleteRemovesIt": "删除即移除", "discard": "丢弃", "dragHeadersToMoveDragThe": "拖动标题进行移动·拖动角部进行调整大小·单击小部件进行配置", diff --git a/frontend/src/i18n/locales/zh-Hant.json b/frontend/src/i18n/locales/zh-Hant.json index ad575c97..e1a53843 100644 --- a/frontend/src/i18n/locales/zh-Hant.json +++ b/frontend/src/i18n/locales/zh-Hant.json @@ -1664,7 +1664,6 @@ "couldNotReset": "無法重設", "couldNotSave": "無法儲存", "dashboardSaved": "儀表板已儲存", - "delete": "刪除{{name}}", "deleteRemovesIt": "刪除即會移除", "discard": "丟棄", "dragHeadersToMoveDragThe": "拖曳標題進行移動·拖曳角落進行調整大小·點選小工具進行設定", diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx index 92088d85..2bbdbc3d 100644 --- a/frontend/src/pages/Dashboard.jsx +++ b/frontend/src/pages/Dashboard.jsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { - Grid2x2, History, Keyboard, Maximize2, Plus, - RefreshCw, SlidersHorizontal, X, + ChevronDown, Grid2x2, History, Keyboard, Maximize2, Pencil, Plus, + RefreshCw, SlidersHorizontal, Trash2, X, } from 'lucide-react'; import api from '../services/api'; import { useAuth } from '../contexts/useAuth.js'; @@ -12,6 +12,10 @@ import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@ import ServerPicker from '../components/ServerPicker'; import { SegControl } from '@/components/ds'; import { Button } from '@/components/ui/button'; +import { + DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, + DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu'; import ChangeBar from '../components/ds/ChangeBar'; import ShortcutSheet from '../components/ds/ShortcutSheet'; import EmptyState from '../components/EmptyState'; @@ -494,59 +498,77 @@ const Dashboard = () => { {/* Board tabs + board-wide controls */}
-
- {boards.map((board) => ( -
handleBoardSwitch(board.id)} - onDoubleClick={() => edit && setRenamingId(board.id)} - role="button" - tabIndex={0} - onKeyDown={(e) => { if (e.key === 'Enter') handleBoardSwitch(board.id); }} - > -
- ))} - + + + {t('app.dashboard.dashboards', 'Dashboards')} + { + const next = boards.find((board) => String(board.id) === value); + if (next) handleBoardSwitch(next.id); + }} + > + {boards.map((board) => ( + + {board.name} + + {board.id === activeBoardId ? widgets.length : (board.widgets || []).length} + + + ))} + + + + {t('app.dashboard.newDashboard', 'New dashboard')} + + {edit && activeBoard && ( + <> + setRenamingId(activeBoard.id)}> + {t('app.dashboard.renameDashboard', 'Rename dashboard')} + + {boards.length > 1 && ( + handleRemoveBoard(activeBoard.id)}> + {t('app.dashboard.deleteDashboard', 'Delete dashboard')} + + )} + + )} + + + )}
diff --git a/frontend/src/styles/base/_touch.scss b/frontend/src/styles/base/_touch.scss index 19b7c607..0b9a390d 100644 --- a/frontend/src/styles/base/_touch.scss +++ b/frontend/src/styles/base/_touch.scss @@ -10,7 +10,6 @@ .btn, .quick-create, .sk-notif__bell, - .skw-tab, .skw-iconbtn, .skw-barbtn, .skw-actions__row, @@ -32,8 +31,7 @@ .sk-notif__bell, .sk-gridicon, .skw-iconbtn, - .setup-health-widget__dismiss, - .skw-tab--add { + .setup-health-widget__dismiss { min-width: $control-lg; } diff --git a/frontend/src/styles/components/_dashboard-widgets.scss b/frontend/src/styles/components/_dashboard-widgets.scss index b9be8c3e..efadbc30 100644 --- a/frontend/src/styles/components/_dashboard-widgets.scss +++ b/frontend/src/styles/components/_dashboard-widgets.scss @@ -48,7 +48,7 @@ $skw-z-tv: 200; margin-bottom: $space-4; // Range / refresh / variable pickers + edit toggle. `margin-left:auto` - // rather than a spacer element so the tabs keep their natural width. + // rather than a spacer element so the selector keeps its natural width. &__ctl { display: flex; align-items: center; @@ -127,47 +127,31 @@ $skw-z-tv: 200; } } -.skw-tabs { +// Dashboard selector: the active board's name on a bar button that opens the +// list of boards. One control whether there are three boards or thirty. +.skw-boardpick { display: flex; align-items: center; - gap: $space-1; - flex-wrap: wrap; -} + min-width: 0; -.skw-tab { - display: flex; - align-items: center; - gap: $space-2; - height: $control-md; - padding: 0 $space-3; - border: 1px solid transparent; - border-radius: $radius-control; - background: none; - color: var(--text-faint); - font-family: inherit; - font-size: $text-sm; - cursor: pointer; - transition: 0.13s; - - &:hover { + &__btn { + height: $control-md; + max-width: 100%; color: var(--text); - background: var(--surface-2); + + > svg:first-child { color: var(--accent-bright); } } - // Active board. Set apart by fill + border, never by weight, so switching - // boards cannot re-flow the row (same rule as .sk-topbar__tab). - &--on, - &.is-on, - &.is-active { - color: var(--text); - background: var(--surface-2); - border-color: var(--border-strong); - - svg { color: var(--accent-bright); } + &__name { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } - // Widget count on the tab. + // Widget count beside a board's name. &__count { + margin-left: auto; padding: 1px $space-tight; border-radius: $radius-control; background: var(--surface-3); @@ -175,18 +159,17 @@ $skw-z-tv: 200; font-size: $text-xs; } - // "+" new-board affordance — icon only, so it drops the label padding. - &--add { - padding: $space-2; - color: var(--text-faint); - } + &__menu { min-width: 220px; } // geometry: menu width + + &__menu [role='menuitemradio'] { gap: $space-3; } } // Inline board rename. Accent border rather than a focus ring: the input -// replaces the tab in place and has to read as "editing" without growing. +// replaces the selector in place and has to read as "editing" without growing. .skw-rename { - width: 130px; - padding: $space-hair $space-tight; + width: 180px; + height: $control-md; + padding: $space-hair $space-3; border: 1px solid var(--accent); border-radius: $radius-control; background: var(--surface-3); diff --git a/frontend/tests/layout-baselines/dashboard-1440-light.png b/frontend/tests/layout-baselines/dashboard-1440-light.png index c7eededd..81f09556 100644 Binary files a/frontend/tests/layout-baselines/dashboard-1440-light.png and b/frontend/tests/layout-baselines/dashboard-1440-light.png differ diff --git a/frontend/tests/layout-baselines/dashboard-1440.png b/frontend/tests/layout-baselines/dashboard-1440.png index 3a4ec623..4f6c788a 100644 Binary files a/frontend/tests/layout-baselines/dashboard-1440.png and b/frontend/tests/layout-baselines/dashboard-1440.png differ diff --git a/frontend/tests/layout-baselines/dashboard-390.png b/frontend/tests/layout-baselines/dashboard-390.png index 3e49869b..3cfd8eb4 100644 Binary files a/frontend/tests/layout-baselines/dashboard-390.png and b/frontend/tests/layout-baselines/dashboard-390.png differ diff --git a/frontend/tests/layout-baselines/dashboard-768.png b/frontend/tests/layout-baselines/dashboard-768.png index a9b82455..6b551b92 100644 Binary files a/frontend/tests/layout-baselines/dashboard-768.png and b/frontend/tests/layout-baselines/dashboard-768.png differ