Skip to content

refactor: Unify section/group into single collapsible Group#2015

Open
alex-fedotyev wants to merge 2 commits intofeat/dashboard-dnd-organizationfrom
feat/unified-group
Open

refactor: Unify section/group into single collapsible Group#2015
alex-fedotyev wants to merge 2 commits intofeat/dashboard-dnd-organizationfrom
feat/unified-group

Conversation

@alex-fedotyev
Copy link
Copy Markdown
Contributor

Summary

Merges the separate "section" and "group" container types into a single Group concept that is:

  • Always bordered — clear visual container
  • Always collapsible — chevron toggle with URL-based collapse state
  • Optionally tabbed — add tabs to any group, tab bar appears with 2+ tabs

This addresses the UX concern from #1972 that "section" and "group" are near-synonyms that force users to choose between two similar concepts.

What changed

  • Schema: Accepts 'section' for backward compatibility, new code always writes 'group'
  • GroupContainer: Gains collapse chevron, tile count badge when collapsed, "Collapse by Default" toggle in overflow menu
  • SectionHeader: Deleted — all functionality merged into GroupContainer
  • Add menu: Single "New Group" item instead of "New Section" + "New Group"
  • DnD components: Renamed from section to container terminology
  • useDashboardContainers: handleAddContainer() always creates a group with 1 default tab
  • useTileSelection: Cmd+G creates a group (not section)

Builds on

Test plan

  • All 56 dashboard container tests pass
  • All 1185 app unit tests pass
  • ESLint clean
  • Backward compatible — dashboards with type: 'section' containers still parse correctly
  • No new TypeScript errors (pre-existing dnd-kit type issues unchanged)

🤖 Generated with Claude Code

…iner

Merges the separate "section" (collapsible, borderless) and "group"
(bordered, tabbed) concepts into a single "Group" type that is always
bordered, always collapsible, and optionally tabbed.

- Schema accepts 'section' for backward compat, new code writes 'group'
- GroupContainer gains collapse chevron, tile count badge, default
  collapse toggle in overflow menu
- SectionHeader component removed (functionality merged into GroupContainer)
- Add menu simplified: single "New Group" instead of Section + Group
- DnD components renamed from section to container terminology
- All 56 dashboard tests updated and passing
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 30, 2026

⚠️ No Changeset found

Latest commit: 15c4671

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 31, 2026 0:12am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

PR Review

Clean refactor that merges section/group into a unified Group container. Backward compatibility is handled correctly at the schema level (type: z.enum(['section', 'group'])). A few items to address:

  • ⚠️ Accessibility regression in GroupContainer.tsx: The deleted SectionHeader had role="button", tabIndex={0}, aria-expanded, and onKeyDown (Enter/Space) on the collapse toggle. The new chevron and title Flex only use onClick — keyboard-only users can no longer toggle collapse. Add keyboard handler + ARIA to the collapse trigger.

  • ⚠️ No unit tests for new GroupContainer collapse behavior: SectionHeader.test.tsx (152 lines) was deleted and GroupContainer gained significant new surface area (collapsed prop, onToggle, onToggleDefaultCollapsed, onRename), but no GroupContainer.test.tsx was added. The deleted tests covered toggle, tile count badge, and menu interactions — these behaviors are now untested.

  • ℹ️ Tile count badge silently dropped: SectionHeader showed (N tiles) when collapsed; GroupContainer omits this. The latest commit message confirms it's intentional, but if it was a deliberate UX decision it should be noted in the PR description (it's currently missing from the "What Changed" section).

✅ Schema backward compat, hook renaming, DnD refactor, and the render-path unification all look correct.

The count was misleading for tabbed groups (showed total across all
tabs) and not actionable — users collapse to save space, not to see
a summary.
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.

1 participant