feat(panel): add PanelGroup to join form sections (PUI-10) #135

Merged
pienter merged 5 commits from feature/PUI-10-add-panelgroup-to-join-form-sections into main 2026-11-20 22:27:27 +00:00
Owner

Why

A form with several Panels showed them as separate floating cards. The chosen section treatment (prototype variant F) joins them: PanelGroup wraps Panels in one bordered surface with a divider between visible sections, and titles stay above their fields. Fields keep today's look, and Panels outside a group are unchanged.

For you

  • D1 Decide: an editable BlockEditor Panel inside a group keeps its full-width rule, as the criterion asks (record-layout.css:23-27). So its title, its add row and each bordered block sit flush against the group's 1px border, which reads as a double line, and a divider above it sits only --space-2xs from its title. Gain: matches the criterion and standalone behaviour. Cost: possibly cramped inside a group. Alternative: give that Panel inline padding inside a group. No story or example puts a BlockEditor in a group.
  • V1 Verify by hand: restart the dev server (new ./components/PanelGroup.vue export). Then check CRM → contact edit (two joined Panels with one divider) and the Storybook Layout/PanelGroup stories (light, dark, narrow; the hidden middle Panel leaves no double or leading divider). No browser ran, and the story play functions (bun --cwd storybook test) did not run.

Review guide

1. PanelGroup. A plain <div class="pui-panel-group"> with only a default slot, no props and no role (PanelGroup.vue).

2. CSS. record-layout.css:38-55 .pui-panel-group: the group takes the Panel's surface (border, radius, background). Its direct child Panels drop theirs. The divider is border-block-start on each visible Panel that follows another visible one.

  • ~ rather than variant F's +, so a hidden tab panel neither swallows nor leads a divider.
  • Only direct children (>), so a Panel nested inside a Panel keeps its chrome.
  • Check: the cascade inside @layer components. .pui-panel-group > .pui-panel (0,2,0) beats .pui-panel and leaves padding, [hidden] and the 48em/56em rules alone. The editable-BlockEditor rule (0,3,0) still wins on padding. The divider (0,5,0) beats that rule's border: 0.

3. Playground. ContactForm.vue:215-234: the two Panels are wrapped. The rest is re-indentation only.

Skim: package.json export, storybook/stories/Layout/PanelGroup.stories.ts (three Panels, the middle one hidden; light, Dark, Narrow; play assertions on borders and role), record-layout/AUDIT.md (PanelGroup section), CONVENTIONS row and sentence, README line, CHANGELOG ## Unreleased Added.

Choices made: the styles stay in record-layout.css with Panel (one visual family) rather than a new file; the story is its own Layout/PanelGroup file rather than an addition to RecordForm.stories.ts (fewer conflicts with the other open PRs); the group itself has no padding, so each divider follows Panel padding.

Evidence

  • Covered: PanelGroup renders a plain div holding the Panels' <section> and <h2> unchanged, with hidden passed through and no role (SSR test).
  • Checks: bun run lint ✓, bun run typecheck ✓, bun run format:check ✓, bun run build:vue ✓, bun run build:storybook (the Catalog) ✓. Each packages/ui/tests file passes run alone. The combined bun test packages/ui has 32 failures that also occur on main (a test-loader collision).

Tests: packages/ui/tests/panel-group.test.ts (new).

Review

Reviewed: b2b893f8e12ef091803335d64a4aff5859f8099f by workflow-autopilot review panel, changes + quality seats: 0 fixed, 1 declined, 0 open

  • Declined: the BlockEditor-in-a-group spacing (it follows the criterion; raised as D1).

Merge Danger

Door: two-way. It adds a component and opt-in CSS.

Blast Radius: tiny. Only markup that uses .pui-panel-group changes.

## Why A form with several Panels showed them as separate floating cards. The chosen section treatment (prototype variant F) joins them: `PanelGroup` wraps Panels in one bordered surface with a divider between visible sections, and titles stay above their fields. Fields keep today's look, and Panels outside a group are unchanged. ## For you - [ ] **D1 Decide:** an editable BlockEditor Panel inside a group keeps its full-width rule, as the criterion asks ([record-layout.css:23-27](https://git.pienter.space/pienter/ui/src/commit/b2b893f8e12ef091803335d64a4aff5859f8099f/packages/ui/components/layout/record-layout/record-layout.css#L23-L27)). So its title, its add row and each bordered block sit flush against the group's 1px border, which reads as a double line, and a divider above it sits only `--space-2xs` from its title. Gain: matches the criterion and standalone behaviour. Cost: possibly cramped inside a group. Alternative: give that Panel inline padding inside a group. No story or example puts a BlockEditor in a group. - [ ] **V1 Verify by hand:** restart the dev server (new `./components/PanelGroup.vue` export). Then check CRM → contact edit (two joined Panels with one divider) and the Storybook `Layout/PanelGroup` stories (light, dark, narrow; the hidden middle Panel leaves no double or leading divider). No browser ran, and the story play functions (`bun --cwd storybook test`) did not run. ## Review guide **1. PanelGroup.** A plain `<div class="pui-panel-group">` with only a default slot, no props and no role ([PanelGroup.vue](https://git.pienter.space/pienter/ui/src/commit/b2b893f8e12ef091803335d64a4aff5859f8099f/packages/ui/components/layout/record-layout/PanelGroup.vue)). **2. CSS.** [record-layout.css:38-55](https://git.pienter.space/pienter/ui/src/commit/b2b893f8e12ef091803335d64a4aff5859f8099f/packages/ui/components/layout/record-layout/record-layout.css#L38-L55) `.pui-panel-group`: the group takes the Panel's surface (border, radius, background). Its direct child Panels drop theirs. The divider is `border-block-start` on each visible Panel that follows another visible one. - `~` rather than variant F's `+`, so a hidden tab panel neither swallows nor leads a divider. - Only direct children (`>`), so a Panel nested inside a Panel keeps its chrome. - **Check:** the cascade inside `@layer components`. `.pui-panel-group > .pui-panel` (0,2,0) beats `.pui-panel` and leaves padding, `[hidden]` and the 48em/56em rules alone. The editable-BlockEditor rule (0,3,0) still wins on padding. The divider (0,5,0) beats that rule's `border: 0`. **3. Playground.** [ContactForm.vue:215-234](https://git.pienter.space/pienter/ui/src/commit/b2b893f8e12ef091803335d64a4aff5859f8099f/examples/vue/src/views/crm/ContactForm.vue#L215-L234): the two Panels are wrapped. The rest is re-indentation only. **Skim:** `package.json` export, `storybook/stories/Layout/PanelGroup.stories.ts` (three Panels, the middle one hidden; light, Dark, Narrow; play assertions on borders and role), `record-layout/AUDIT.md` (PanelGroup section), CONVENTIONS row and sentence, README line, CHANGELOG `## Unreleased` Added. **Choices made:** the styles stay in `record-layout.css` with Panel (one visual family) rather than a new file; the story is its own `Layout/PanelGroup` file rather than an addition to `RecordForm.stories.ts` (fewer conflicts with the other open PRs); the group itself has no padding, so each divider follows Panel padding. ## Evidence - **Covered:** PanelGroup renders a plain div holding the Panels' `<section>` and `<h2>` unchanged, with `hidden` passed through and no role (SSR test). - **Checks:** `bun run lint` ✓, `bun run typecheck` ✓, `bun run format:check` ✓, `bun run build:vue` ✓, `bun run build:storybook` (the Catalog) ✓. Each `packages/ui/tests` file passes run alone. The combined `bun test packages/ui` has 32 failures that also occur on `main` (a test-loader collision). **Tests:** `packages/ui/tests/panel-group.test.ts` (new). ## Review **Reviewed:** `b2b893f8e12ef091803335d64a4aff5859f8099f` by workflow-autopilot review panel, changes + quality seats: 0 fixed, 1 declined, 0 open - **Declined:** the BlockEditor-in-a-group spacing (it follows the criterion; raised as D1). ## Merge Danger **Door:** two-way. It adds a component and opt-in CSS. **Blast Radius:** tiny. Only markup that uses `.pui-panel-group` changes.
PanelGroup renders one bordered surface around the Panels inside it.
Those Panels drop their own border, radius and background, and a
divider separates consecutive visible Panels, skipping hidden tab
panels so no leading or double divider appears. Panels keep their
section and heading semantics; PanelGroup adds no role. Panels outside
a group and the field look are unchanged.

Refs: PUI-10
feat(examples): group the contact form's panels
All checks were successful
ci / typecheck (pull_request) Successful in 23s
ci / lint (pull_request) Successful in 27s
ci / format (pull_request) Successful in 30s
ci / rust (pull_request) Successful in 1m57s
ci / release (pull_request) Has been skipped
b2b893f8e1
ContactForm wraps its two Panels in a PanelGroup, so the form reads as
one surface with a divider between its sections.

Refs: PUI-10
A Panel around an editable BlockEditor drops its chrome so the editor
gets the full width. Inside a PanelGroup the group border is the chrome,
so the blocks sat flush against it. The rule now applies only outside a
group; inside one the Panel keeps the ordinary padding and the divider.

Refs PUI-10
docs(storybook): show a BlockEditor panel inside a PanelGroup
All checks were successful
ci / lint (pull_request) Successful in 31s
ci / typecheck (pull_request) Successful in 26s
ci / format (pull_request) Successful in 36s
ci / rust (pull_request) Successful in 5m58s
ci / release (pull_request) Has been skipped
b056c45319
Refs PUI-10
Merge remote-tracking branch 'origin/main' into feature/PUI-10-add-panelgroup-to-join-form-sections
All checks were successful
ci / typecheck (pull_request) Successful in 23s
ci / lint (pull_request) Successful in 26s
ci / format (pull_request) Successful in 35s
ci / rust (pull_request) Successful in 5m29s
ci / release (pull_request) Has been skipped
c04618b2ce
# Conflicts:
#	packages/ui/CHANGELOG.md
pienter scheduled this pull request to auto merge when all checks succeed 2026-11-20 22:11:37 +00:00
pienter deleted branch feature/PUI-10-add-panelgroup-to-join-form-sections 2026-11-20 22:27:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pienter/ui!135
No description provided.