-
-
Notifications
You must be signed in to change notification settings - Fork 365
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: Persist user's package manager choice #1181
Conversation
|
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Hey @Michael-Obele ! Thanks for taking this on! I'll give it a review tomorrow! One thing I do see is that the bun lockfile will need to be removed before merge, as we use |
Hey @Michael-Obele, the functionality is great. I'm not sure how I feel about having the package manager's name show up beside the icon like that, though. It seems a bit unintuitive. Perhaps we can set it in the If they have it set, it just copies the command for their specific PM. Otherwise, it shows the dropdown for the non-power users. What do you think about that? |
Good job! As @huntabyte said, the functionality is there but for me at least, I feel like its a bit unclear what is going on. Now the copy button still prompts the user to pick libary, and that the text (bun, npm, etc) copies the selected value. How would a dropdown next too the copy button look? The value of the dropdown would be saved in local storage. See Stripes codeblock in their docs. |
Oh I quite like this idea as well! |
This would be nice, but I can see how people would easily get confused by the options of set and clear, I would suggest, however, that if we want to go with this design, we use a single click for the default (which would be whatever was last used) and a right click/context menu to select a new default. I use multiple package managers so I tend to switch often, so I hope to make the switch as easy as possible. |
Got it, I'll do that. 😊 |
I think this design is the best because it is simple to use, requires less pasting from an unknown manager because you can always tell which manager you are on. The local stage would probably be required. |
Me, personally, do think that it would be the best alternative, since it makes it very clear what you are copying, while always being one click away. Make sure that the content of the code block is the correct one for the selected value 😄 |
Yes, I think it is great, but it might not be so simple to display the right text depending on the package manager. Essentially, the copy function simply modifies the necessary portions of the text (such as the npx to bunx) because the code is hardcoded in a markdown format. We should definitely ask @huntabyte. I could simply write a function to change the display, but I am not sure if that would be necessary. |
How's it going? I decided today that wanted to learn how to contribute to open-source projects (something I've never done before), and since I haven't seen this being implemented yet, I was thinking maybe I could give it a go. |
Hey @tryggs |
Addressing issue #1059: Persistent Package Manager Selection
This PR enhances user experience by introducing a persistent package manager selection feature. The user's chosen package manager is now saved and automatically used across pages within a session, eliminating the need for repeated prompts.
Key Improvements:
Changes:
selectedCommand
writable store to manage user preferences.copy-button.svelte
to use the selected package manager.Note: The selected package manager is currently reset on page reload.
Showcase
Screencast.from.2024-07-12.05-01-54.webm