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

Refactor Select documentation to no longer mention SelectNext #1620

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Jul 17, 2024

This PR follows-up on #1619

This PR replaces the /input-select-next documentation page with /input-select, which has very similar content and examples, but always using Select and MultiSelect and no longer mentioning SelectNext.

Additionally, it deprecates SelectNext, and recommends using one of the other two components as drop-in replacements.

Technically speaking, two breaking changes are introduced here:

  • The /input-select-next URL will no longer work. I guess we could potentially make it redirect to /input-select if we think this is a big problem.
  • The Option component's displayName has changed from 'SelectNext.Option' to 'Select.Option', which could make some test break, but I already have branches almost ready to transition away from SelectNext anyway, so it shouldn't be a big problem.
    • EDIT: I can confirm no tests break here, because we were finding options via Select.Option function reference, rather than via its display name.

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.90%. Comparing base (73dfdf2) to head (acf7bea).

Additional details and impacted files
@@             Coverage Diff             @@
##              main    #1620      +/-   ##
===========================================
- Coverage   100.00%   99.90%   -0.10%     
===========================================
  Files           62       62              
  Lines         1071     1071              
  Branches       410      410              
===========================================
- Hits          1071     1070       -1     
- Misses           0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -489,7 +497,7 @@ export const Select = Object.assign(
// Calling the function directly instead of returning a JSX element, to
// avoid an unnecessary extra layer in the component tree
// eslint-disable-next-line new-cap
return SelectNext({ ...props, multiple: false });
return SelectMain({ ...props, multiple: false });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can save one step here by directly calling SelectMain, which is going to be kept as the internal component long-term.

@acelaya acelaya marked this pull request as ready for review July 17, 2024 12:38
@acelaya
Copy link
Contributor Author

acelaya commented Jul 17, 2024

Codecov is reporting a drop in code coverage, but I think it's a false positive. Locally, it reports a coverage of 100%, and if you go to codecov's report, there's no line highlighted as uncovered.

@@ -196,10 +196,10 @@ const routes: PlaygroundRoute[] = [
route: '/input-option-button',
},
{
title: 'SelectNext',
title: 'Selects',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
title: 'Selects',
title: 'Select',

All the other menu items are named after the main component on that page, so I think we should do the same here.

Copy link
Contributor Author

@acelaya acelaya Jul 17, 2024

Choose a reason for hiding this comment

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

I used the plural form because that's what we do for Dialog and ModalDialog elements. The page's title is Dialogs and then there are two sub-sections for them.

image

@acelaya acelaya merged commit c1aba0c into main Jul 17, 2024
2 checks passed
@acelaya acelaya deleted the select-docs-refactor branch July 17, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants