Skip to content

Report Builder: drag & drop bricks within band canvases #519

Description

@nielsdrost7

Status 2026-07-13: implemented on feature/130-report-builder (#608) — as-built notes in the #130 status section.


Parent: #130 (Report Builder — bands + bricks). Phase 2 (needs Phase 1: #521, #528). Part of epic #506, Track A.

Scope

Drag & drop of bricks within a band canvas, using mason's built-in DnD (each band is its own Mason field — see #523). No custom Alpine grid, no zone overlays: that approach stalled the previous attempt (feature/145-report-builder).

  • Reordering bricks inside a band persists the new order in that band's array in bands.json.
  • Clicking a placed brick opens its config slide-over (configureBrickAction) pre-filled from the brick's saved config in bands.json — this is the form-population bug that blocked the old branch (it looked the config up in the dropped report_blocks table; now the canvas state itself is the single source of truth).
  • Width per placed brick: one_third | half | two_thirds | full (ReportBlockWidth enum, harvested), editable in the slide-over.

Cross-band movement is not DnD — it's the "move to band…" action, tracked in #525.

Acceptance criteria

  • Reordering two bricks in a band and saving swaps their positions in bands.json.
  • Opening a placed brick's config shows its previously saved values (not defaults).
  • Changing a config value + save persists it and the preview reflects it.
  • Width choice persists and is honored by the preview layout.

Test scenarios (PHPUnit + Livewire, #[Test], no Pest)

  • Save canvas state with bricks in order [A, B], then [B, A]; assert bands.json order follows.
  • Config slide-over fill test: saved show_vat_id: false appears as unchecked on reopen.
  • Width change round-trips through save/load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinedRefined with SMART plan / test suggestions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions