feat: Collapsible sections — authoring UX + DashboardContainer abstraction#1926
feat: Collapsible sections — authoring UX + DashboardContainer abstraction#1926alex-fedotyev wants to merge 8 commits intomainfrom
Conversation
Add section management to the dashboard: create, rename, delete sections, toggle default collapsed state, and move tiles between sections via a menu on the tile hover toolbar. Closes #1897
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
PR Review
✅ Otherwise: renaming is complete and consistent across all packages, |
E2E Test Results✅ All tests passed • 92 passed • 3 skipped • 945s
Tests ran across 4 shards in parallel. |
Schema changes: - DashboardSection → DashboardContainer with `type` field (extensible to 'group'/'tab' later, only 'section' for now) - sectionId → containerId on tiles - sections → containers on dashboard UX improvements: - Click section title to rename directly (Kibana pattern) - Edit controls (... menu) only visible on hover - "Add Section" moved to dashboard overflow menu (not equal to Add Tile) - "Move to Section" icon reordered before delete for discoverability - IconLayoutList replaces IconFolders for clearer visual meaning - "+" button on section header to add tile directly into that section
|
@claude - code review |
|
Claude finished @alex-fedotyev's task in 2m 17s —— View job Code Review
Overall this is well-structured work. The schema abstraction is clean, the UX is thoughtful, and the tests are thorough. A few issues to address before merging. 🔴 CriticalData migration missing — existing PR #1900 introduced Fix with a read-time fallback in the API layer or a one-time migration: // packages/api/src/models/dashboard.ts or the dashboard controller
containers: { type: mongoose.Schema.Types.Array, required: false },
sections: { type: mongoose.Schema.Types.Array, required: false }, // keep for migrationOr a read-time normalizer in the API response handler: // When returning a dashboard, normalize legacy field
if (!dashboard.containers && (dashboard as any).sections) {
dashboard.containers = (dashboard as any).sections;
}
Consider making it optional with a default: 🟡 Warnings
Both call
The menu label already communicates intent ("Collapse by Default" / "Expand by Default"), so the UX isn't broken — just the prop API is misleading.
const inputRef = useRef<HTMLInputElement>(null); // line 33
// ...
<Input ref={inputRef} autoFocus ... /> // line 107
Accessibility: outer The outer container sets 🔵 Minor / SuggestionsNo confirmation on "Delete Section" (
"New Section" title always hardcoded ( Multiple rapid "Add Section" calls produce multiple containers all titled "New Section". Since IDs are unique this isn't a functional bug, but a minor quality-of-life improvement would be to auto-increment: "Move to Section" menu appears even if only one section exists and tile is in it
✅ What's good
|
Addressing code review feedbackFixed (6a45d25)
Deferred
Not changing
|
Summary
Adds the authoring experience for dashboard sections (create, rename, delete, manage tiles) and introduces a polymorphic
DashboardContainerabstraction that future-proofs the schema for tabs and groups.Builds on #1900 (core collapsible sections mechanics). Closes #1897.
Schema:
DashboardSection→DashboardContainerDashboardSectionSchema→DashboardContainerSchemawith a newtypefield ('section'for now, extensible to'group'/'tab'later)sectionId→containerIdon tilessections→containerson dashboardsAuthoring UX
...overflow menu → "Add Section"...→ Delete Section (tiles become ungrouped, not deleted)...→ Collapse/Expand by Default+button opens tile editor pre-assigned to that sectionUX polish (informed by Grafana/Datadog/Kibana competitor research)
...menu and+button only appear on section header hover, keeping view mode cleanIconLayoutListinstead ofIconFoldersWhat's NOT in this PR (follow-up work)
react-dndcustom drag layer; data model already supports it (containerIdupdate)typeenum and build UIsTest plan
🤖 Generated with Claude Code