Merge DashboardView and GridStackView into a single dashboard #19

Closed
opened 2026-07-28 16:53:13 +00:00 by claude-bot · 1 comment
Collaborator

Problem

The project currently ships two dashboards that render the same three charts from the same hardcoded data:

  • views/DashboardView.java (@Route("")) — a static VerticalLayout of three Cards with fixed 400px heights.
  • views/GridStackView.java (@Route("gridstack")) — the same three charts inside a GridStackLayout, draggable/resizable, layout persisted to localStorage, plus an add/reset toolbar.

DashboardView is effectively a degenerate GridStackView with staticGrid = true. Every chart-building method (lineChart(), barChart(), pieChart(), months()) exists twice with slightly different sizing, and any new widget has to be written twice.

Proposal

Collapse both into one dashboard view backed by GridStackLayout:

  • Move the grid-based dashboard to @Route("").
  • Drop GridStackView (or keep @Route("gridstack") as an alias / staticGrid variant if the demo value is worth keeping).
  • Consolidate the duplicated chart factory methods into one place.
  • Update MainLayout's SideNav so there is one dashboard entry, not two.
  • sizeFull(...) (charts filling the grid item, height 100%) becomes the single sizing strategy — the fixed 400px from DashboardView goes away.

Why first

This is the prerequisite for essentially every other dashboard improvement. Implementing anything on top of the current structure means implementing it twice.

Acceptance criteria

  • One dashboard route, one set of chart factory methods.
  • Widgets are draggable/resizable and the layout still restores from localStorage.
  • MainLayout navigation reflects the merge.
  • A browserless views/DashboardViewTest asserts the merged view builds and contains the expected widgets (there is currently no DashboardViewTest at all — only GridStackViewTest).
  • ./mvnw test green.

Scope

Medium — mostly deletion and moving, but it touches routes and navigation, so the existing GridStackViewTest needs to move with it.

## Problem The project currently ships two dashboards that render the same three charts from the same hardcoded data: - `views/DashboardView.java` (`@Route("")`) — a static `VerticalLayout` of three `Card`s with fixed `400px` heights. - `views/GridStackView.java` (`@Route("gridstack")`) — the same three charts inside a `GridStackLayout`, draggable/resizable, layout persisted to `localStorage`, plus an add/reset toolbar. `DashboardView` is effectively a degenerate `GridStackView` with `staticGrid = true`. Every chart-building method (`lineChart()`, `barChart()`, `pieChart()`, `months()`) exists twice with slightly different sizing, and any new widget has to be written twice. ## Proposal Collapse both into one dashboard view backed by `GridStackLayout`: - Move the grid-based dashboard to `@Route("")`. - Drop `GridStackView` (or keep `@Route("gridstack")` as an alias / `staticGrid` variant if the demo value is worth keeping). - Consolidate the duplicated chart factory methods into one place. - Update `MainLayout`'s `SideNav` so there is one dashboard entry, not two. - `sizeFull(...)` (charts filling the grid item, height `100%`) becomes the single sizing strategy — the fixed `400px` from `DashboardView` goes away. ## Why first This is the prerequisite for essentially every other dashboard improvement. Implementing anything on top of the current structure means implementing it twice. ## Acceptance criteria - One dashboard route, one set of chart factory methods. - Widgets are draggable/resizable and the layout still restores from `localStorage`. - `MainLayout` navigation reflects the merge. - A browserless `views/DashboardViewTest` asserts the merged view builds and contains the expected widgets (there is currently no `DashboardViewTest` at all — only `GridStackViewTest`). - `./mvnw test` green. ## Scope Medium — mostly deletion and moving, but it touches routes and navigation, so the existing `GridStackViewTest` needs to move with it.
claude-bot added the enhancement label 2026-07-28 16:53:13 +00:00
pitfriedrich added the ai-ready label 2026-07-28 17:07:27 +00:00
claude-bot added ai-wip and removed ai-ready labels 2026-07-28 17:07:56 +00:00
Author
Collaborator

PR: #31

GridStackView is gone; the grid dashboard now lives at @Route("") in DashboardView, with one set of chart factories, the point-click notifications from the old dashboard, and one SideNavItem. GridStackViewTest was renamed to DashboardViewTest and gained a case asserting the three charts render.

Two decisions worth a look at review:

  • The localStorage key changed from gridstack-demo to dashboard, so an existing saved layout is dropped once. Say the word if you'd rather keep the old key.
  • @Route("gridstack") was not kept as an alias — the issue left that optional and the demo value is fully covered by the merged view.

./mvnw test → 11 tests, 0 failures.

PR: https://gitea.pitfriedrich.net/pitfriedrich/chart-app/pulls/31 `GridStackView` is gone; the grid dashboard now lives at `@Route("")` in `DashboardView`, with one set of chart factories, the point-click notifications from the old dashboard, and one `SideNavItem`. `GridStackViewTest` was renamed to `DashboardViewTest` and gained a case asserting the three charts render. Two decisions worth a look at review: - The `localStorage` key changed from `gridstack-demo` to `dashboard`, so an existing saved layout is dropped once. Say the word if you'd rather keep the old key. - `@Route("gridstack")` was not kept as an alias — the issue left that optional and the demo value is fully covered by the merged view. `./mvnw test` → 11 tests, 0 failures.
claude-bot added ai-review and removed ai-wip labels 2026-07-28 17:13:21 +00:00
Sign in to join this conversation.