Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Since v7.2.0: Actions tab doesn't show count anymore + console error #23741

Closed
Spielboerg opened this issue Aug 7, 2023 · 5 comments · Fixed by #23804
Closed

[Bug]: Since v7.2.0: Actions tab doesn't show count anymore + console error #23741

Spielboerg opened this issue Aug 7, 2023 · 5 comments · Fixed by #23804

Comments

@Spielboerg
Copy link
Contributor

Describe the bug

After updating to v7.2 the number of actions is not shown in the tab anymore (top: v7.1, bottom: v7.2):

Bildschirmfoto 2023-08-07 um 10 27 29

Also, the console is flooded with errors (1 per event/action):

Bildschirmfoto 2023-08-07 um 11 35 24

The error is happening in this Storybook component:

function Title() {
  let[{count},setCount] = useAddonState(ADDON_ID, {
    count: 0
  });
  return useChannel({
    [EVENT_ID]: ()=>{
      setCount(c=>({
        ...c,
        count: c.count + 1          // ← c is undefined
      }));
    }
    ,
    [STORY_CHANGED]: ()=>{
      setCount(c=>({
        ...c,
        count: 0
      }));
    }
    ,
    [CLEAR_ID]: ()=>{
      setCount(c=>({
        ...c,
        count: 0
      }));
    }
  }),
  React.createElement("div", null, React.createElement(Spaced, {
    col: 1
  }, React.createElement("span", {
    style: {
      display: "inline-block",
      verticalAlign: "middle"
    }
  }, "Actions"), count === 0 ? "" : React.createElement(Badge, {
    status: "neutral"
  }, count)))
}

To Reproduce

Unfortunately, I can't reproduce the problem in the provided stackblitz. But since it works in v7.1 without having changed anything and it is related to a component of Storybook, I hope you can fix it.

System

Environment Info:

  System:
    OS: macOS 13.5
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.20.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.4 - /usr/local/bin/npm
  Browsers:
    Google Chrome: 115.0.5790.170
    Safari: 16.6
  npmPackages:
    @storybook/addon-docs: 7.2.1 => 7.2.1 
    @storybook/addon-essentials: 7.2.1 => 7.2.1 
    @storybook/addon-links: 7.2.1 => 7.2.1 
    @storybook/addons: 7.2.1 => 7.2.1 
    @storybook/components: 7.2.1 => 7.2.1 
    @storybook/manager-api: 7.2.1 => 7.2.1 
    @storybook/preset-create-react-app: 7.2.1 => 7.2.1 
    @storybook/react: 7.2.1 => 7.2.1 
    @storybook/react-webpack5: 7.2.1 => 7.2.1 
    @storybook/testing-library: ^0.2.0 => 0.2.0 
    @storybook/theming: 7.2.1 => 7.2.1

Additional context

No response

@burdeasa
Copy link

burdeasa commented Aug 7, 2023

I'm seeing this as well, also started with upgrade to Storybook 7.2. I independently came to the same conclusion as @Spielboerg .

@liu351
Copy link

liu351 commented Aug 22, 2023

I see this as well in 7.3.1. If I click away to a different story and back to my other story, then the counter works again...

@github-project-automation github-project-automation bot moved this from Empathy Backlog to Done in Core Team Projects Aug 23, 2023
@altrae
Copy link

altrae commented Aug 29, 2023

I'm on 7.4.0 now and still seeing what @liu351 is seeing.

@Spielboerg
Copy link
Contributor Author

It works fine again for me on 7.4.0

@liu351
Copy link

liu351 commented Aug 30, 2023

I'm on 7.4.0 now and still seeing what @liu351 is seeing.

Yep same as well, after updating to 7.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants