feat(webui): independent single-column mobile overview (B2)
Phones now render the overview from the dedicated `overviewMobile` ordering instead of deriving a 1-column view from the desktop grid — the two layouts are fully disjoint, so reordering on a phone never touches grid coords and vice versa. - View mode reuses DashboardGrid (drag disabled, cols=1), stacking each widget at its catalogue height via a pure prefix-sum, so cards keep their cell sizing. Per-widget config is shared with the desktop blocks. - Edit mode surfaces a motion `Reorder` drag-sort panel (grip + show/hide eye + config gear for configurable widgets) — no 2D drag on mobile, per plan. - The 编辑布局 toggle now appears on mobile too, with a mobile-specific hint. Order/visibility reconciles against the live widget catalogue, so a widget added later just appears on phones as well.
This commit is contained in:
2 files changed
+162
-34
No files matched your search
@@ -110,6 +110,13 @@ export function minSizeOf(id: string): { minW: number; minH: number } {
|
||||
return { minW: spec?.minW ?? 1, minH: spec?.minH ?? 1 };
|
||||
}
|
||||
|
||||
/** A widget's natural height (grid rows) for single-column mobile stacking —
|
||||
* the catalogue default, so phones get sensible per-widget heights without
|
||||
* carrying the desktop grid's stored coords. */
|
||||
export function mobileHeightOf(id: string): number {
|
||||
return WIDGET_BY_ID.get(id)?.def.h ?? 1;
|
||||
}
|
||||
|
||||
// ─── Per-widget config (interpreted client-side from the opaque block.config) ───
|
||||
|
||||
export const ALL_LOG_LEVELS: LogLevel[] = ['trace', 'debug', 'info', 'success', 'warn', 'error'];
|
||||
|
||||
Reference in new issue
Block a user