Skip to content

refactor: [M3-6522] - Toggle component v7 story migration and cleanup#9905

Merged
coliu-akamai merged 7 commits intolinode:developfrom
coliu-akamai:toggle-mdx
Nov 15, 2023
Merged

refactor: [M3-6522] - Toggle component v7 story migration and cleanup#9905
coliu-akamai merged 7 commits intolinode:developfrom
coliu-akamai:toggle-mdx

Conversation

@coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Nov 14, 2023

Description 📝

Small PR to migrate Toggle component story to a V7 (.tsx) story!

Changes 🔄

List any change relevant to the reviewer.

  • New v7 .tsx story to replace the .mdx one
  • Import/export cleanup + eslint fixes on files I visited

How to test 🧪

Prerequisites

  • pull code locally
  • run yarn && yarn storybook

Verification steps

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@coliu-akamai coliu-akamai self-assigned this Nov 14, 2023
Copy link
Member

Choose a reason for hiding this comment

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

We could move packages/manager/src/components/Toggle/Toggle.tsx to packages/manager/src/components/Toggle.tsx to simplify things a bit, but this is optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👀 In general is there a rule of thumb for the min. amount of files that should be in a package for organization? There're currently three toggle related files - the tests, story, and toggle component itself - in the package. Would it be too much clutter if I got rid of the Toggle package?

Copy link
Member

Choose a reason for hiding this comment

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

I personally don't mind if the src/components folder is massive but it's definitely fair to keep the src/components/Toggle folder around if there is a few files

Copy link
Contributor

Choose a reason for hiding this comment

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

I like it in its own directory - makes it easier at a glance to see how things are organized and if for example a component is missing a test, a story etc. It's a bit more portable too, even if that does not matter now. Has the drawback of the import being longer but not a big deal.

@coliu-akamai coliu-akamai marked this pull request as ready for review November 14, 2023 20:19
@coliu-akamai coliu-akamai requested a review from a team as a code owner November 14, 2023 20:19
@coliu-akamai coliu-akamai requested review from carrillo-erik and mjac0bs and removed request for a team November 14, 2023 20:19
Copy link
Contributor

@abailly-akamai abailly-akamai 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! Approving pending adding args to the story

  • story and self documentation looks great ✅
  • tests ✅
  • no visual regression or missing import ✅

Copy link
Contributor

Choose a reason for hiding this comment

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

I like it in its own directory - makes it easier at a glance to see how things are organized and if for example a component is missing a test, a story etc. It's a bit more portable too, even if that does not matter now. Has the drawback of the import being longer but not a big deal.


const meta: Meta<ToggleProps> = {
component: Toggle,
title: 'Components/Toggle',
Copy link
Contributor

Choose a reason for hiding this comment

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

define your args with defaults here so we can interact with the component directly in the storybook docs. doesn't have to be all the props, but at least the ones we'd one to play with when looking at the component

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Aside from Alban's feedback and a couple very minor nitpicks, the story looks good!

Also: latest e2e run looked fine. resize-linode spec failure was not related to these changes.

@mjac0bs mjac0bs added the Approved Multiple approvals and ready to merge! label Nov 15, 2023
coliu-akamai and others added 3 commits November 15, 2023 11:31
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@coliu-akamai coliu-akamai merged commit 9de2dfc into linode:develop Nov 15, 2023
@coliu-akamai coliu-akamai deleted the toggle-mdx branch November 15, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Multiple approvals and ready to merge! Storybook

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants