fix(copy-code): improve error handling and button feedback #495
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.
name: Pull Request
about: Submit changes to the Sugar Labs website for review
📝 Description
Fixed the copy-code utility that was logging unnecessary console errors and showing two buttons side by side when copying code blocks. The solution replaces console error logging with user-friendly visual feedback and transforms the copy button UI to show success/error states within the same button element instead of creating separate message elements.
Key improvements:
🔗 Related Issue
Fixes #493
🔄 Type of Change
📷 Visual Changes
Screenshots / GIFs
Before: Two buttons appeared side by side (Copy button + Copied! message)

After: Single button that transforms from gray "Copy" to green "Copied!" state

🧪 Testing Performed
📱 Browser Compatibility
🖥️ Responsive Design
✅ Test Cases
♿ Accessibility
📋 PR Checklist
💭 Additional Notes
fix(copy-code): replace console errors with visual feedbackTesting URLs:
http://localhost:5173/news/template/markdown-guide(comprehensive test page)📚 Reviewer Resources
Thank you for contributing to the Sugar Labs website! 🎉