Fix: Comments char counter & Copy button utility (#18, #17) - #20
Fix: Comments char counter & Copy button utility (#18, #17)#20abhijeetnardele24-hash wants to merge 1 commit into
Conversation
|
@abhijeetnardele24-hash is attempting to deploy a commit to the hiimanshu2006-4881's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for the thorough work @abhijeetnardele24-hash! The implementation of \CopyButton\ and the \copyToClipboard\ utility with \execCommand\ fallback and unit tests for #17 is solid. However, this PR combines two separate issues (#17 and #18). PR #21 was submitted specifically for #18 and has now been merged into \main. To get your work merged cleanly:
Once updated, we will merge this for #17 immediately! |
…ent (Hanu2908#17) - Created a robust copyToClipboard utility with automatic fallback to document.execCommand for environments without navigator.clipboard. - Handled NotAllowedError exceptions gracefully, surfacing permission issues via sonner toasts rather than unhandled promise rejections. - Extracted a reusable CopyButton component adhering to accessibility standards (aria-label injection). - Integrated CopyButton into ProfilePage and SectionDirectoryPage for seamless copying of hub codes, university/class roll numbers, and contact details. - Added extensive unit tests mocking both success sequences and permission rejection scenarios.
23ef353 to
cb8c4f1
Compare
|
I have successfully rebased the branch onto upstream/main and removed the comment validation changes as requested. The PR now strictly contains the resilient copy utility, CopyButton component, and tests/unit/clipboard.test.ts for issue #17. Let me know if you need any further adjustments! |
Resolves #18: Extracted hardcoded comment length constraints to shared Zod schema and implemented dynamic counter in AnnouncementCommentsDrawer. Added boundary condition tests for comment lengths. Resolves #17: Implemented resilient 1-tap copy utility with execCommand fallback, gracefully catching NotAllowedError. Created reusable CopyButton component and integrated it into ProfilePage and SectionDirectoryPage.