fix: dashboard config panel edits not reflected in live preview#862
Merged
fix: dashboard config panel edits not reflected in live preview#862
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- DashboardRenderer/DashboardGridLayout getComponentSchema() now merges widget-level fields (categoryField, valueField, aggregate, object) with data provider config, with widget-level fields taking precedence - Fixes objectName precedence for table/pivot widget types - DashboardWithConfig now passes designMode/selectedWidgetId/onWidgetClick to DashboardRenderer to enable widget selection and live preview - Added 8 new tests for live preview field override behavior Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…for live preview Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix live preview issue in Dashboard editor
fix: dashboard config panel edits not reflected in live preview
Feb 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the live preview issue in the Dashboard editor where widget configuration changes (categoryField, valueField, aggregate, object) made in the right-side config panel were not immediately reflected in the left-side preview when widgets used data providers. The fix ensures widget-level fields take precedence over data provider configuration for real-time preview updates.
Changes:
- Modified
getComponentSchema()in DashboardRenderer and DashboardGridLayout to merge widget-level fields with data provider config, giving widget fields precedence - Updated DashboardWithConfig to pass
designMode,selectedWidgetId, andonWidgetClickprops to DashboardRenderer for widget selection support - Added 10 comprehensive tests covering field override scenarios and design mode functionality
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/plugin-dashboard/src/DashboardRenderer.tsx |
Fixed widget field precedence: widget.object, categoryField, valueField, and aggregate now override data provider config for live preview |
packages/plugin-dashboard/src/DashboardGridLayout.tsx |
Applied identical fix to grid layout variant for consistency |
packages/plugin-dashboard/src/DashboardWithConfig.tsx |
Added designMode, selectedWidgetId, and onWidgetClick props to enable widget selection in config editor |
packages/plugin-dashboard/src/__tests__/DashboardRenderer.widgetData.test.tsx |
Added 8 tests validating widget-level field override behavior for charts and tables |
packages/plugin-dashboard/src/__tests__/DashboardWithConfig.test.tsx |
Added 2 tests verifying design mode and widget selection functionality |
ROADMAP.md |
Documented Phase 12 completion: data provider field override for live preview |
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.
Widget config panel edits to data binding fields (
categoryField,valueField,aggregate,object) had no effect on the live preview when the widget had a data provider (widget.data.aggregate). The renderer read directly from the data provider config, which the config panel never touches.Core fix:
getComponentSchema()field precedenceIn both
DashboardRendererandDashboardGridLayout, widget-level fields now override data provider config:This also fixes
objectNameprecedence for table/pivot widgets (samewidgetData.object || widget.object→widget.object || widgetData.objectreversal).DashboardWithConfigmissing design mode wiringDashboardWithConfigdefinedhandleWidgetSelectbut never passeddesignMode/selectedWidgetId/onWidgetClicktoDashboardRenderer, making widget selection impossible in the plugin-level component.Tests
DashboardWithConfigdesign mode (overlay presence, widget click-to-select)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.