Skip to content

🎨 Palette: Add "Copy to Clipboard" utility to OS*2 code blocks#24

Open
rtech-technologies wants to merge 1 commit into
mainfrom
palette-copy-code-ux-7085948384432023482
Open

🎨 Palette: Add "Copy to Clipboard" utility to OS*2 code blocks#24
rtech-technologies wants to merge 1 commit into
mainfrom
palette-copy-code-ux-7085948384432023482

Conversation

@rtech-technologies

Copy link
Copy Markdown
Owner

I have implemented a new "Copy to Clipboard" utility for the code blocks on the OS*2 specifications page (os2.html).

✨ Features:

  • Contextual UI: The Copy button is hidden by default to maintain the clean terminal aesthetic and only appears when the user hovers over the code block or focuses it via keyboard.
  • Visual Feedback: Upon clicking, the button text changes to "Copied!" and the background swaps to the RTECH signature Lime-500 color for 2 seconds, providing clear and satisfying confirmation.
  • Accessibility: Added aria-label="Copy code to clipboard" and ensured the button is visible on focus for keyboard-only users.
  • Robustness: The script uses the modern navigator.clipboard API with a fallback to document.execCommand('copy') to ensure it works across all environments.

♿ Accessibility Improvements:

  • Added ARIA labels to the new interactive element.
  • Ensured focus indicators and visibility for keyboard navigation.

📸 Verification:

  • Verified with a Playwright script that simulates hover, click, and the timed revert state.
  • Visual confirmation via screenshot shows the button integrates perfectly with the RTECH industrial design system.

PR created automatically by Jules for task 7085948384432023482 started by @rtech-technologies

- Implement a "Copy" button for the `.code-window` in `os2.html`
- Use Tailwind's `group` and `group-hover` for contextual visibility
- Ensure keyboard accessibility with `focus:opacity-100` and `aria-label`
- Provide immediate visual feedback (text change and color swap to lime-500)
- Robust clipboard support with a fallback for non-HTTPS/legacy environments

Co-authored-by: rtech-technologies <254326487+rtech-technologies@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant