Docs: Standardize Interactions/play function naming consistency#35034
Docs: Standardize Interactions/play function naming consistency#35034AliMahmoudDev wants to merge 8 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughDocumentation updates clarify play function behavior and standardize interactions panel capitalization across Storybook docs. Three files align the UI component name casing, and actions documentation adds guidance discouraging automatic argument inference in favor of explicit fn-based args. ChangesPlay Function and Actions Documentation
Possibly related PRs
🎯 1 (Trivial) | ⏱️ ~2 minutes 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. Comment |
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 `@docs/api/doc-blocks/doc-block-story.mdx`:
- Line 59: Change the grammatically incorrect phrase "play function can perform
arbitrary actions" to the plural form "play functions can perform arbitrary
actions" in the sentence that begins "Because all stories render
simultaneously..." so it correctly refers to multiple stories' play functions.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 22a88110-eb94-4861-a4bf-5ab3c7339aa2
📒 Files selected for processing (5)
docs/api/doc-blocks/doc-block-story.mdxdocs/configure/user-interface/features-and-behavior.mdxdocs/essentials/actions.mdxdocs/writing-stories/index.mdxdocs/writing-stories/play-function.mdx
This comment was marked as abuse.
This comment was marked as abuse.
| Another option is to use a global parameter to match all [argTypes](../api/arg-types.mdx) that match a certain pattern. The following configuration automatically creates actions for each `on` argType (which you can either specify manually or can be [inferred automatically](../api/arg-types.mdx#automatic-argtype-inference)). | ||
|
|
||
| This is quite useful when your component has dozens (or hundreds) of methods and you do not want to manually apply the `fn` utility for each of those methods. However, **this is not the recommended** way of writing actions. That's because automatically inferred args **are not available as spies in your play function**. If you use `argTypesRegex` and your stories have play functions, you will need to also define args with the `fn` utility to test them in your play function. | ||
| This is quite useful when your component has dozens (or hundreds) of methods and you do not want to manually apply the `fn` utility for each of those methods. However, **this is not the recommended** way of writing actions. That's because automatically inferred args **are not available as spies in your play function**. If you use `argTypesRegex` and your stories each have a play function, you will need to also define args with the `fn` utility to test them in your play function. |
There was a problem hiding this comment.
We should drop the each here. What the doc wants to say is that when there is a play function, fn is needed.
With each, it feels like we're telling users that fn is needed when each (every) story has a play function.
| This is quite useful when your component has dozens (or hundreds) of methods and you do not want to manually apply the `fn` utility for each of those methods. However, **this is not the recommended** way of writing actions. That's because automatically inferred args **are not available as spies in your play function**. If you use `argTypesRegex` and your stories each have a play function, you will need to also define args with the `fn` utility to test them in your play function. | |
| This is quite useful when your component has dozens (or hundreds) of methods and you do not want to manually apply the `fn` utility for each of those methods. However, **this is not the recommended** way of writing actions. That's because automatically inferred args **are not available as spies in your play function**. If you use `argTypesRegex` and your stories have a play function, you will need to also define args with the `fn` utility to test them in your play function. |
|
@jonniebigodes leaving this one to you! We would need to instruct @AliMahmoudDev whether we want capitalization everywhere or nowhere. @AliMahmoudDev we have other similar issues with e.g. Controls panel or Actions panel, but, before anything can be fixed, we need to wait for @jonniebigodes to tell us which capitalization we want to enforce. I'm not sure if we want to add or remove uppercase everywhere, so let's wait for the doc owner to tell us :) |
Summary
Fixes #19640
What changed
Standardizes the naming convention across documentation:
Files changed
docs/writing-stories/play-function.mdx— CapitalizedInteractions panelin markdown link textdocs/essentials/actions.mdx— Standardized to singularplay functionwith correct grammardocs/api/doc-blocks/doc-block-story.mdx— Standardized to pluralplay functionswhere referring to multiple storiesdocs/writing-stories/index.mdx— CapitalizedInteractions panelin markdown link textdocs/configure/user-interface/features-and-behavior.mdx— CapitalizedInteractions panelin markdown link textWhy
The docs were using both terms inconsistently: some places said "interactions panel" (lowercase), others "Interactions panel" (capitalized). Similarly, "play function" and "play functions" were used interchangeably. This PR aligns all docs with the actual UI terminology.
Manual testing
Summary by CodeRabbit