From 8fde6edf587fcec86b8f2423ea33aa8cfe8b5044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=C3=ADna=20Everlingov=C3=A1?= Date: Tue, 16 Jun 2026 17:22:15 +0200 Subject: [PATCH 1/3] ui: rename Edit Page to Suggest an Edit with tooltip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add EditLink.astro component override (Starlight) - Button text: "Edit Page" → "Suggest an Edit" - Tooltip on hover: "Want to improve this page? Submit a pull request on GitHub. We review all suggestions within 48 hours." - CSS lives in custom.css per repo conventions Co-Authored-By: Claude Sonnet 4.6 --- astro.config.mjs | 1 + src/components/EditLink.astro | 21 ++++++++++++++++++ src/styles/custom.css | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 src/components/EditLink.astro diff --git a/astro.config.mjs b/astro.config.mjs index 713e38265..e9885358d 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -44,6 +44,7 @@ export default defineConfig({ Head: './src/components/Head.astro', PageTitle: './src/components/PageTitle.astro', Footer: './src/components/Footer.astro', + EditLink: './src/components/EditLink.astro', }, pagination: true, editLink: { diff --git a/src/components/EditLink.astro b/src/components/EditLink.astro new file mode 100644 index 000000000..e81e5d523 --- /dev/null +++ b/src/components/EditLink.astro @@ -0,0 +1,21 @@ +--- +import type { Props } from '@astrojs/starlight/props'; + +const { editUrl } = Astro.props; +const tooltip = 'Want to improve this page? Submit a pull request on GitHub. We review all suggestions within 48 hours.'; +--- +{editUrl && ( + +)} diff --git a/src/styles/custom.css b/src/styles/custom.css index febb0a597..544ba7019 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -1758,3 +1758,45 @@ nav.sidebar { #ask-kai-drawer .ak-shell { width: 100vw; } #ak-fab { bottom: 20px; right: 16px; } } + +/* ───────── Suggest an Edit button + tooltip ───────── */ +.suggest-edit-wrapper { + position: relative; + display: inline-flex; +} + +.suggest-edit-link { + align-items: center; + gap: 0.5em; + color: var(--sl-color-text-accent); + text-decoration: none; + font-size: var(--sl-text-sm); +} + +.suggest-edit-link:hover { + color: var(--sl-color-white); +} + +.suggest-edit-wrapper::after { + content: attr(data-tooltip); + position: absolute; + bottom: calc(100% + 0.5rem); + left: 50%; + transform: translateX(-50%); + background: var(--sl-color-gray-1); + color: var(--sl-color-gray-7); + font-size: var(--sl-text-xs); + padding: 0.4rem 0.65rem; + border-radius: 0.3rem; + white-space: normal; + width: 220px; + text-align: center; + pointer-events: none; + opacity: 0; + transition: opacity 0.15s ease; + z-index: 10; +} + +.suggest-edit-wrapper:hover::after { + opacity: 1; +} From 236a3087bc85b26d694b7c45684530d847150104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=C3=ADna=20Everlingov=C3=A1?= Date: Thu, 18 Jun 2026 14:19:59 +0200 Subject: [PATCH 2/3] fix: use Astro.locals.starlightRoute for editUrl (Starlight 0.38 API) --- src/components/EditLink.astro | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/EditLink.astro b/src/components/EditLink.astro index e81e5d523..35387361b 100644 --- a/src/components/EditLink.astro +++ b/src/components/EditLink.astro @@ -1,20 +1,13 @@ --- -import type { Props } from '@astrojs/starlight/props'; +import Icon from '@astrojs/starlight/components/Icon.astro'; -const { editUrl } = Astro.props; +const { editUrl } = Astro.locals.starlightRoute; const tooltip = 'Want to improve this page? Submit a pull request on GitHub. We review all suggestions within 48 hours.'; --- {editUrl && ( From 08517cc562101589a4b37865d7ad9f5826eed995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=C3=ADna=20Everlingov=C3=A1?= Date: Thu, 18 Jun 2026 14:22:28 +0200 Subject: [PATCH 3/3] fix: remove Icon import, use inline SVG (resolves module not found error) --- src/components/EditLink.astro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/EditLink.astro b/src/components/EditLink.astro index 35387361b..72732c819 100644 --- a/src/components/EditLink.astro +++ b/src/components/EditLink.astro @@ -1,13 +1,13 @@ --- -import Icon from '@astrojs/starlight/components/Icon.astro'; - const { editUrl } = Astro.locals.starlightRoute; const tooltip = 'Want to improve this page? Submit a pull request on GitHub. We review all suggestions within 48 hours.'; --- {editUrl && (