Skip to content

🎨 Palette: Add accessible 'Copy' utility to code blocks#27

Open
rtech-technologies wants to merge 1 commit into
mainfrom
palette-copy-code-utility-257662611558051000
Open

🎨 Palette: Add accessible 'Copy' utility to code blocks#27
rtech-technologies wants to merge 1 commit into
mainfrom
palette-copy-code-utility-257662611558051000

Conversation

@rtech-technologies

Copy link
Copy Markdown
Owner

This PR adds a delightful and accessible 'Copy' utility to the code snippets on the OS*2 specification page.

💡 What:

A new 'Copy' button that appears on hover/focus of code blocks. It extracts the assembly logic and copies it to the user's clipboard.

🎯 Why:

Users often want to copy configuration or assembly snippets for their own industrial nodes. Providing a dedicated button is more intuitive than manual selection.

♿ Accessibility:

  • Included descriptive aria-label ('Copy code snippet').
  • Added dynamic aria-label updates during the 'COPIED!' state.
  • Button is accessible via keyboard tab order.
  • High-contrast visual feedback consistent with the RTECH design system.

📸 Before/After:

[Screenshot and Video attached in verification step]


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

- Added a 'Copy' button to code blocks in os2.html with a terminal aesthetic.
- Implemented robust copy-to-clipboard functionality with a legacy fallback.
- Added immediate visual and accessible feedback ('COPIED!' text and ARIA label updates).
- Ensured keyboard accessibility with focus states.
- Refined implementation to avoid hardcoded IDs and support reusability.

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