Skip to content

Dashboard panel header: duplicate, widen and expand actions #535

Description

@BorisTyshkevich

Goal

A Dashboard panel tile's header row carries three hover-revealed actions, matching
the design mockup's ChartTile (Dashboard.htmldashboard-app.jsx in the
design project): duplicate, widen, expand.

Today it carries one — Open in Workbench (#471) — plus the edit-mode grip and
delete button. Duplicate and widen do not exist, and the expand action is
under-powered: it drops the user into a fresh Workbench tab with nothing run and
no indication of where the panel they came from lives.

Behaviour

Action Modes Layouts Effect
Duplicate (Icon.copy) edit only all A copy of this panel — its own dedicated owned query clone — inserted immediately after the source tile, carrying the source's presentation, title/description overrides and placement
Widen (Icon.arrowsWide) edit only columns-2, columns-3, grafana-grid in tiles mode flow: span + 1, wrapping to 1 at the preset's column count. grid: span × 2 and height × 2, each clamped (12 / 16), wrapping to {span: 1, height: 2}
Expand (Icon.expand) both all Opens the panel's own owned query in a Workbench tab (as today), and runs it on the query's saved view, and reveals the Dashboards tree with this panel's row expanded and armed

Not available: widen under report (one centred column), under Full view (a
transient render mode that never persists a width, #321), or below the mobile
breakpoint (flow forces one column, so a press would rewrite the persisted span
with no visible effect). A flow KPI band member gets duplicate + expand but
not widen — a band is a full-width flex stream that ignores span entirely.

Notes

  • Glyph deviation, deliberate. Duplicate and expand use the design's glyphs
    (Icon.copy, Icon.expand). Widen does not: the design's four-way outward
    arrows are drawn in a 24-box, and halved into this icon set's 12-box they become
    eight subpaths with 1.25px arrowhead legs — an unreadable blob at the 13px a tile
    head renders, and near-identical to expand's brackets sitting right beside it.
    Widen ships as a horizontal double-headed arrow instead: three strokes, integer
    coordinates, and it says the one thing the button actually does.

  • This partly reverses Make Dashboard a first-class module with one-dashboard-per-current-workspace v1 UX #280 phase 8's owner decision that "span/height are tuned
    in the Spec editor". Widening is the one size adjustment users make constantly,
    and a JSON editor is the wrong ergonomics for it. The free-form two-dimensional
    resize stays the Add a rowless Grafana-style tile-grid Dashboard layout #291 corner drag; this adds a single stepping button.

  • Duplication is a two-resource write: Separate Library queries from dashboard-owned query copies #427 makes every panel tile the sole
    owner of a saved-query copy, so a duplicate must mint a second owned clone —
    queries[] plus dashboards[]. It therefore commits through mutateWorkspace

    • onWorkspaceExternallyChanged({queriesChanged: true}) like a Library drop
      (Add Library drag assignment to Dashboard panels and variables #428), not through the Dashboard route's optimistic command queue: that queue
      publishes to the live viewer session, which drops tile ids it has no runtime
      for, so an optimistic duplicate would not render at all — and the
      membership-restore detector would see the id already recorded and schedule no
      rebuild to fix it.

Acceptance

  • Three hover/focus-revealed actions in the tile head, in the design's order,
    with the design's glyphs; duplicate and widen edit-mode only.
  • Duplicate inserts after the source with its own owned query clone, same
    size and presentation; the copy renders without a manual reload.
  • Widen cycles per the table above and hides itself where there is no width
    to step; its label names the destination width.
  • Expand opens, runs (only when the opened tab's own draft is auto-runnable
    and not in Spec mode) and reveals the tree row.
  • npm test green with the per-file coverage floors; real-browser e2e for the
    widen geometry and the duplicate commit.

Revised by #544 (2026-07-29)

The head this issue built — grip, duplicate, widen, expand, delete — was five
controls sharing one flex row with the tile title, which a tile one grid column
wide has no room for. #544 cut it to two:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions