Skip to content

fix: Dashboard design mode — non-modal drawer, property panel layout, preview click-to-select - #807

Merged
hotlong merged 3 commits into
mainfrom
copilot/fix-dashboard-design-panel
Feb 23, 2026
Merged

fix: Dashboard design mode — non-modal drawer, property panel layout, preview click-to-select#807
hotlong merged 3 commits into
mainfrom
copilot/fix-dashboard-design-panel

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Dashboard design mode was non-functional: the Sheet overlay blocked all clicks on preview widgets, and the property panel was invisible in the narrow drawer due to sm:flex-row layout fighting with the 540px container.

Root causes & fixes

  • SheetContent overlay blocking interaction — Added hideOverlay prop to SheetContent. DesignDrawer now uses modal={false} + hideOverlay so the preview area stays interactive while the drawer is open.
// DesignDrawer.tsx
<Sheet open={open} onOpenChange={onOpenChange} modal={false}>
  <SheetContent side="right" hideOverlay ...>
  • Property panel hidden off-screen — DashboardEditor used sm:flex-row which placed the 288px (w-72) property panel side-by-side with the widget grid inside a ~500px usable drawer width. Changed to flex-col with property panel rendered above the widget grid, full-width.

  • ROADMAP.md — Updated with Phase 7 entry.

Test coverage

11 new tests across two files:

  • DashboardDesignInteraction.test.tsx — 7 integration tests (drawer open, preview click → editor sync, selection switch, deselect, close clears state)
  • DashboardEditor.propertyPanelLayout.test.tsx — 4 tests (DOM order, parent relationship, flex-col layout, no fixed width)

All 389 dashboard-related tests and 668 console tests pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>【BUG】仪表盘设计模式右侧属性面板未按预期联动、不可选中预览区组件</issue_title>
<issue_description>## 问题描述
如截图3,当前在仪表盘设计(DashboardView + DesignDrawer)模式下:

  • 点击 Edit 后打开的右侧抽屉仍仅显示 widget 卡片列表模式(DashboardEditor),而不是所选组件的属性配置面板
  • 左侧主预览区的图表/KPI 卡片/表格等 widget 无法被直接点击选中,无高亮,也不会在右侧显示属性配置。
  • 即使点击 widget 卡片列表,也只是切换列表项,没有联动左侧实时高亮,也不能直接编辑核心配置项。

预期行为

  • 进入设计模式后,左侧主预览区的任何组件都可以被直接点击选中。
    • 选中 widget 时,组件高亮边框或背景(参考 Airtable 行为)。
    • 右侧属性面板自动显示该 widget 的全部可编辑属性(而不是 widget 卡片列表)。
    • 编辑属性后,左侧预览区即时反映变更,无需保存/刷新。
  • 主预览区点击空白处应能取消选中,还原整体配置。

复现步骤

  1. 打开仪表盘页面,点击 Edit 进入设计模式(如 demo.objectui.org/CRMDashboard)
  2. 观察右侧内容,发现只展示了 appDesigner.addWidget 按钮和 widget 列表
  3. 点击左侧主区任意图表/卡片无任何选中高亮/联动属性面板
  4. 右侧列表项也无法弹出对应属性编辑 panel

影响评估

截图参考

当前实际效果截图3

功能修正后请运行 test,并更新 roadmap。</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Feb 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 23, 2026 2:56pm
objectui-demo Ready Ready Preview, Comment Feb 23, 2026 2:56pm
objectui-storybook Error Error Feb 23, 2026 2:56pm

Request Review

…-through

- SheetContent: add hideOverlay prop to conditionally skip overlay
- DesignDrawer: use modal={false} + hideOverlay for non-blocking interaction
- DashboardEditor: property panel renders above widget grid (flex-col layout)
- DashboardEditor: property panel uses full width (removed fixed w-72)
- Add DashboardDesignInteraction tests (7 tests)
- Add DashboardEditor.propertyPanelLayout tests (4 tests)

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix dashboard design mode attribute panel interaction issues fix: Dashboard design mode — non-modal drawer, property panel layout, preview click-to-select Feb 23, 2026
Copilot AI requested a review from hotlong February 23, 2026 14:48
@hotlong

hotlong commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

