Skip to content

Fix: Comments char counter & Copy button utility (#18, #17) - #20

Open
abhijeetnardele24-hash wants to merge 1 commit into
Hanu2908:mainfrom
abhijeetnardele24-hash:feat/classhub-improvements
Open

Fix: Comments char counter & Copy button utility (#18, #17)#20
abhijeetnardele24-hash wants to merge 1 commit into
Hanu2908:mainfrom
abhijeetnardele24-hash:feat/classhub-improvements

Conversation

@abhijeetnardele24-hash

Copy link
Copy Markdown

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.

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@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.

@Hanu2908

Copy link
Copy Markdown
Owner

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:

  1. Please rebase your branch on \main\ (\git fetch upstream && git rebase upstream/main).
  2. Remove the comment validation changes, keeping only the copy utility, \CopyButton\ component, and \ ests/unit/clipboard.test.ts\ for [GOOD FIRST ISSUE]: Add resilient copy action for roll numbers and profile details #17.

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.
@abhijeetnardele24-hash

Copy link
Copy Markdown
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants