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

Addon-controls: Dont show "setup controls" if control is disabled or a function #26120

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

kasperpeulen
Copy link
Contributor

Closes #24475

What I did

Dont show "setup controls" if control is disabled or a function

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make 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.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Copy link
Contributor

@cdedreuille cdedreuille left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for taking this one.

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

Why was control.disable removed?

Also, why would users not want to see that their components have args which are functions? If that looks ugly, you could just change the content to something else like a static "function" text or something, but not really remove it right? Else this can be confusing for users, especially people who build component libraries and want to document their components properly.

@@ -65,7 +65,7 @@ export const ArgControl: FC<ArgControlProps> = ({ row, arg, updateArgs, isHovere
const onBlur = useCallback(() => setFocused(false), []);
const onFocus = useCallback(() => setFocused(true), []);

if (!control || control.disable)
if (!control && row.type?.name !== 'function')
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a test for this?

@kasperpeulen
Copy link
Contributor Author

@yannbf @shilman Sorry should have made this a draft, it is now in reviewable state!

The goal of this PR is to not anymore show "Setup controls" on hover, if the control is disabled or a function.

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

Looks good to me, please add a test if you can (e2e, integration, whatever works)

@kasperpeulen kasperpeulen added this to the 8.0-RC milestone Feb 22, 2024
@kasperpeulen kasperpeulen merged commit d103115 into next Feb 22, 2024
56 of 58 checks passed
@kasperpeulen kasperpeulen deleted the kasper/fn-control-ui branch February 22, 2024 10:50
@github-actions github-actions bot mentioned this pull request Feb 22, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

[Bug]: "Setup controls >" URL cannot be disabled
4 participants