Phase 2 (Milestone 2): Dashboards#14
Closed
kosminus wants to merge 2 commits into
Closed
Conversation
Composes saved queries/charts into workspace-shared dashboards: a draggable tile grid with per-tile refresh and dashboard-level filters that flow into each tile's SQL. Backend: - Models Dashboard + DashboardTile (workspace-scoped — the first artifact scoped by workspace_id rather than connection); migration 006. - dashboard_service: _assert_access (workspace scope + role, mirrors connection_service), CRUD, tile CRUD, bulk layout update, and run_tile. Tiles run via saved_query_service.run_saved_query, so they authorize through the saved query's connection and reuse the M1 result cache. - Filters reuse the saved-query param system: dashboard filter values are passed as supplied params; render_sql only consumes the ones a tile's SQL references and ignores the rest — no per-tile wiring. - _finalize refreshes server-side onupdate timestamps after UPDATEs to avoid a lazy-load (MissingGreenlet) during async response serialization. - Endpoints registered under /dashboards (get_org_context, like teams.py). Frontend (react-grid-layout): - Dashboards list + detail (draggable/resizable grid), tile cards that render a chart (reusing ChartView) or table with a cached/fresh badge and optional auto-refresh, a filters bar, add-tile and dashboard-form modals. - Extracted shared ParamInputs (used by the saved-query run drawer and the dashboard filters bar); routes + nav item. Verified: 155 backend tests pass (9 new for access rules + filter passthrough); ruff clean; frontend lint + build pass; live Docker run confirmed migration 005->6, dashboard/tile CRUD, filters driving tile results, cache reuse, and layout persistence. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add saved queries, charts, result cache/snapshots, export, and dashboards to the changelog (under 2.0.0), the README (features, project structure, API reference), and CLAUDE.md (project overview, key directories, a Phase 2 architecture section). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Milestone 2 of Phase 2 — composes the M1 saved queries/charts into workspace-shared dashboards: a draggable tile grid with per-tile refresh and dashboard-level filters that flow into every tile's SQL.
Backend
Dashboard+DashboardTile— the first workspace-scoped artifact (workspace_id, not connection-scoped); migration006.dashboard_service:_assert_access(workspace scope + role, mirrorsconnection_service), CRUD, tile CRUD, bulkupdate_layout, andrun_tile. Tiles run throughsaved_query_service.run_saved_query, so they authorize via the saved query's connection and reuse the M1 result cache.render_sqlonly consumes the{{name}}s a tile's SQL references and ignores the rest — no per-tile wiring._finalizerefreshes server-sideonupdatetimestamps after UPDATEs to avoid a lazy-load (MissingGreenlet) during async response serialization./dashboards(workspace-scoped viaget_org_context, liketeams.py); registered inrouter.py.Frontend (react-grid-layout)
ChartView) or table with a cached/fresh badge and optional auto-refresh, a filters bar, add-tile and dashboard-form modals.ParamInputscomponent (used by both the M1 saved-query run drawer and the dashboard filters bar); routes + nav item.Notable decisions
Verification
pytest155 passed (9 new:_assert_accessscope/role rules + filter passthrough); ruff clean.005→006ran on startup; created a dashboard with a{{min_stage}}filter, added a chart tile + a table tile, ran both (filter value changes the row count → confirms filters reach the SQL), confirmed M1 cache reuse on re-run, and verified drag/resize layout persistence across reload. All update paths (dashboard/tile/layout) return 200 after the_finalizefix.tsc -b && vite buildsucceeds (react-grid-layout compiles with React 19).Notes
npm install(or image rebuild) to pick upreact-grid-layout— same anonymous-node_modules-volume caveat as recharts in M1.DISABLE_AUTH=truemakes the local container act as admin.🤖 Generated with Claude Code