feat: add copy code button with clipboard support to code viewer panel#31
Merged
komalharshita merged 1 commit intoMay 12, 2026
Merged
Conversation
|
@Prag-18 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
komalharshita
approved these changes
May 12, 2026
Owner
komalharshita
left a comment
There was a problem hiding this comment.
Thank you for the contribution.
This is a well-scoped and polished implementation. The copy-to-clipboard functionality works cleanly, the fallback support is a nice addition, and the UI feedback integrates well with the existing design system.
I also appreciate the attention to accessibility and the effort to keep the implementation lightweight and beginner-friendly.
All checks are passing and the feature aligns well with the issue requirements. This PR looks good to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary [required]
This PR adds a “Copy Code” feature to the starter code viewer so users can quickly copy starter code snippets directly from the browser. The implementation includes visual success feedback through button state updates and toast notifications while maintaining the existing code viewer layout and styling.
Related Issue [Add copy-to-clipboard button for starter code #23]
Closes #<Add copy-to-clipboard button for starter code #23>
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
templates/project.htmlstatic/script.jsstatic/style.cssHow to Test This PR [required]
2.Navigate to a project page containing starter code snippets.
3.Click the “Copy Code” button.
4.Verify the following:
5.Run tests:
python tests/test_basic.py
Expected test output:
27 passed, 0 failed out of 27 tests
Test Results [required]
Screenshots (if UI change)
Self-Review Checklist [required]
Notes for Reviewer
Implemented clipboard copy support using the Clipboard API with a textarea fallback for improved browser compatibility. Added temporary success feedback through icon swaps, button state changes, and toast notifications while preserving the existing UI layout.