Problem/Motivation

Fifteen stories pass argument values their own *.component.yml schema rejects, so SDC validation throws and the story renders an empty wrapper. Found by measuring rendered content rather than HTTP status: these all return HTTP 200 with nothing inside. Verified against 1.0.x at commit 6e974b0.

  • date declared format: date, given an empty string. An empty string is not a valid date. Affects byline (Default, Linked Author) and article-teaser (With Image, Text Only, Featured). The schemas also carry default: '' on that same format: date prop, so the default is itself invalid against its own format, and any consumer omitting a date hits the same throw.
  • color given an empty string against an enum with no empty member: all five accordion-container stories. That prop is documented as optional ("Omit to use the default design"), so the empty string should simply not be passed.
  • icon_size given '2' and '1.25' on bootstrap-icon. The enum is fs-1 through fs-6; raw rem numbers are not members.
  • icon given 'download' on button, twice. There is no download member in that 51-value enum.
  • button_variant given 'btn-outline-light' on hero-slide. The enum is btn-primary, btn-secondary, btn-light, btn-dark. This one was already corrected upstream as part of issue 3627179.

Steps to reproduce

  1. Open Storybook and select, for example, Byline, Default.
  2. The story endpoint answers 200 and the preview shows an empty wrapper with no byline markup.
  3. The SDC validation error names the invalid date value.

Proposed resolution

Give the dates a real value, drop the empty color args, map icon_size to fs-2 and fs-5, and use arrow-down for the button icon. After the fix, a full sweep of all 398 stories measuring rendered content drops the empty count from 28 to 18.

The invalid default: '' on the format: date props is worth fixing in the schema separately, since that changes the Canvas component version hash.

What the remaining 18 are, so nobody re-finds them: thirteen are components whose SDC slot content never reaches the render endpoint (card-slider, hero-slider-container, live-feed, accordion-container, section, all of which declare slots). The rest are carousel, pagination, card-pricing, page-title, input and live-feed-item, whose cause is not yet traced. One more, share "Vertical centered (no alignment)", passes an empty alignment against the enum start, end; there is no way to express "no alignment" through that prop, so it needs a component decision rather than a story fix.

A merge request will follow.

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • Fifteen Storybook stories render their component instead of an empty wrapper.

API changes

  • N/A for the story fix. Correcting the invalid default: '' on the format: date props would change the Canvas component version hash, so it is proposed as separate work.

Data model changes

  • N/A

Release notes snippet

  • Fixed fifteen stories whose args failed their component schema and rendered nothing.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Title: Story args violate their components own schemas, so fifteen stories render nothing » Story args violate their components’ own schemas, so fifteen stories render nothing

rajab natshah’s picture

Status: Active » Needs review

  • rajab natshah committed a37c35b2 on 1.0.x
    fix: #3627276 Make story args satisfy their components' schemas
    
rajab natshah’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.