Skip to content

docs(combobox): restore Storybook coverage lost in TS rewrite - #3221

Merged
interactivellama merged 4 commits into
masterfrom
chore/3213-combobox-storybook-parity
Oct 1, 2026
Merged

interactivellama merged 4 commits into
masterfrom
chore/3213-combobox-storybook-parity

Conversation

@showerbee

@showerbee showerbee commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to the feedback on #3213 (#3213 (comment)): the React 19/TypeScript rewrite (#3195) replaced storybook-stories.jsx with Combobox.stories.tsx, but several stories documenting already-supported props/variants were not carried over. This PR restores that coverage — no component code changes, docs/Storybook only.

New stories added:

  • Base variant: WithInlineHelpTooltip, WithMenuSeparator, WithInheritedMenuWidth, WithScrollableMenu, WithCustomInputComponent
  • Inline-listbox variant: SearchAndAddEntities, ControlledOpenState, InlineMultipleLoading
  • Readonly variant: ReadonlyWithDisabledOption, ReadonlyMultipleWithDeselect, ReadonlyWithCustomMenuItem
  • Popover (dialog) variant: PopoverVariant
  • Disabled options: WithDisabledOptionTooltip, WithCustomMenuItemDisabledOption

Pure selection-state permutations of an already-covered prop combo (e.g. picking a different option in a story that already demonstrates that variant) were intentionally skipped rather than restoring all ~34 original stories 1:1, since each story here uses a custom render closure rather than args, so exercising a different selection just means interacting with the running story directly.

Also fixed while in here: BaseWithMenuSubheader and 8 other stories were missing onRequestRemoveSelectedOption in their events, so the pill's remove (X) button was a dead click — pre-existing on master, unrelated to the new stories.

Test plan

  • eslint passes on the modified file (0 errors; one pre-existing unrelated warning)
  • vitest run components/combobox components/pill components/pill-container components/__tests__/story-snapshots.test.jsx — 511 passed, including 14 new HTML snapshots for the added stories (no existing snapshots changed)
  • Verified via Storybook dev server that all stories are discovered and the module transforms without errors
  • No combobox.tsx/menu.tsx changes — confirmed all new stories exercise already-supported props
  • Merged latest master (which landed fix(combobox): restore selected-pill focus & multi-selection semantics (#3211) #3213's pill-focus/multi-selection fix) to resolve the conflict in Combobox.stories.tsx

The React 19/TS rewrite (#3195) replaced storybook-stories.jsx with
Combobox.stories.tsx but dropped coverage for several already-supported
props/variants: field-level help tooltip, menu separators, inherited menu
width, scrollable menu, custom input, search/add-entity items, controlled
open state, async loading, popover (dialog) variant, per-option disabled
tooltips, and readonly-variant disabled options/deselect/custom item
rendering. No component code changes are needed — this only restores
Storybook documentation parity per the gap flagged in review.
…ng it

Several stories rendered a removable selection pill but never handled
its remove event, so clicking the pill's X did nothing. Pre-existing
on master, not introduced by the new stories added in this PR.
@interactivellama

Copy link
Copy Markdown
Contributor

@showerbee Merge conflict is present.

As an aside, unlike SLDS blueprints, the purpose of Storybook stories in this codebase is not purely demo but also as a testing environment for HTML snapshot test generation–to know what changes in the DOM render when code changes are made.

You mention stories having controls in the description above. Most of the stories in this Storybook do not have controls.

…-storybook-parity

# Conflicts:
#	components/combobox/__docs__/Combobox.stories.tsx
The story-snapshot suite auto-discovers every story via composeStories,
so the 14 stories added in this PR need their own committed snapshots.
No existing snapshots changed.
@showerbee

Copy link
Copy Markdown
Collaborator Author

@interactivellama thanks — both points fixed:

  • Merge conflict: resolved. Merged latest `master` (which landed fix(combobox): restore selected-pill focus & multi-selection semantics (#3211) #3213's pill-focus/multi-selection fix) — the only conflict was a formatting-only overlap in `BaseWithMenuSubheader`'s `onRequestRemoveSelectedOption` handler, now resolved.
  • Snapshot testing: you're right, and I'd missed that `components/tests/story-snapshots.test.jsx` auto-discovers every story via `composeStories` and diffs its rendered HTML. Ran it and committed the 14 new snapshots for the stories added here — no existing snapshots changed.
  • Controls: also correct — I mis-stated that in the description. None of these stories use `args`/`argTypes` (they're all custom `render` closures with local `useState`), so there's no Controls panel data at all. I've corrected the PR description to describe why some selection-state permutations were skipped without invoking "controls."

While resolving the conflict I also found (and fixed) that `BaseWithMenuSubheader` and 8 other pre-existing stories were missing `onRequestRemoveSelectedOption`, so clicking a pill's remove (X) button did nothing — unrelated to the new stories, but in the same file, so fixed it here.

@interactivellama
interactivellama merged commit a675f1a into master Oct 1, 2026
9 checks passed
@interactivellama
interactivellama deleted the chore/3213-combobox-storybook-parity branch October 1, 2026 23:30
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.

2 participants