🎨 Palette: Copy Section Links#25
Conversation
- Update assets/data/site.json with i18n strings for copy buttons (EN/RU). - Inject copy buttons into docs-hero and section titles in assets/js/docs-page.js. - Implement clipboard logic and visual/accessible feedback in assets/js/docs.js using event delegation. - Style buttons in assets/css/docs.css with hover/focus states and success transitions. - Add leading semicolons and defensive guards to documentation scripts for build stability. - Record UX learning in .jules/palette.md. Co-authored-by: MilakyS <155958485+MilakyS@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
✅ Deploy Preview for melodious-queijadas-3cc817 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🎨 Palette: [Copy Section Links]
💡 What:
Added section-specific "Copy Link" buttons to the documentation page. These buttons appear next to the "Overview" hero title and all individual documentation section/card headings.
🎯 Why:
This micro-UX improvement significantly enhances documentation shareability. Users can now easily grab a direct link to a specific section (e.g.,
#pointersor#booleans) without having to manually construct the URL or rely on the sidebar.✨ Implementation Details:
docs-page.js.docs.jsuses a document-level listener to handle clicks, ensuring functionality even for dynamically rendered content.navigator.clipboardwith a safe fallback to a hiddentextareafor older browsers.♿ Accessibility:
aria-labelandtitleattributes that update from "Copy link to section" to "Link copied" during the success state.:focus-visibleindicators. Focus states also ensure the button remains visible for keyboard-only users.🛡️ Robustness:
window/documentguards to all documentation-related scripts to prevent build-time failures in environments like Cloudflare Workers.PR created automatically by Jules for task 254426008729261644 started by @MilakyS