Skip to content

test(bulma-ui): compound component parity — identity tests, CompoundUsage stories, live docs sections - #336

Merged
allxsmith merged 4 commits into
mainfrom
claude/issue-330-compound-parity
Jul 21, 2026
Merged

allxsmith merged 4 commits into
mainfrom
claude/issue-330-compound-parity

Conversation

@allxsmith

@allxsmith allxsmith commented Jul 21, 2026 •

Copy link
Copy Markdown
Owner

Closes #330.

Brings the 17 pre-existing compound families up to the compound-artifact standard established for the newly-compound families in #331, and codifies that standard in the CLAUDE.md files.

What's in here

Tests + story + docs section added (previously nothing):

  • Panel, Pagination, Steps¹, Figure
  • Navbar, Tabs (incl. nested Tabs.Content.Item), Media, Level, Hero
  • Dropdown (plain-CSF story style, static open via active), Menu, Sidebar (useState/isOpen story pattern, inline docs examples, inserted before ## Close Methods)

¹ Steps already had an equivalent CompoundComponents story — reused, not duplicated.

Identity-test blocks only (stories + docs already existed): Card (incl. nested Card.Header.Title/Card.Header.Icon), Modal (incl. Modal.Card.Head/.Title/.Body/.Foot), Message — all module-private subs, so toBeDefined() + dot-path renders asserting Bulma class output.

Top-ups: Field gains expect(Field.Label).toBe(FieldLabel) / expect(Field.Body).toBe(FieldBody). Avatars verified already complete (identity test, CompoundStatic story, ### Compound Static docs) — untouched.

Standard codified: new "Compound components" bullet in bulma-ui/CLAUDE.md Conventions (per the wording proposed in #330) and a tightened compound-pattern bullet in bulma-ui/src/components/CLAUDE.md referencing withSubComponents and the required artifacts.

Verification

  • pnpm all green locally: build, typecheck, jest with 99% coverage on all metrics, lint, format:check, bundle:stats, Storybook build
  • pnpm check:conformance: all 7 checks pass (incl. the inline-style ratchet — no style={{}} in any new story/docs example)
  • pnpm gen:catalog:check: catalog not stale
  • Tests/stories/docs only — no runtime code changes; non-release commit type (test)

Summary by CodeRabbit

  • New Features

    • Added dot-notation compound component usage across menus, navigation, layouts, forms, and other UI components.
    • Subcomponents can now be composed from a single primary component import, such as Dropdown.Item and Tabs.Content.Item.
    • Added interactive Storybook examples showcasing compound component patterns.
  • Documentation

    • Added usage guidance and live examples for compound components across the API documentation.
  • Tests

    • Added coverage verifying compound subcomponents, identity mappings, and rendered output.

…330)

Bring the 17 pre-existing compound families up to the standard shipped
with the newly-compound families in #331:

- describe('Compound components') identity tests per static
  (.toBe for named exports, toBeDefined + dot-path render for
  module-private subs) in every family's test file
- CompoundUsage stories (matching each file's local story style)
- "Compound (dot-notation) usage" live docs sections at the end of
  each API page's Usage section
- Field identity top-ups (Field.Label/Field.Body); Avatars verified
  already complete; Steps reuses its existing CompoundComponents story
- Codify the standard in bulma-ui/CLAUDE.md and
  src/components/CLAUDE.md

Tests/stories/docs only — no runtime code changes.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@allxsmith, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a7e7f102-580d-42f1-b343-910e677e46da

📥 Commits

Reviewing files that changed from the base of the PR and between d737b73 and d3578cf.

📒 Files selected for processing (5)
  • .claude/launch.json
  • bulma-ui/src/components/__tests__/Avatars.test.tsx
  • bulma-ui/src/components/__tests__/Card.test.tsx
  • bulma-ui/src/components/__tests__/Message.test.tsx
  • bulma-ui/src/components/__tests__/Modal.test.tsx

Walkthrough

This PR standardizes compound-component conventions and adds identity/render tests, CompoundUsage stories, and dot-notation API documentation for existing Bulma UI component families.

Changes

Compound component parity

Layer / File(s) Summary
Compound component conventions
bulma-ui/CLAUDE.md, bulma-ui/src/components/CLAUDE.md
Documents identity-preserving withSubComponents usage and required tests, stories, and live documentation examples.
Identity and dot-path tests
bulma-ui/src/**/__tests__/*
Adds static identity or existence assertions and verifies rendered DOM structure through compound dot-notation APIs.
CompoundUsage Storybook examples
bulma-ui/src/components/*.stories.tsx, bulma-ui/src/elements/*.stories.tsx, bulma-ui/src/layout/*.stories.tsx
Adds compound composition stories for components, elements, and layouts.
Dot-notation API documentation
docs/docs/api/**
Adds compound usage sections and live examples showing static subcomponent access from parent imports.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: needs-human-review

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately highlights the compound-component parity work: tests, stories, docs, and CLAUDE guidance.
Description check ✅ Passed The description clearly summarizes the changes, affected packages, issue reference, and verification, though it doesn't mirror the template exactly.
Linked Issues check ✅ Passed The PR adds the requested tests, CompoundUsage stories, live docs sections, and CLAUDE guidance for the listed compound families.
Out of Scope Changes check ✅ Passed The diff stays within tests, stories, docs, and CLAUDE updates, with no runtime code changes or unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-330-compound-parity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://f46ee931.bestax.pages.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bulma-ui/src/components/__tests__/Card.test.tsx`:
- Around line 390-417: Wrap the “all compound statics are defined” and “renders
a card through the dot paths” tests in a describe('Compound components') block
within the existing Card test suite, preserving their assertions and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 295dd8ad-6bfe-46e1-a3c9-b22d94e5cb03

📥 Commits

Reviewing files that changed from the base of the PR and between 091ac47 and d737b73.

📒 Files selected for processing (41)
  • bulma-ui/CLAUDE.md
  • bulma-ui/src/components/CLAUDE.md
  • bulma-ui/src/components/Dropdown.stories.tsx
  • bulma-ui/src/components/Menu.stories.tsx
  • bulma-ui/src/components/Navbar.stories.tsx
  • bulma-ui/src/components/Pagination.stories.tsx
  • bulma-ui/src/components/Panel.stories.tsx
  • bulma-ui/src/components/Sidebar.stories.tsx
  • bulma-ui/src/components/Tabs.stories.tsx
  • bulma-ui/src/components/__tests__/Card.test.tsx
  • bulma-ui/src/components/__tests__/Dropdown.test.tsx
  • bulma-ui/src/components/__tests__/Menu.test.tsx
  • bulma-ui/src/components/__tests__/Message.test.tsx
  • bulma-ui/src/components/__tests__/Modal.test.tsx
  • bulma-ui/src/components/__tests__/Navbar.test.tsx
  • bulma-ui/src/components/__tests__/Pagination.test.tsx
  • bulma-ui/src/components/__tests__/Panel.test.tsx
  • bulma-ui/src/components/__tests__/Sidebar.test.tsx
  • bulma-ui/src/components/__tests__/Steps.test.tsx
  • bulma-ui/src/components/__tests__/Tabs.test.tsx
  • bulma-ui/src/elements/Figure.stories.tsx
  • bulma-ui/src/elements/__tests__/Figure.test.tsx
  • bulma-ui/src/form/__tests__/Field.test.tsx
  • bulma-ui/src/layout/Hero.stories.tsx
  • bulma-ui/src/layout/Level.stories.tsx
  • bulma-ui/src/layout/Media.stories.tsx
  • bulma-ui/src/layout/__tests__/Hero.test.tsx
  • bulma-ui/src/layout/__tests__/Level.test.tsx
  • bulma-ui/src/layout/__tests__/Media.test.tsx
  • docs/docs/api/components/dropdown.md
  • docs/docs/api/components/menu.md
  • docs/docs/api/components/navbar.md
  • docs/docs/api/components/pagination.md
  • docs/docs/api/components/panel.md
  • docs/docs/api/components/sidebar.md
  • docs/docs/api/components/steps.md
  • docs/docs/api/components/tabs.md
  • docs/docs/api/elements/figure.md
  • docs/docs/api/layout/hero.md
  • docs/docs/api/layout/level.md
  • docs/docs/api/layout/media.md

Comment thread bulma-ui/src/components/__tests__/Card.test.tsx
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://013b6654.bestax.pages.dev

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://4fd68ca0.bestax.pages.dev

@allxsmith

Copy link
Copy Markdown
Owner Author

@claude please perform a deep review of this PR — compound component parity (identity tests, CompoundUsage stories, live docs sections) across the 17 pre-existing compound families, per #330. Pay particular attention to: (1) whether every family's identity tests actually cover all statics attached via withSubComponents, including nested ones; (2) consistency of the docs sections' placement and wording; (3) anything that contradicts the standard newly codified in bulma-ui/CLAUDE.md.

@claude

claude Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Claude finished @allxsmith's task in 4m 59s —— View job


Deep review complete

  • Gather context (PR diff, CLAUDE.md standard, changed files)
  • Check identity-test coverage of every withSubComponents static per family, incl. nested
  • Check consistency of docs section placement/wording across all files
  • Check for contradictions with the newly-codified standard in bulma-ui/CLAUDE.md
  • Post findings

I split the 17 pre-existing families across four parallel sub-reviews and independently spot-checked the nested/hardest cases (Card, Modal, Field) myself. Summary below, organized per your three focus areas.

1. Identity-test coverage of every withSubComponents static, including nested

All 17 families check out — I could not find a single static, at any nesting depth, missing an identity assertion:

  • Simple families (Panel: 7 statics, Pagination: 5, Navbar: 10, Media: 3, Level: 3, Hero: 3, Menu: 3, Dropdown: 2, Steps: 1) — every static has expect(Parent.X).toBe(X) since all are named-exported.
  • Module-private families (Figure.Caption, Sidebar's 5 statics, Card's 7, Modal's 8, Message's 2) — correctly use toBeDefined() + a dot-path render test asserting Bulma class output, per the standard's alternate rule for subs with no separate named export.
  • Nested statics, the sharpest edge case — verified present and correct:
    • Tabs.Content.Item → expect(Tabs.Content.Item).toBe(TabContentItem) (Tabs.test.tsx:824), and the CompoundUsage story/docs example both demonstrate the nested path (Tabs.stories.tsx:608-625, tabs.md:432-443).
    • Card.Header.Title / Card.Header.Icon → both toBeDefined() (Card.test.tsx:392-393) with dedicated class-asserting render tests elsewhere in the file (:440, :556-565).
    • Modal.Card.Head/.Title/.Body/.Foot → all four toBeDefined() (Modal.test.tsx:180-183) plus a single dot-path render asserting all four Bulma classes at once (:187-207).
  • describe('Compound components') casing is consistent everywhere, including Card/Modal/Message after 259fbdb normalized it.
  • One structural nit: Avatars's identity assertion (expect(Avatars.Avatar).toBe(Avatar), Avatars.test.tsx:167) is a bare it() inside describe('Avatars', ...), not wrapped in its own describe('Compound components') block like all 17 other families. Substantively correct, just not structurally uniform — low priority since the PR explicitly left Avatars untouched, verifying it as "already complete."

2. Consistency of docs sections' placement and wording

All 11 newly-added ### Compound (dot-notation) usage sections (dropdown, menu, navbar, pagination, panel, sidebar, tabs, figure, hero, level, media) use byte-identical heading wording and are placed as the last item under ## Usage, immediately before the next ## heading — ## Accessibility in ten cases, and ## Close Methods for sidebar.md (still structurally correct: last thing in ## Usage, the next heading just happens to be a different one for that page). I verified this by scanning every changed doc's heading outline directly. No placement or wording drift across the new pages.

3. Contradictions with the standard newly codified in bulma-ui/CLAUDE.md

One real gap, worth flagging even though it's out of this PR's stated scope. The standard now says every compound family ships a CompoundUsage story and a ### Compound (dot-notation) usage section at the end of ## Usage. Four families don't conform to that exact shape, and this PR (correctly, per its own description) didn't touch them since it only added identity tests for Card/Modal/Message and verified Avatars "already complete":

  • card.md / message.md: use a standalone ## Compound Components H2 (with per-prop-table sub-sections) + ### Compound Component Examples, not ### Compound (dot-notation) usage under ## Usage.
  • modal.md: ### Compound Components (H3, appears before ## Usage, next to Props) + ### Compound Components API (mid-## Usage, not at the end).
  • avatars.md: ### Compound Static — correctly placed at the end of ## Usage, but different wording than the codified heading.
  • Stories similarly diverge: Card.stories.tsx → CompoundComponents/CompoundComponentsMinimal, Modal.stories.tsx → CompoundModalCard/CompoundModalContent, Message.stories.tsx → CompoundComponents/CompoundMinimal/CompoundHeaderOnly, Avatars.stories.tsx → CompoundStatic — none named CompoundUsage.

None of this is a defect introduced by this PR — it predates it, and the PR body is accurate that these families' docs/stories "already existed" and needed no new artifacts, only identity tests. But now that bulma-ui/CLAUDE.md states the standard in exact terms (heading text, story name, placement), these four pages read as non-conformant against the doc a future contributor or AI agent will treat as ground truth. Worth a small follow-up PR to either reconcile the wording, or add a note that Card/Modal/Message/Avatars predate the convention and are intentionally exempt.

Separately, minor and unrelated to the compound work: .claude/launch.json (commit faabd77) is bundled into this PR but is tooling config, not test/story/docs content — harmless, just out of the PR's stated scope.

Other checks

  • Dropdown's static active-prop CompoundUsage story genuinely renders the dropdown open (verified useState(!!activeProp) seeds true), not a no-op declaration.
  • Sidebar's useState/isOpen story genuinely toggles via a real button, not static.
  • Steps reuses its pre-existing CompoundComponents story name rather than adding a duplicate CompoundUsage — intentional per the PR description, but leaves 1 of the 11 "new" stories named differently from the other 10, which are all CompoundUsage. Minor, not a defect.

Verdict: No missing identity-test coverage anywhere, including nested statics — the two things I most expected to find gaps in (Tabs.Content.Item and Modal.Card.*) are both solid. Docs placement/wording is fully consistent across everything this PR touched. The only real "contradicts the new standard" finding is pre-existing and out of scope (Card/Modal/Message/Avatars docs/story naming), flagged above for a possible follow-up rather than as a blocker.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep review — 0 findings

# Severity Area Finding Location
— — — No blocking defects found. —

Overall: This is a purely additive parity PR — identity/dot-path tests, CompoundUsage stories, and ### Compound (dot-notation) usage docs sections across 17 pre-existing compound families, plus a codified standard in the two CLAUDE.md files. No runtime code changed. I verified that every named export the .toBe identity tests reference actually exists (NavbarBrand, PaginationLink, PanelHeading, TabList/TabsContent/TabContentItem, FieldLabel/FieldBody, Hero*/Level*/Media*, MenuLabel, DropdownItem/DropdownDivider, …), that Tabs.Content.Item resolves through the nested static, and that every component used in the docs live blocks (Paragraph, SubTitle, Container, Image, Content, useState, …) is in the react-live scope (...BestaxBulma + React/useState/useEffect). I ran all 86 new Compound tests across the 16 touched suites — all green. The riskiest surface here is the docs live examples (they don't run in jsdom), but each one only composes in-scope exports with valid props, so nothing will throw at render time. Human focus, if any: confirm the .claude/launch.json chore commit belongs in this PR rather than a separate one.

🏄 Pure paddle-out parity, dude — no runtime waves, just tests, stories and docs all lining up clean and the whole set passes. Ship it and enjoy the glassy conditions.

@allxsmith

Copy link
Copy Markdown
Owner Author

Deep-review findings dispositioned:

No changes needed for the coverage/placement sections — review confirmed both clean.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://2a089d7b.bestax.pages.dev

@allxsmith
allxsmith merged commit 831e709 into main Jul 21, 2026
9 of 10 checks passed
@allxsmith
allxsmith deleted the claude/issue-330-compound-parity branch July 21, 2026 00:37
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

allxsmith added a commit that referenced this pull request Jul 22, 2026
… the codified standard

Card/Modal/Message/Avatars/Steps predate the compound-family convention
codified in bulma-ui/CLAUDE.md (PR #336). Rename their primary compound
stories to CompoundUsage and retitle/relocate the docs sections to
"### Compound (dot-notation) usage" at the end of each page's Usage
section; per-static prop docs move under Props as "Compound component
props". No content dropped — the standard is a minimum, not a ceiling.

Adds a compound-family conformance sub-check (withSubComponents call
sites → CompoundUsage story + docs subsection, position-checked) so the
standard is mechanically enforced from now on; all 27 families pass with
zero exemptions.

Closes #339

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

allxsmith added a commit that referenced this pull request Jul 22, 2026
… the codified standard (#351)

Card/Modal/Message/Avatars/Steps predate the compound-family convention
codified in bulma-ui/CLAUDE.md (PR #336). Rename their primary compound
stories to CompoundUsage and retitle/relocate the docs sections to
"### Compound (dot-notation) usage" at the end of each page's Usage
section; per-static prop docs move under Props as "Compound component
props". No content dropped — the standard is a minimum, not a ceiling.

Adds a compound-family conformance sub-check (withSubComponents call
sites → CompoundUsage story + docs subsection, position-checked) so the
standard is mechanically enforced from now on; all 27 families pass with
zero exemptions.

Closes #339

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compound component parity: identity tests, CompoundUsage stories, and live docs sections for pre-existing compound families

1 participant