feat(dashboard): widgets fit their content; wide screens get more grid columns (#5249)
Each widget is as tall as its content, never taller than its saved height (where it scrolls). The dashboard is capped at 2400px instead of 1400px. Past 12 columns' worth of width it adds columns (one per 110px, up to 24) and places widgets again in reading order at their saved widths, so more sit side by side instead of stretching. Edit mode shows and saves the 12-column layout, so a layout doesn't depend on the screen it was edited on. The share view uses the same layout code (static/dash-layout.js). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
{# One dashboard widget as a Gridstack item — shared by index.html (initial render)
|
||||
and the add-widget endpoint (single-item insert). Edit chrome (drag handle +
|
||||
remove) is in the DOM only for editors and shown via body.dash-editing CSS. #}
|
||||
{# data-x/y/w/h are the saved 12-column layout; static/dash-layout.js fits
|
||||
each widget to its content and adds columns on wide screens from them. #}
|
||||
<div class="grid-stack-item" gs-id="{{ item.db.id }}"
|
||||
gs-x="{{ item.db.grid_x }}" gs-y="{{ item.db.grid_y }}"
|
||||
gs-w="{{ item.db.grid_w }}" gs-h="{{ item.db.grid_h }}">
|
||||
gs-w="{{ item.db.grid_w }}" gs-h="{{ item.db.grid_h }}"
|
||||
data-x="{{ item.db.grid_x }}" data-y="{{ item.db.grid_y }}"
|
||||
data-w="{{ item.db.grid_w }}" data-h="{{ item.db.grid_h }}">
|
||||
<div class="grid-stack-item-content">
|
||||
<div class="widget-header">
|
||||
<span style="display:flex;align-items:center;gap:0.4rem;min-width:0;">
|
||||
|
||||
Reference in New Issue
Block a user