Files
SnowLuma/packages
DrSmoothl 69ed8fc722 feat(webui): customizable dashboard + nav layout (phase 3)
The "C" half — reorder + show/hide the overview cards and the sidebar nav,
persisted to config/ui.json's layout section.

- LayoutContext loads the layout (authed GET /api/ui) and persists edits via
  the section-merge POST /api/ui {layout} (debounced). reconcileLayoutItems
  keeps stored order/visibility, appends new catalogue entries (forward-compat),
  and forces pinned items visible.
- Overview is refactored into a block registry (stats/connections/alerts/host/
  sessions). A 「编辑布局」 mode (motion Reorder — zero new deps) edits both the
  cards and the nav in place, with per-item show/hide and a reset; an all-hidden
  dashboard shows an empty state with 恢复默认.
- Anti-self-lock: PINNED_NAV = ['/', '/settings'] can be reordered but never
  hidden — the overview hosts the layout editor and settings hosts
  account/appearance, so the user can never strand themselves.
- api.ui.save now takes Partial<UiConfig> (the section-merge contract).

A late initial GET can't clobber an in-flight edit (dirtyRef); a pending edit
flushes on unmount. Verified across 2 adversarial review rounds.
2026-06-13 01:15:00 +08:00
..
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00
2026-06-11 16:42:23 +08:00