From 62611549e781ec03ece87d385d081d9d8cf6ae59 Mon Sep 17 00:00:00 2001 From: Niko M Date: Wed, 27 May 2026 12:25:57 +1000 Subject: [PATCH 1/5] feat: enhance accessibility for copy-to-clipboard buttons --- src/core/components/copy-to-clipboard-btn.jsx | 12 ++++++++++-- src/core/components/curl.jsx | 14 ++++++++++++-- .../plugins/request-snippets/request-snippets.jsx | 12 ++++++++++-- .../components/HighlightCode.jsx | 12 ++++++++++-- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/src/core/components/copy-to-clipboard-btn.jsx b/src/core/components/copy-to-clipboard-btn.jsx index 9c44487e2c5..f2beb2b9e8f 100644 --- a/src/core/components/copy-to-clipboard-btn.jsx +++ b/src/core/components/copy-to-clipboard-btn.jsx @@ -13,10 +13,18 @@ export default class CopyToClipboardBtn extends React.Component { const CopyIcon = getComponent("CopyIcon") + const label = "Copy path to clipboard" + return ( -
+
- +
) diff --git a/src/core/components/curl.jsx b/src/core/components/curl.jsx index 618b21b9e6b..ac058fd4cf8 100644 --- a/src/core/components/curl.jsx +++ b/src/core/components/curl.jsx @@ -17,8 +17,18 @@ export default class Curl extends React.Component { return (

Curl

-
-
}) }
-
+
-
diff --git a/src/core/plugins/syntax-highlighting/components/HighlightCode.jsx b/src/core/plugins/syntax-highlighting/components/HighlightCode.jsx index f389f0b95ef..d1e09e57fab 100644 --- a/src/core/plugins/syntax-highlighting/components/HighlightCode.jsx +++ b/src/core/plugins/syntax-highlighting/components/HighlightCode.jsx @@ -68,9 +68,17 @@ const HighlightCode = ({ return (
{canCopy && ( -
+
-
)} From 800719b9029b54152373e89590533643c76275d9 Mon Sep 17 00:00:00 2001 From: Niko M Date: Wed, 27 May 2026 12:54:05 +1000 Subject: [PATCH 2/5] :sparkles: improve accessibility for copy-to-clipboard buttons --- src/core/components/copy-to-clipboard-btn.jsx | 14 +++++++++----- src/core/components/curl.jsx | 10 ++++++---- .../plugins/request-snippets/request-snippets.jsx | 10 ++++++---- .../components/HighlightCode.jsx | 10 ++++++---- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/core/components/copy-to-clipboard-btn.jsx b/src/core/components/copy-to-clipboard-btn.jsx index f2beb2b9e8f..2147b3ccccc 100644 --- a/src/core/components/copy-to-clipboard-btn.jsx +++ b/src/core/components/copy-to-clipboard-btn.jsx @@ -2,6 +2,8 @@ import React from "react" import { CopyToClipboard } from "react-copy-to-clipboard" import PropTypes from "prop-types" +const COPY_PATH_LABEL = "Copy path to clipboard" + /** * @param {{ getComponent: func, textToCopy: string }} props * @returns {JSX.Element} @@ -13,16 +15,18 @@ export default class CopyToClipboardBtn extends React.Component { const CopyIcon = getComponent("CopyIcon") - const label = "Copy path to clipboard" - return (
- diff --git a/src/core/components/curl.jsx b/src/core/components/curl.jsx index ac058fd4cf8..bfed4a5f605 100644 --- a/src/core/components/curl.jsx +++ b/src/core/components/curl.jsx @@ -3,6 +3,8 @@ import PropTypes from "prop-types" import { CopyToClipboard } from "react-copy-to-clipboard" import { requestSnippetGenerator_curl_bash } from "../plugins/request-snippets/fn" +const COPY_CURL_COMMAND_LABEL = "Copy cURL command to clipboard" + export default class Curl extends React.Component { static propTypes = { getComponent: PropTypes.func.isRequired, @@ -19,13 +21,13 @@ export default class Curl extends React.Component {

Curl