Skip to content

Count in the Knobs tab is "behind by one" when clicking through stories #21

Open

Description

@kaiyoma

Describe the bug
When clicking through stories, the count (of knobs) in the Knobs tab is wrong. More specifically, it's always "behind by one", meaning that it's showing the count from the previous story that was selected.

To Reproduce
Steps to reproduce the behavior:

  1. Have multiple stories with differing counts of knobs
  2. Click through the stories

Expected behavior
The knob count should be correct.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 14.15.0 - C:\Program Files\Node.js\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.8 - C:\Program Files\Node.js\npm.CMD
  Browsers:
    Chrome: 87.0.4280.88
    Edge: Spartan (44.19041.423.0), Chromium (87.0.664.55)

Activity

  1. shilman commented on Dec 11, 2020

    @shilman
    Contributor

    FYI, we’ve released addon-controls in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term.

    Please upgrade and try them out today!

  2. kaiyoma commented on Dec 14, 2020

    @kaiyoma
    Author

    @shilman I tried out addon-controls today and TBH I don't really like it. They make the story code really verbose and stretched out, and now the args definitions are far removed from the place where the component is being rendered. It's also kind of awkward to have to suppress props from appearing (opt-out) rather than purposefully adding knobs (opt-in). Default values for the controls are also awkward; in fact, I can't figure out how to do it, even after reading all the docs.

    I think I'll be sticking with knobs since the resulting story code is much easier to read, understand, and maintain.

  3. shilman commented on Dec 15, 2020

    @shilman
    Contributor

    @kaiyoma we're aiming to deprecate knobs in 6.2 and remove them in 7.0

  4. kaiyoma commented on Dec 15, 2020

    @kaiyoma
    Author

    I think that's really unfortunate because the knobs API is far superior to controls, at least right now. I would actually consider staying on Storybook 6 indefinitely to avoid moving to controls.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions