Skip to content

Replace code paths dropdown with VS Code UI Toolkit#1429

Merged
shati-patel merged 2 commits intomainfrom
shati-patel/path-dropdown
Jul 15, 2022
Merged

Replace code paths dropdown with VS Code UI Toolkit#1429
shati-patel merged 2 commits intomainfrom
shati-patel/path-dropdown

Conversation

@shati-patel
Copy link
Contributor

Another step towards transitioning to the VS Code UI Toolkit! See internal issue for more details.

This PR replaces the dropdown in the "code paths" view with a more VS Code native one:

Before 😿 After 😸
F36A257D-A5E9-4A46-8AF1-FE93A909B028 72959120-8613-4E8D-9A17-660BDFDE4B06

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

Comment on lines 99 to 101
const selectedOption = event.target;
const selectedIndex = selectedOption.value;
setSelectedCodeFlow(codeFlows[selectedIndex]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm aware this is could be written more concisely as

setSelectedCodeFlow(codeFlows[event.target.value]);

But I found the verbose way easier to understand 😂 (React states are confusing 🙃 )

Copy link
Contributor

Choose a reason for hiding this comment

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

What you chose is exactly what I would have written!

@shati-patel shati-patel marked this pull request as ready for review July 14, 2022 16:11
@shati-patel shati-patel requested a review from a team as a code owner July 14, 2022 16:11
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Either way, this looks good.

</ActionMenu.Overlay>
</ActionMenu>;
return <VSCodeDropdown
onChange={(event: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Is this type EventTarget in react? If it's easy to figure out, would be nice to have the proper type here.

@shati-patel shati-patel merged commit ffe1704 into main Jul 15, 2022
@shati-patel shati-patel deleted the shati-patel/path-dropdown branch July 15, 2022 12:04
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.

4 participants