Skip to content

Commit e214bb3

Browse files
BenGlutclaude
andcommitted
Finish the Report issue button
Follow-up to #23, whose idea and design are kept as they were. Drops rel="me" — that attribute claims the target is another profile of the same person, which a new-issue form is not. Hides the link below Starlight's social-row breakpoint. It was rendering at 0x0 there: invisible to sighted users, still announced to a screen reader, and unreachable by either. And carries the page into the issue. A report now arrives titled with the path and pre-filled with it, in the reader's own language, instead of costing a round-trip to ask where the problem was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 3519bad commit e214bb3

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎src/components/SocialIcons.astro‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
---
2+
/**
3+
* Starlight's social icons, plus a "Report issue" link.
4+
*
5+
* The link carries the page it was clicked from, so a report arrives already
6+
* saying where the problem is instead of costing a round-trip to ask.
7+
*/
28
import Default from '@astrojs/starlight/components/SocialIcons.astro';
39
410
import { REPO_URL } from '../../scripts/lib/docs-config.mjs';
511
612
const locale = Astro.currentLocale === 'fr' ? 'fr' : 'en';
713
const label = locale === 'fr' ? 'Signaler un problème' : 'Report issue';
14+
15+
const page = Astro.url.pathname;
16+
const title = locale === 'fr' ? `Problème sur ${page}` : `Issue on ${page}`;
17+
const body =
18+
locale === 'fr'
19+
? `Page : ${page}\n\nCe qui ne va pas :\n`
20+
: `Page: ${page}\n\nWhat is wrong:\n`;
21+
22+
const href = `${REPO_URL}/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;
823
---
924

1025
<Default><slot /></Default>
11-
<a class="report-issue-link" href={`${REPO_URL}/issues/new`} rel="me">
26+
<a class="report-issue-link" href={href}>
1227
{label}
1328
</a>

‎src/styles/tigersystem.css‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@
142142
white-space: nowrap;
143143
}
144144

145+
/* Starlight collapses its social-icons row below this width, which left the
146+
link at 0x0 — invisible, yet still announced by a screen reader. Take it out
147+
of the accessibility tree too, rather than leaving a link nobody can reach. */
148+
@media (max-width: 50rem) {
149+
.report-issue-link {
150+
display: none;
151+
}
152+
}
153+
145154
/* -------------------------------------------------------------------------- */
146155
/* Card grids on the section index pages */
147156
/* -------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)