Skip to content

feat: dashboard Arrange/Report layout switcher (#149 D2)#151

Merged
BorisTyshkevich merged 2 commits into
mainfrom
feat/dashboard-layout-d2-149
Jul 4, 2026
Merged

feat: dashboard Arrange/Report layout switcher (#149 D2)#151
BorisTyshkevich merged 2 commits into
mainfrom
feat/dashboard-layout-d2-149

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What & why

Phase D2 of the Dashboard (#149): the Arrange / Report layout switcher.

The standalone /sql/dashboard (D1, #150) rendered favorites as a fixed 3-column
grid of read-only chart tiles. This adds the layout controls in a toolbar below
the header (the row that becomes the filter bar in D4):

  • Arrange | Report segmented switcher (primary): Arrange is the uniform
    multi-column grid; Report lays tiles out as a single full-width scrolling
    column with taller charts.
  • Columns 2 | 3 control (secondary): tunes the Arrange grid, hidden in
    Report's single column.
  • Both are presentation-only — switching reshapes the grid and the Chart.js
    tiles resize themselves via their own ResizeObserver, with no tile re-query.
  • layout + gridCols persist per browser (asb:dashLayout /
    asb:dashCols), surviving reloads and Refresh.

Pure normalizers (normalizeDashLayout / normalizeDashCols) live in
src/core/dashboard.js (100%); render + wiring in src/ui/dashboard.js; prefs
read in createState. The header's sticky positioning moves to a .dash-topbar
wrapper so the switcher stays visible while the grid scrolls.

Verified end-to-end in a real browser (chromium) against the built sql.html:
the switcher toggles the grid (3-col → 1-col Report → 2-col), the column control
shows only in Arrange, the chart canvases genuinely reflow (buffer width
431→1014→677px), and the choice persists across reload.

Drag-to-reorder and 1/2-column tile spans arrive in D3.

Part of #149.

Checklist

🤖 Generated with Claude Code

Add the standalone dashboard's layout controls (phase D2): a toolbar
below the header (the future filter bar) with a primary Arrange | Report
segmented switcher and a secondary 2 | 3 column-count control.

- Arrange = uniform multi-column grid (2 or 3, via `--dash-cols`);
  Report = single full-width scrolling column with taller tiles.
- The column control is shown only in Arrange (N/A in one column).
- Presentation-only: toggling reshapes the grid and the Chart.js tiles
  resize via their own ResizeObserver — no tile re-query.
- `layout` + `gridCols` persist per browser (asb:dashLayout/asb:dashCols),
  surviving reloads and Refresh.

Pure normalizers (normalizeDashLayout/normalizeDashCols) live in
src/core/dashboard.js (100%); render + wiring in src/ui/dashboard.js;
prefs read in createState. Header sticky moves to a .dash-topbar wrapper
so the switcher stays visible while the grid scrolls.

Drag-reorder + 1/2-col tile spans arrive in D3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GyLqZGyUkm7mP6WhZCkodj
… gridlines (#149 D2)

Bring the dashboard chart tiles closer to the design mockup:

- Show the favorite's saved `description` as a subtitle under the tile name
  (single line, ellipsized), in both Arrange and Report layouts.
- Draw the chart on the tile's own background (`--bg-side`) instead of the
  darker results-table background the workbench chart view uses, so the chart
  body matches the panel.
- Hide the value-axis gridlines on tiles (new `hideGrid` option threaded
  through renderChart → chartJsConfig): on a dark panel a light gridline reads
  as noise, and the design's tiles have none. Tick labels stay.

renderChart/chartJsConfig gain an opt-in `hideGrid` (workbench chart view is
unchanged). Tests updated; core + dashboard modules stay at 100%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GyLqZGyUkm7mP6WhZCkodj
@BorisTyshkevich BorisTyshkevich merged commit 1feb2ff into main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant