Skip to content

Docs: Standardize Interactions/play function naming consistency#35034

Closed
AliMahmoudDev wants to merge 8 commits into
storybookjs:nextfrom
AliMahmoudDev:docs/fix-interactions-naming
Closed

Docs: Standardize Interactions/play function naming consistency#35034
AliMahmoudDev wants to merge 8 commits into
storybookjs:nextfrom
AliMahmoudDev:docs/fix-interactions-naming

Conversation

@AliMahmoudDev

@AliMahmoudDev AliMahmoudDev commented Jun 3, 2026

Copy link
Copy Markdown

Summary

Fixes #19640

What changed

Standardizes the naming convention across documentation:

  • "Interactions panel" (capitalized) — for the UI debugging panel, matching the actual panel label
  • "interaction tests" (lowercase) — for the testing methodology
  • "play function" (singular) — for the Storybook CSF API

Files changed

  1. docs/writing-stories/play-function.mdx — Capitalized Interactions panel in markdown link text
  2. docs/essentials/actions.mdx — Standardized to singular play function with correct grammar
  3. docs/api/doc-blocks/doc-block-story.mdx — Standardized to plural play functions where referring to multiple stories
  4. docs/writing-stories/index.mdx — Capitalized Interactions panel in markdown link text
  5. docs/configure/user-interface/features-and-behavior.mdx — Capitalized Interactions panel in markdown link text

Why

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

  • Verified all markdown links still resolve correctly
  • Checked that no heading titles were inadvertently changed
  • Confirmed terminology is consistent across all modified files

Summary by CodeRabbit

  • Documentation
    • Updated terminology capitalization for consistency across guides.
    • Expanded guidance on automatic argument matching with additional notes on limitations and recommended approaches for testing.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7ba64c9-b281-4ad0-aca9-8dd98bafd5cb

📥 Commits

Reviewing files that changed from the base of the PR and between 98e36a5 and 31bd19e.

📒 Files selected for processing (1)
  • docs/essentials/actions.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/essentials/actions.mdx

📝 Walkthrough

Walkthrough

Documentation 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.

Changes

Play Function and Actions Documentation

Layer / File(s) Summary
Interactions panel capitalization consistency
docs/configure/user-interface/features-and-behavior.mdx, docs/writing-stories/index.mdx, docs/writing-stories/play-function.mdx
"interactions panel" → "Interactions panel" updated across three documentation files to align UI component naming conventions.
Play function and actions documentation refinements
docs/essentials/actions.mdx
Expanded guidance notes that automatically inferred action args via argTypesRegex are not recommended because they won't work as spies in play functions; fn-based args are required instead.

Possibly related PRs

  • storybookjs/storybook#34654: Both PRs update docs/essentials/actions.mdx to adjust guidance around fn/argument handling and how it appears as spies in the interactions panel.

🎯 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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 `@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

📥 Commits

Reviewing files that changed from the base of the PR and between c91f986 and 6f6a230.

📒 Files selected for processing (5)
  • docs/api/doc-blocks/doc-block-story.mdx
  • docs/configure/user-interface/features-and-behavior.mdx
  • docs/essentials/actions.mdx
  • docs/writing-stories/index.mdx
  • docs/writing-stories/play-function.mdx

Comment thread docs/api/doc-blocks/doc-block-story.mdx Outdated
@AliMahmoudDev

This comment was marked as abuse.

Comment thread docs/essentials/actions.mdx Outdated
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.

@Sidnioulz Sidnioulz Jun 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Suggested change
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.

@Sidnioulz Sidnioulz added ci:docs Run the CI jobs for documentation checks only. qa:skip Pull Requests that do not need any QA. labels Jun 4, 2026
@Sidnioulz

Copy link
Copy Markdown
Contributor

@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 :)

@AliMahmoudDev

This comment was marked as abuse.

@AliMahmoudDev

This comment was marked as abuse.

@Sidnioulz Sidnioulz closed this Jun 8, 2026
@github-project-automation github-project-automation Bot moved this from Empathy Queue (prioritized) to Done in Core Team Projects Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:automated ci:docs Run the CI jobs for documentation checks only. documentation qa:skip Pull Requests that do not need any QA.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Naming]: 'Interactions' or 'play functions'

4 participants