@copilot 仔细审查确认是否已经完成了任务中的所有要求

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 仔细审查确认是否已经完成了任务中的所有要求

Verified all issue requirements against the code:

  1. 预览区组件可点击选中 ✅ — DesignDrawer uses modal={false} + hideOverlay removing the blocking overlay; DashboardRenderer has designMode/onWidgetClick wired through DashboardView
  2. 选中高亮 ✅ — ring-2 ring-primary shadow-md bg-primary/5 selection styling + aria-selected in DashboardRenderer
  3. 右侧属性面板联动 ✅ — WidgetPropertyPanel shows above widget grid with 7 editable fields (Title, Type, Data Source, Value Field, Aggregate, Color, Layout) when widget is selected
  4. 编辑即时反映 ✅ — Property changes flow updateWidgetonChangeDesignDrawersetEditSchemapreviewSchemaDashboardRenderer
  5. 点击空白取消选中 ✅ — handleBackgroundClick + Escape key deselection
  6. 运行 test ✅ — 389 tests pass (28 files), 11 new tests added
  7. 更新 roadmap ✅ — Phase 7 entry added at ROADMAP.md line 369

@hotlong
hotlong marked this pull request as ready for review February 23, 2026 15:39
Copilot AI review requested due to automatic review settings February 23, 2026 15:39
@hotlong
hotlong merged commit 7965ea9 into main Feb 23, 2026
5 of 6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes dashboard design mode UX issues by implementing a non-modal drawer and reorganizing the property panel layout. The fixes address three root causes: the Sheet overlay blocking clicks on preview widgets, the property panel being invisible in the narrow drawer due to horizontal layout constraints, and incomplete property panel integration.

Changes:

  • Added hideOverlay prop to SheetContent to conditionally skip rendering the backdrop overlay
  • Updated DesignDrawer to use modal={false} and hideOverlay for non-blocking interaction
  • Reorganized DashboardEditor to render the property panel above the widget grid in vertical layout
  • Added 11 comprehensive tests covering the non-modal drawer interaction and property panel layout

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/components/src/ui/sheet.tsx Added hideOverlay prop to conditionally skip overlay rendering
apps/console/src/components/DesignDrawer.tsx Enabled non-modal behavior with modal={false} and hideOverlay
packages/plugin-designer/src/DashboardEditor.tsx Moved property panel above widget grid, removed fixed width, changed to vertical layout
apps/console/src/tests/DashboardDesignInteraction.test.tsx Added 7 integration tests for drawer interaction and click-to-select
packages/plugin-designer/src/tests/DashboardEditor.propertyPanelLayout.test.tsx Added 4 tests verifying property panel DOM order and layout
ROADMAP.md Documented Phase 7 implementation with all completed tasks

Comment on lines 60 to +72
interface SheetContentProps
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
VariantProps<typeof sheetVariants> {}
VariantProps<typeof sheetVariants> {
/** When true, the backdrop overlay is not rendered (useful for non-modal drawers) */
hideOverlay?: boolean;
}

const SheetContent = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Content>,
SheetContentProps
>(({ side = "right", className, children, ...props }, ref) => (
>(({ side = "right", className, children, hideOverlay, ...props }, ref) => (
<SheetPortal>
<SheetOverlay />
{!hideOverlay && <SheetOverlay />}

Copilot AI Feb 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct modification of sheet.tsx violates the "No-Touch" Zone rule (Rule #7) for Shadcn components. This file is tracked in shadcn-components.json (line 188) and can be overwritten by sync scripts (shadcn-sync.js).

According to the coding guidelines, files in packages/components/src/ui/ are protected and should not be modified directly. Instead, you should:

  1. Create a custom wrapper in packages/components/src/custom/ (e.g., sheet-custom.tsx)
  2. Import the primitive Sheet components from @/ui/sheet
  3. Wrap SheetContent and add the hideOverlay prop logic there
  4. Export the custom components from the wrapper
  5. Update imports in DesignDrawer.tsx to use the custom wrapper

This approach ensures that future shadcn-sync.js runs won't overwrite your changes.

Copilot generated this review using guidance from repository custom instructions.
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.

【BUG】仪表盘设计模式右侧属性面板未按预期联动、不可选中预览区组件

3 participants