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 ✨: Enhance Copy Button Functionality and UI with Persistent Package Manager Selection #1250

Closed
wants to merge 4 commits into from

Conversation

Michael-Obele
Copy link
Contributor

@Michael-Obele Michael-Obele commented Aug 24, 2024

This pull request addresses issue #1059 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, improving user experience and reducing friction.

Key Improvements:

  • Dynamic Command Selection: The component now dynamically updates the selectedCommand value when a command is copied.
  • UI Enhancements: The button's UI has been improved to display the selected command with the CaretSort icon, providing a clearer visual indication.
  • Bug Fixes: The handleCopyDone function has been corrected to ensure accurate updating of the selectedCommand value.
  • Persistent Package Manager Selection: User preferences for the package manager are now stored using a writable store for easy retrieval. This eliminates the need for repeated prompts and improves user experience.

Changes:

  • Integrated selectedCommand writable store to manage user preferences.
  • Updated copy-button.svelte to use the selected package manager and dynamically update selectedCommand.
  • Enhanced UI to display the selected command with CaretSort icon and allow modification of the package manager.
  • Fixed handleCopyDone function for accurate selectedCommand updates.

Testing:

  • Thoroughly tested the component's functionality to ensure the selected package manager is persisted across pages, and selectedCommand is updated correctly.
  • Verified that the UI changes are visually appealing and provide a clear indication of the selected command and package manager.

Showcase

Screencast.from.2024-08-24.09-57-28.webm

Copy link

changeset-bot bot commented Aug 24, 2024

⚠️ No Changeset found

Latest commit: b95e889

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…t" for improved UI consistency

  📝 (copy-button.svelte): Update copy string to improve accessibility and clarity of purpose🎨 (copy-button.svelte): Update copy-button component styles for better UI consistency and accessibility
Copy link
Contributor

github-actions bot commented Aug 25, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
shadcn-svelte ✅ Ready (View Log) Visit Preview b95e889

@huntabyte
Copy link
Owner

@Michael-Obele, thanks a ton for this, I will give it a review!

@Michael-Obele
Copy link
Contributor Author

@Michael-Obele, thanks a ton for this, I will give it a review!

Glad to help. Looking forward to the review.

@huntabyte
Copy link
Owner

Closing for #1257 as you opened this PR on your main branch and it doesn't let me push changes easily to the PR. Your original commits are still included in the new PR though 😃

Thanks a ton for this! I added some improvements to actually render the correct commands in the code blocks based on the PM!

@huntabyte huntabyte closed this Aug 28, 2024
@Michael-Obele
Copy link
Contributor Author

Michael-Obele commented Aug 28, 2024

Thanks for understanding.
My bad. I apologize for any inconvenience caused by the branch conflict.

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