Skip to content

Feature/implement customizable panel - #1

Merged
pikann merged 4 commits into
masterfrom
feature/implement-customizable-panel
Jul 22, 2026
Merged

Feature/implement customizable panel#1
pikann merged 4 commits into
masterfrom
feature/implement-customizable-panel

Conversation

@pikann

@pikann pikann commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the old fixed "overview" pages (ProjectOverviewSection, InstanceOverviewSection, DashboardPage, widgets.tsx) with a customizable, panel-based dashboard builder — drag-and-drop charts, tables, and text blocks backed by user-authored SQL, across three scopes:

  • Project dashboard — one per project
  • Admin dashboard — instance-wide, requires users.write
  • Integration dashboards — one per host Backlog/Sprint/Timeline "Dashboard"-type view

Backend

  • panels.go, views.go, types.go — new panel/view CRUD and layout endpoints, plus panel data fetching with a TTL cache (5 min) and force-refresh (panels_cache_test.go).
  • query_guard.go — safety layer for user-authored panel queries: single SELECT/WITH statement only, blocks mutating statements and introspection (information_schema, pg_catalog, dblink, lo_*, etc.), requires the {{project_id}} placeholder on project/integration-scoped queries (substituted server-side as a bound parameter to prevent cross-project data leakage), and auto-appends LIMIT 500 when absent. Replaces the previous per-table column whitelist — sensitive-column redaction is now handled centrally by the host's db_query/db_query2 runtime instead of being this plugin's responsibility.
  • New migrations for dashboard/panel/view tables, including a singleton-per-host-view constraint.
  • overview.go removed; superseded by panels.go/views.go.

Frontend

  • PanelGrid.tsx, PanelCard.tsx, PanelEditor.tsx, DashboardBody.tsx, SimpleCharts.tsx — new drag-and-drop grid layout, panel rendering (chart/table/text), and query editor.
  • DashboardIntegrationView.tsx — new host-view integration entry point.
  • New components/ui/{button,chart,dialog}.tsx, lib/{i18n,utils}.ts, and use-sync-external-store shims ported in to keep the plugin self-contained and avoid dual-React-instance issues.
  • presets.ts — library of ready-made SQL query templates (status breakdown, burndown/velocity, overdue tasks, etc.).
  • shared.tsx / widgets.tsx removed; superseded by the panel components above.

MCP / Skill

  • mcp/src/index.ts — new dashboard_* tools for view/panel CRUD, layout updates, query preview, and panel data retrieval (project, admin, and integration scopes).
  • skills/paca-dashboard-builder/SKILL.md — new skill documenting the end-to-end workflow (resolve view → write/preview query → create panel → verify data), the query safety rules, a schema reference, and copy-paste preset queries.

Other

  • plugin.json — new routes/permissions for the added views and panel APIs.
  • README.md — updated to describe the new dashboard builder.

Test plan

  • go test ./... in backend/ (includes new panels_cache_test.go and expanded plugin_test.go)
  • Create a project dashboard, add chart/table/text panels using preset and custom queries, confirm layout persists
  • Verify query guard rejects mutating/introspection queries and enforces {{project_id}} scoping
  • Create an admin dashboard panel as a non-admin and confirm it's rejected
  • Create a Backlog/Sprint/Timeline "Dashboard" host view and confirm the integration dashboard resolves and renders panels
  • Confirm cached panel data respects TTL and refresh: true bypasses it

pikann added 4 commits July 20, 2026 18:14
- Added a new Dialog component for modal functionality, including triggers, overlays, and close buttons.
- Introduced grid-overrides.css to customize react-grid-layout styles for better integration with host themes.
- Created a minimal i18next setup for localization in dialog and button components.
- Ported utility function `cn` for class name merging from the host application.
- Developed presets.ts for SQL query templates to facilitate common dashboard setups.
- Removed shared.tsx as its functionality is now integrated into the new dashboard structure.
- Added shims for `use-sync-external-store` to resolve dual React instance issues in dependencies.
- Updated types.ts to reflect new dashboard panel structures and query result shapes.
- Removed widgets.tsx as its functionality is no longer needed in the new implementation.
- Enhanced vite.config.ts to include necessary aliases for shims and updated plugin.json for new routes and permissions.
@pikann
pikann merged commit 4995339 into master Jul 22, 2026
5 checks passed
@pikann
pikann deleted the feature/implement-customizable-panel branch July 22, 2026 10:55
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