From 6f396c200159f64da6d6c469f09bc0c44917c159 Mon Sep 17 00:00:00 2001 From: forgejo-backport-action Date: Fri, 3 Apr 2026 19:12:51 +0200 Subject: [PATCH] [v15.0/forgejo] Add aria-label="Copy" to copy button (#11970) **Backport:** https://codeberg.org/forgejo/forgejo/pulls/11895 This copy button on the pull request page lacks an accessible name. You can hear the screen reader announce it as just "button" in the screen recording `button.mp4`, and then hear the amended version in `copy.mp4` where it's announced as "copy, button". The most relevant WCAG success criteria here is [1.1.1 Non-text content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [ ] I did not document these changes and I do not expect someone else to do it. ### Release notes - [x] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change. - [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change. *The decision if the pull request will be shown in the release notes is up to the mergers / release team.* The content of the `release-notes/.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead. Co-authored-by: Henry Catalini Smith Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11970 Reviewed-by: Mathieu Fenniak Co-authored-by: forgejo-backport-action Co-committed-by: forgejo-backport-action --- templates/repo/issue/view_content/sidebar/reference.tmpl | 2 +- tests/e2e/issue-sidebar.test.e2e.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/sidebar/reference.tmpl b/templates/repo/issue/view_content/sidebar/reference.tmpl index 5083b97fc2..1b02769ad1 100644 --- a/templates/repo/issue/view_content/sidebar/reference.tmpl +++ b/templates/repo/issue/view_content/sidebar/reference.tmpl @@ -13,7 +13,7 @@
{{$issueReferenceLink}} - +
diff --git a/tests/e2e/issue-sidebar.test.e2e.ts b/tests/e2e/issue-sidebar.test.e2e.ts index 6eb44be856..cf3fe607d2 100644 --- a/tests/e2e/issue-sidebar.test.e2e.ts +++ b/tests/e2e/issue-sidebar.test.e2e.ts @@ -378,4 +378,8 @@ test('Issue: Reference', async ({page}) => { await expect(page.locator('.ui.reference .truncate')).toContainText( 'user2/repo1#1', ); + + await page.getByRole('button', {name: 'Copy'}).click(); + const reference = await page.evaluate(() => navigator.clipboard.readText()); + expect(reference).toBe('user2/repo1#1'); });