Repository navigation
Manifests: Add a warning field to story entries - #35794
Merged
Merged
Conversation
A generated snippet can be a valid but incomplete example, when something in the story could not be read statically. There was nowhere to say so, so the only option was a comment inside the snippet, which every consumer then had to render or strip. `StoryDoc.warning` carries that as data instead. A story with a warning still has a snippet; `error` continues to mean there is none.
Contributor
valentinpalkovic
marked this pull request as ready for review
August 7, 2026 11:10
3 of 9 tasks
Contributor
WalkthroughThe StoryDoc contract now supports optional warnings for incomplete snippets. Manifest merge coverage verifies that warnings remain with story metadata. ChangesStory warning metadata
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
Comment |
Contributor
There was a problem hiding this comment.
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 `@code/core/src/shared/open-service/services/story-docs/definition.ts`:
- Line 21: Update the StoryDoc Valibot schema in definition.ts and the StoryDoc
type in types.ts to represent mutually exclusive valid states: a warning is
allowed only when snippet is present, and warning must not coexist with error.
Preserve the existing valid states and enforce these constraints consistently at
both validation and type levels.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be45e492-7dc6-4243-b3f0-2ebf3b04f2f0
📒 Files selected for processing (3)
code/core/src/core-server/utils/manifests/components-ref-manifest.test.tscode/core/src/shared/open-service/services/story-docs/definition.tscode/core/src/shared/open-service/services/story-docs/types.ts
3 of 9 tasks
JReinhold
approved these changes
Aug 7, 2026
2 tasks done
3 of 9 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
A generated story snippet can be valid but incomplete. Server-side snippet generation reads the story file rather than running it, so an arg merged in through a spread, or a template held in a variable, simply cannot be resolved. The snippet that comes out is still useful, it is just missing something.
There was nowhere to say that. The only option was to write it into the snippet itself:
Which pushes the problem onto every consumer. The docs Source block renders it as a stray comment, an agent reading
components.jsonhas to know to parse it back out, and a non-HTML renderer has no comment syntax to hide it in.This adds a
warningto each story entry, so the caveat travels as data next to the snippet:{ "id": "button--primary", "name": "Primary", - "snippet": "<!-- unresolved: ...sharedArgs -->\n<sb-button [label]=\"'meta'\" [count]=\"1\"></sb-button>" + "snippet": "<sb-button [label]=\"'meta'\" [count]=\"1\"></sb-button>", + "warning": "Incomplete snippet: `...sharedArgs` could not be resolved statically." }The whole change is the field on
StoryDocand the matching entry in the valibot schema:The distinction from
erroris the part worth agreeing on: a story with awarningstill has asnippet, a story with anerrordoes not. One says "here is an example, mind the gap", the other says "there is no example".Nothing populates it yet. The Angular server-side snippet generator is the first producer and is stacked on top of this. Reviewing the format on its own seemed better than reviewing it buried in a framework PR.
No change is needed for it to reach
manifests/components.json, because the manifest passes thestoriesmap straight through. There is a test for exactly that, so a future refactor of the merge cannot silently drop the field:yarn vitest run code/core/src/core-server/utils/manifestsChecklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
No user-visible behaviour changes on its own: the field is additive and optional, and nothing writes it yet. The first producer is the stacked Angular PR, where it is reachable from the Docs Source block and from
components.json.Documentation
The docgen server RFC documents the payload shapes while they are experimental; this field should land there once a producer ships.
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.