Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…els in DashboardView Replace the right-side drawer that contained the full DashboardEditor (widget list, toolbar, preview) with inline DashboardConfigPanel / WidgetConfigPanel, following the same pattern as ListView. - No widget selected: shows DashboardConfigPanel (dashboard-level properties) - Widget selected: shows WidgetConfigPanel (widget configuration) - Add-widget toolbar moved to the main area header - Config panels use standard ConfigPanelRenderer with save/discard footer - Main area remains WYSIWYG preview via DashboardRenderer Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ROADMAP Addresses code review feedback: - Guard base.layout with fallback to empty object in unflattenWidgetConfig - Add Phase 8 to ROADMAP documenting the inline config panel refactor Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 仔细评估是否完整实现的任务中要求的所有功能 |
Critical fixes for complete ListView-parity: 1. Stabilize config references using configVersion counter pattern (matching ViewConfigPanel's stableActiveView approach) — prevents useConfigDraft from resetting the draft on every field change, so Save/Discard footer works correctly. 2. Add widget delete button via WidgetConfigPanel's new headerExtra prop — renders a Trash2 icon in the config panel header. 3. Fix dashboard config live preview — properly convert refreshInterval to number when updating editSchema. 4. Add headerExtra prop to WidgetConfigPanel component. 5. Add tests for widget deletion, live field change preview, and config panel header actions. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…comments - Restore rowHeight/showDescription/theme in handleDashboardConfigSave (prevents data loss on save) - Simplify dashboardConfig memo dep to [configVersion] alone - Improve comments explaining the configVersion stabilization pattern - Update ROADMAP with widget delete and config stabilization entries Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
完整评估后发现了 3 个关键缺失,已在 1. Config draft 重置 Bug(最关键) 2. Widget 删除能力丢失 3. Dashboard config save 属性丢失 新增 5 个测试覆盖:widget 删除、删除后切回 dashboard config、删除持久化、onFieldChange 实时预览不重置面板。全部 175 个 dashboard 相关测试通过。 |
There was a problem hiding this comment.
Pull request overview
Refactors Console dashboard “design mode” to follow the consistent ObjectUI pattern: WYSIWYG preview in the main area with a right-side, schema-driven property/config panel (instead of rendering the full DashboardEditor inside a drawer).
Changes:
DashboardViewnow renders inlineDashboardConfigPanel/WidgetConfigPanel, adds an add-widget toolbar, supports widget delete, and stabilizes config drafts via aconfigVersionpattern.WidgetConfigPanelgains aheaderExtraslot to support header actions (e.g., delete).- Console integration tests are rewritten to validate selection → panel switching, live preview updates, deletion, and persistence; ROADMAP updated.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/plugin-dashboard/src/WidgetConfigPanel.tsx | Adds headerExtra passthrough to ConfigPanelRenderer for custom header actions. |
| apps/console/src/components/DashboardView.tsx | Replaces DesignDrawer/DashboardEditor edit UX with inline config panels + live preview and persistence wiring. |
| apps/console/src/tests/DashboardViewSelection.test.tsx | Updates selection-sync integration tests for new inline config panel architecture. |
| apps/console/src/tests/DashboardDesignInteraction.test.tsx | Updates design interaction tests for inline panels, toolbar, and widget deletion. |
| ROADMAP.md | Adds Phase 8 entry for the inline config panel refactor. |
| title={`Add ${label}`} | ||
| > | ||
| <Plus className="h-3 w-3" /> | ||
| <Icon className="h-3 w-3" /> | ||
| </button> |
There was a problem hiding this comment.
The add-widget toolbar buttons are icon-only and rely on the title attribute for description. title is not a reliable accessible name for screen readers. Add an aria-label (e.g., “Add Bar Chart”) or include visually-hidden text inside the button so the controls are accessible.
| onClick={() => removeWidget(selectedWidgetId!)} | ||
| className="h-7 w-7 p-0 text-destructive hover:text-destructive" | ||
| data-testid="widget-delete-button" | ||
| title="Delete widget" |
There was a problem hiding this comment.
The delete button in the widget config panel header is icon-only. Add an explicit accessible name (e.g., aria-label="Delete widget" or a <span className="sr-only">…</span>), since title alone is not consistently announced by assistive tech.
| title="Delete widget" | |
| title="Delete widget" | |
| aria-label="Delete widget" |
| { type: 'pie', label: 'Pie Chart', Icon: PieChart }, | ||
| { type: 'table', label: 'Table', Icon: Table2 }, | ||
| { type: 'grid', label: 'Grid', Icon: LayoutGrid }, | ||
| ]; |
There was a problem hiding this comment.
The add-widget palette includes a grid widget type, but WidgetConfigPanel's type select options (in plugin-dashboard) don’t include grid. This can lead to the widget type field displaying as an unknown value or being impossible to reselect after adding a grid widget. Consider aligning the palette and the widget type options (either add grid to the config panel options, or remove it from the palette if it isn’t supported here).
| rowHeight: config.rowHeight, | ||
| refreshInterval: Number(config.refreshInterval) || 0, | ||
| title: config.title, | ||
| showDescription: config.showDescription, | ||
| theme: config.theme, |
There was a problem hiding this comment.
The DashboardConfigPanel fields showDescription (and potentially theme) are being persisted onto the dashboard schema as top-level properties, but the dashboard rendering logic uses schema.header.showDescription to control description visibility. As a result, toggling “Show description” won’t affect the preview/rendered output. Map this config to schema.header.showDescription (creating/updating header) and ensure the view header uses that value for rendering.
| @@ -85,9 +325,27 @@ export function DashboardView({ dataSource }: { dataSource?: any }) { | |||
| )} | |||
There was a problem hiding this comment.
The page header is rendered from metadata (dashboard.label / dashboard.description) rather than the live previewSchema. This means edits made in the config panel (e.g., title / show/hide description) won’t be reflected in the header while editing, and may appear to have no effect. Consider sourcing the displayed title/description from previewSchema (or explicitly documenting that these fields don’t affect the console header).
Dashboard design mode rendered the full
DashboardEditor(widget card list, toolbar, preview) inside a right-sideDesignDrawer, violating the "main area = WYSIWYG preview, right panel = property config" pattern used by ListView/PageDesigner.Changes
DashboardView.tsx— ReplaceDesignDrawer+ lazyDashboardEditorwith inlineDashboardConfigPanel/WidgetConfigPanelfrom@object-ui/plugin-dashboard, matching the ListViewViewConfigPanelpattern:DashboardConfigPanel(columns, gap, refresh, theme)WidgetConfigPanel(title, type, data binding, layout, appearance)ConfigPanelRenderersave/discard footeruseAdapter().update()configVersioncounter pattern (matching ViewConfigPanel'sstableActiveViewapproach) — preventsuseConfigDraftfrom resetting the draft on every live field change, ensuring Save/Discard footer works correctlyheaderExtradelete button in WidgetConfigPanel header — deletion deselects the widget, switches to dashboard config, and persists to backendonFieldChangewith proper type handling (e.g.refreshInterval→ number)WidgetConfigPanel.tsx— AddedheaderExtraprop to support custom header actions (e.g. delete button) viaConfigPanelRendererIntegration tests — Rewrote
DashboardDesignInteraction(10 tests) andDashboardViewSelection(11 tests) to verify config panel switching, selection sync, widget deletion, live preview stability, and backend persistence against the new architectureROADMAP.md — Added Phase 8 entry
DashboardEditorremains available for standalone use (e.g.DashboardDesignPageat/design/dashboard/:name). 175 dashboard-related tests pass across 18 test files.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.