Skip to content

Add a rowless Grafana-style tile-grid Dashboard layout #291

Description

@BorisTyshkevich

Summary

Implement grafana-grid@1 as a lazy-loadable, rowless Dashboard layout: a responsive 12-column tile grid with shared Dashboard filters, deterministic packing, semantic tile heights, Workbench-only placement editing, and a valid flow@1 fallback.

Depends on #280.

Reference design

Use the attached standalone HTML mockup as the visual reference for the dark operational Dashboard, shared control bar, compact panel chrome, dense spacing, mixed KPI/chart/table states, foldable rows, and semantic panel heights.


Reconciled — owner decisions + acceptance as shipped (2026-07-18, PR pending)

Decisions taken in the pre-implementation question round (with the mockup at the
"sql browser" design project, Grafana Dashboard.html, as visual reference):

  1. Placement modellayout.items[tileId] = {span: 1–12, height: compact|medium|large};
    vertical position derived by deterministically packing canonical dashboard.tiles[]
    order into the 12-column grid. No x/y coordinates.
  2. Rowless — no row headers, no folded/collapsible rows, no "Add row" (the mockup's
    rows are explicitly excluded).
  3. Edit/view modes follow feat(#288, #302): Dashboard v1 phase 6 — direct + full-screen viewing (one-time IndexedDB handoff) + File-menu restructure #306/ADR-0003 — no in-page mode toggle; edit affordances
    only when the dashboard resolves !readOnly (current-workspace store).
  4. Edit UX — whole-card drag-reorder + corner-drag resize (span snaps to columns,
    height snaps to the three semantic tiers; tile pinned to its column during the drag)
    • tile delete. Immediate propagation — no Save-layout, no Undo (owner override).
  5. Engine switching — the edit-mode layout select gains a "Grafana grid" option;
    flow→grid seeds spans 1→4, 2→6, 3→12 (heights carried) and snapshots the flow layout
    as fallback; grid→flow restores it. Every grid mutation regenerates a valid
    flow@1 fallback (grid→flow spans 1–4→1, 5–8→2, 9–12→3).
  6. Semantic heights — reuse flow's compact|medium|large vocabulary (118/210/296 px).
  7. Responsive — container-width (content-box) column clamp 12/6/4/2 at
    ≥1160/≥720/≥470 px; persisted spans never mutated.
  8. "Lazy-loadable" = registration-time laziness — the plugin is constructed only when
    a document requests grafana-grid@1 via the registry load() seam; it stays inside
    the single-file artifact (hard rule 4 forbids network code-splitting).
  9. Scope — layout engine only: the mockup's time-range control and auto-refresh
    split-button are deferred; the existing Dashboard filter bar and manual refresh are
    reused unchanged. The fallback schema slot stays pinned to flow@1.

Amendment (2026-07-18, owner, same PR): decision 6 superseded — tile heights are
numeric row units 1–16 (px = 32 + 88×units; units 1/2/3 ≈ the old compact/medium/large
tiers, unit 16 = 1440 px ≈ 5× the previous max). The corner-drag snaps per unit; the legacy
enum strings remain valid in the schema and normalize to 1/2/3. Flow@1's own height
vocabulary is unchanged; the flow-fallback maps units 1→compact, 2→medium, ≥3→large.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions