feat(webui): in-place dashboard edit overlays + inline sidebar reorder
Rework the layout edit mode from a separate panel to in-place affordances: - Each dashboard widget gets a semi-transparent floating overlay in edit mode: a "拖动" grip bar (the whole card is the drag target — forgiving + discoverable), an eye to show/hide, and a gear that opens the per-widget settings in a dialog. Hidden widgets show as re-enableable "已隐藏" ghosts; the bottom-right resize grip is now clearly visible. - The sidebar nav becomes a drag-to-reorder list directly in the sidebar (show/hide + locked pinned items + a 完成 button); editing force-expands the sidebar (and disables the collapse toggle). Edit mode is a shared LayoutContext flag so one "编辑布局" toggle drives both the grid and the nav. - The separate editor panel (overview-layout-editor) is removed; the gear opens config in a dialog instead. Also: stat-tile typography tightened (leading-tight, smaller value, overflow clip) so text no longer hugs the edge on small/short tiles. Verified by an adversarial review round (no MUST-FIX).
This commit is contained in:
9 files changed
+339
-349
No files matched your search
@@ -15,6 +15,8 @@ interface TopBarProps {
|
||||
onOpenMobile: () => void;
|
||||
onLogout: () => void;
|
||||
isMobile: boolean;
|
||||
/** Layout edit mode force-expands the sidebar, so collapsing is disabled. */
|
||||
editing?: boolean;
|
||||
}
|
||||
|
||||
export function TopBar({
|
||||
@@ -24,6 +26,7 @@ export function TopBar({
|
||||
onOpenMobile,
|
||||
onLogout,
|
||||
isMobile,
|
||||
editing = false,
|
||||
}: TopBarProps) {
|
||||
const [confirmLogout, setConfirmLogout] = useState(false);
|
||||
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
||||
@@ -43,8 +46,9 @@ export function TopBar({
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
onClick={onToggleCollapse}
|
||||
disabled={editing}
|
||||
aria-label={collapsed ? '展开侧边栏' : '收起侧边栏'}
|
||||
title={collapsed ? '展开侧边栏' : '收起侧边栏'}
|
||||
title={editing ? '编辑布局时侧栏保持展开' : collapsed ? '展开侧边栏' : '收起侧边栏'}
|
||||
>
|
||||
{collapsed ? <PanelLeftOpen className="size-4" /> : <PanelLeftClose className="size-4" />}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user