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

Introduce custom select component #10991

Merged
merged 4 commits into from
Apr 14, 2022
Merged

Introduce custom select component #10991

merged 4 commits into from
Apr 14, 2022

Conversation

msujew
Copy link
Member

@msujew msujew commented Apr 5, 2022

What it does

Closes #8153

Introduces a custom react component for rendering select elements. It mirrors mostly how a native html select element works and allows for some additional features like element descriptions, details, separators, etc.

Mostly get's used for preference enum rendering, but I've also replaced some other select elements throughout the app.

How to test

In general, test that the component works just like the VSCode select element for enum preferences, launch debug config selection, etc.

  1. Open the preference widget and play around with the different enum preferences. Also try to open preferences which are near the bottom of the app and observe that the dropdown gets inverted.
  2. The component should react as expected when clicking on other elements or scrolling
  3. The debug toolbar also uses the component. Confirm that every option is always rendered on a single line, expanding the dropdown width as necessary.

Review checklist

Reminder for reviewers

@msujew msujew added preferences issues related to preferences ui/ux issues related to user interface / user experience labels Apr 5, 2022
Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

Overall, looking pretty awesome. This is something I've been looking forward to / meaning to do for a while, so I'm really excited to see it!

(PS: everything I say about VSCode's behavior applies in the preference case - I haven't checked the other use cases as thoroughly)

packages/core/src/browser/browser.ts Outdated Show resolved Hide resolved
packages/core/src/browser/style/select-component.css Outdated Show resolved Hide resolved
packages/core/src/browser/widgets/select-component.tsx Outdated Show resolved Hide resolved
packages/core/src/browser/widgets/select-component.tsx Outdated Show resolved Hide resolved
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look really great and are a very nice improvement to the framework 👍

I do not have any feedback for the code itself at the time, I mostly tested the functionality and each dropdown, especially how the changes enhance the UX of the preferences-view and now display enumDescriptions.

The only minor UI improvement I could see at the time is to reduce the separator height, which can be seen with debug configurations dropdown:

Screen Shot 2022-04-07 at 9 44 50 AM

It is debatable however if you believe the thicker border looks better than the behavior we see in vscode.

@msujew
Copy link
Member Author

msujew commented Apr 7, 2022

@vince-fugnitto I think you're right. I reduced the separator thickness to 1px and reduced the margin as well to make everything a bit more compact 👍

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good, and work well for me 👍

@msujew
Copy link
Member Author

msujew commented Apr 13, 2022

@colin-grant-work I would merge this within the next few days. Any other comments from your side?

Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

Looks great. Very nice work @msujew!

@msujew msujew merged commit a26657a into master Apr 14, 2022
@msujew msujew deleted the msujew/select-component branch April 14, 2022 12:33
@github-actions github-actions bot added this to the 1.25.0 milestone Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences ui/ux issues related to user interface / user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have the Default preference settings more visible when selecting a value from the enumeration
3 participants