-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix #57 ShareLink- Copy Feedback + Clipboard Fallback Enhancement #58
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
fix #57 ShareLink- Copy Feedback + Clipboard Fallback Enhancement #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Likhithakathireddy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JorchCortez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comments in
Dist/Functional/ShareLink.js
Outdated
| if (this._copyResetTimer) clearTimeout(this._copyResetTimer); | ||
|
|
||
| // Update UI and temporarily disable clicks | ||
| this.element.textContent = '✓ Copied!'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get why we're adding this but, as mentioned in the Issue, we should allow for the text to be set by the site owner (eg. adding an attribute wt-share-copytext) and setting the value there instead of setting a pre defined one., same goes for the styles.
This being said I can notice we also are adding the temp message which also shows a pop-up this would be better done by adding an additional attribute (wt-share-showpopup) which will show if the attribute exists along with allowing the user to create an object with the attribute wt-share-element="popup" with which they can make sure the pop up looks however they want and is placed the same way.
please take a look at those and if possible, though I don't condemn ai-generated code at all, most of the coments in here are fairly unnecessary, thanks for keeping the structure clean, it is pretty readable that way
Created a .gitignore file to prevent node_modules directory from being tracked by git.
Improves copy-to-clipboard feedback by supporting external HTML templates, custom success/error classes, and configurable timeouts. Refactors UI update logic for copy actions, adds screen reader support, and enables module export for testing environments. Also updates LinkedIn share URL to include title.
Introduces a workflow to run tests on pull requests targeting the Develop branch. The workflow sets up Node.js, installs dependencies, and executes tests using npm.
Introduces comprehensive Jest tests for the ShareLink module, covering initialization, clipboard copy success/failure, and fallback behavior. Adds Jest and jsdom environment dependencies for testing.
ShareLink now supports a 'wt-share-copytemplate' attribute to select a specific template for the copy message. Templates are cached and removed from the DOM after use to improve performance. Added a test to verify per-element template selection.
|
I have created a new pull request, so you can go ahead and close this one. |
@Likhithakathireddy I've actually added some changes to this PR and kept a bunch of the work you added just solidifying the implementation. As I stated before, the changes you added were in a great track we were just missing some tweaks. I apologize I forgot to mention that I was adding some changes to your PR to close it full. I've reviewed the other PR and closed it as this was closer to the expected outcome. There will be more options for changes/features on the different modules in the future so please feel free to either review, add or take over on future improvements you feel like helping! |
Description
This PR refactors ShareLink to improve URL construction for sharing and make the Copy action reliable and user-friendly across both HTTPS and HTTP.
Key UX enhancements:
Related Issues
No tracked bug; this is a UX/robustness improvement over the existing implementation.
Script Details
Changes Made
Encoding & params
Twitter: intent/tweet
Copy behavior
Standards & safety
Features
Testing Notes
Manual tests:
Suggested quick checks: