Feature/implement customizable panel - #1
Merged
Conversation
- 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.
…nd add skills documentation
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
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:users.writeBackend
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: singleSELECT/WITHstatement 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-appendsLIMIT 500when absent. Replaces the previous per-table column whitelist — sensitive-column redaction is now handled centrally by the host'sdb_query/db_query2runtime instead of being this plugin's responsibility.overview.goremoved; superseded bypanels.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.components/ui/{button,chart,dialog}.tsx,lib/{i18n,utils}.ts, anduse-sync-external-storeshims 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.tsxremoved; superseded by the panel components above.MCP / Skill
mcp/src/index.ts— newdashboard_*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 ./...inbackend/(includes newpanels_cache_test.goand expandedplugin_test.go){{project_id}}scopingrefresh: truebypasses it