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

feat(resources): add ability to choose package manager #173

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

PierreBerger
Copy link
Contributor

@PierreBerger PierreBerger commented Feb 3, 2024

This PR adds the ability to select the package manager (npm/yarn/pnpm/bun) when copying installation commands from the resources page.

Maybe I should add a test for the transformNpmCommand function?

Capture d’écran 2024-02-03 à 19 01 51

I've used DetailsMenu component for the Dropdown menu logic.

Close #144

@brookslybrand
Copy link
Contributor

brookslybrand commented Feb 5, 2024

Hey @PierreBerger, thanks so much for taking the initiative to add this!

Would you left align the options and give a little more spacing? The example in the issue shows the inspiration from shadcn/ui

@PierreBerger
Copy link
Contributor Author

Hey @brookslybrand I've updated the dropdown position, let me know if it's ok for you.

Kapture 2024-02-08 at 21 47 40

@brookslybrand
Copy link
Contributor

brookslybrand commented Feb 9, 2024

Hey @PierreBerger sorry, I meant the options should be left aligned too. I do like where you positioned jt

image

@PierreBerger
Copy link
Contributor Author

Capture d’écran 2024-02-09 à 17 52 00

I hope we are good now 😅

Copy link
Contributor

@brookslybrand brookslybrand left a comment

Choose a reason for hiding this comment

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

Thanks for the style improvements, this is coming along!

One issue I noticed is that we lost keyboard accessibility unfortunately. You are able to tab to the item and select it, but there's no visual indicator when you're tabbed on it like there was before. Basically when focused the copy button should show up

tabbing-on-resources.mov

Overall I think the code can be cleaned up a good bit. Seems like there was a bit of copy and pasting that might have happened that didn't need to. Also, we want to avoid using the ! tool in tailwind. Everything should be accomplishable via css/regular tailwind classes. If you're not able to figure this part out, that's fine, I plan to keep looking into it

app/lib/transformNpmCommand.ts Show resolved Hide resolved
app/ui/resources.tsx Outdated Show resolved Hide resolved
Comment on lines 164 to 165
className="!left-auto !right-0 top-10"
childrenClassName="!w-[110px]"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really love how much css with !important we're throwing around, this really shouldn't be necessary. For now you can leave it and make the other suggestions I made and I'll try to look into a better suggestion. Basically you should be able to adjust the parent styles to get this to work I'm pretty sure

@brookslybrand
Copy link
Contributor

Hey @PierreBerger, I went ahead and pushed up a number of changes based on what I was trying to get at. Will you look over them and see if they make sense to you? There are a couple of TODOs left in there, if you want you're welcome to take a crack at them.

Please don't hesitate to ask if something isn't clear

@brookslybrand
Copy link
Contributor

Alright @PierreBerger, I've gone ahead and cleaned up the a11y issue and some of the css stuff I wanted to be a bit different. Will you review it and let me know what you think?

I thin the only thing that remains is adding a test to transformNpmCommand. Additionally, would you just put that function inside app/ui/resources?

@PierreBerger
Copy link
Contributor Author

Hey @brookslybrand, thanks for the help. I'm sorry, I'm quite busy at the moment. I will work on this next week.

@brookslybrand
Copy link
Contributor

Hey @brookslybrand, thanks for the help. I'm sorry, I'm quite busy at the moment. I will work on this next week.

All good! Really no rush on my part, just wanted to make sure I wasn't blocking you

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.

Add ability to change from npm to yarn/pnpm
2 participants