diff --git a/src/systems/dashboard/gridEngine.js b/src/systems/dashboard/gridEngine.js index e2cc299..dba508a 100644 --- a/src/systems/dashboard/gridEngine.js +++ b/src/systems/dashboard/gridEngine.js @@ -599,6 +599,11 @@ export class GridEngine { if (this.registry && widget.type) { const definition = this.registry.get(widget.type); if (definition && definition.maxAutoSize) { + // Support maxAutoSize as function (column-aware sizing) + if (typeof definition.maxAutoSize === 'function') { + return definition.maxAutoSize(this.columns); + } + // Static maxAutoSize object return definition.maxAutoSize; } } diff --git a/src/systems/dashboard/widgets/userInfoWidget.js b/src/systems/dashboard/widgets/userInfoWidget.js index 96234e5..3f1f970 100644 --- a/src/systems/dashboard/widgets/userInfoWidget.js +++ b/src/systems/dashboard/widgets/userInfoWidget.js @@ -38,8 +38,14 @@ export function registerUserInfoWidget(registry, dependencies) { description: 'User avatar, name, and level display', category: 'user', minSize: { w: 1, h: 1 }, - defaultSize: { w: 2, h: 1 }, - maxAutoSize: { w: 2, h: 1 }, // Max size for auto-arrange expansion + defaultSize: { w: 1, h: 1 }, // Start compact (1x1), expansion will grow it based on columns + // Column-aware max size: mobile (2-col) stays 1x1, desktop (3-4 col) can expand to 2x1 + maxAutoSize: (columns) => { + if (columns <= 2) { + return { w: 1, h: 1 }; // Mobile: stay compact to allow mood widget beside it + } + return { w: 2, h: 1 }; // Desktop: can span 2 columns + }, requiresSchema: false, /**