From 74effe439289e510d0aab414ceb572a2548de431 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Mon, 10 Aug 2026 15:07:35 +1200 Subject: [PATCH 01/10] Remove the Feedback component The Google Forms feedback prompt is being replaced with something new, so drop it from the default layout rather than leave it rendering. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Feedback.astro | 26 -------------------------- src/layouts/Default.astro | 6 ------ src/scripts/modules/headers.js | 4 ++-- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 src/components/Feedback.astro diff --git a/src/components/Feedback.astro b/src/components/Feedback.astro deleted file mode 100644 index 9b8c17d0d8..0000000000 --- a/src/components/Feedback.astro +++ /dev/null @@ -1,26 +0,0 @@ ---- -import { accelerator } from '@lib/accelerator'; -import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter'; -import { SITE } from '@config'; - -const stats = new accelerator.statistics('components/Feedback.astro'); -stats.start(); - -// Properties -type Props = { - lang: string; - frontmatter: Frontmatter; - headings: { depth: number; slug: string; text: string }[]; -}; -const { lang, frontmatter, headings } = Astro.props satisfies Props; - -// Logic -const heading = await accelerator.markdown.getTextFrom(frontmatter.title); -const formUrl = `https://docs.google.com/forms/d/e/1FAIpQLSehVdN2w6tgSvp5QX7lHGnHDmgKi2Yfvko7bM2izgWQaqg-Wg/viewform?usp=pp_url&entry.336432709=${encodeURIComponent(heading)}`; - -stats.stop(); ---- - -

Help us continuously improve

-

Please let us know if you have any feedback about this page.

-

Send feedback

diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 2fc28c559f..924b009989 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -19,7 +19,6 @@ import ArticleNav from '../components/ArticleNav.astro'; import Header from '../components/Header.astro'; import Related from '../components/Related.astro'; import ArticleJourney from '../components/ArticleJourney.astro'; -import Feedback from '../components/Feedback.astro'; import EditOnGithub from '../components/EditOnGithub.astro'; import CopyMarkdown from '../components/CopyMarkdown.astro'; import Plausible from 'src/components/Plausible.astro'; @@ -91,11 +90,6 @@ const lastUpdated = frontmatter.modDate ?? frontmatter.pubDate ?? null;
- diff --git a/src/scripts/modules/headers.js b/src/scripts/modules/headers.js index dfdcdf7c18..5509b6bafd 100644 --- a/src/scripts/modules/headers.js +++ b/src/scripts/modules/headers.js @@ -5,8 +5,8 @@ import { copyOnClick } from './copy-button.js'; const REST = 'Copy URL'; /** - * Scoped to .page-content headings with an id: the feedback prompt and the - * navigation render their own headings, and those have nothing to link to. + * Scoped to .page-content headings with an id: the navigation renders its own + * headings, and those have nothing to link to. * * Each heading is given an aria-label of its own text. A heading is named from * its contents, and those contents include a nested control's name, so without From b72d88aae7d254b3b9ff5cf343f3013e5bbb9497 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Mon, 10 Aug 2026 15:44:44 +1200 Subject: [PATCH 02/10] Add the feedback widget to the table of contents column Yes/No vote, an optional comment, and a thank you, built to the Figma design and sitting under the article navigation. Submissions go to the existing Google Form. It has no yes/no field, so Yes maps to 5 and No to 1 on its 1-5 scale, and the comment field is marked required there, so an empty box sends a space. Google Forms sends no CORS headers, so the POST goes out as no-cors and the response is opaque - the thank you is optimistic. Co-Authored-By: Claude Opus 5 (1M context) --- src/assets/icons/thumbs-down.svg | 6 +++ src/assets/icons/thumbs-up.svg | 6 +++ src/components/Feedback.astro | 61 +++++++++++++++++++++ src/data/language.json | 20 +++++++ src/layouts/Default.astro | 2 + src/scripts/main.js | 2 + src/scripts/modules/feedback.js | 92 ++++++++++++++++++++++++++++++++ src/styles/button.css | 5 ++ src/styles/main.css | 73 +++++++++++++++++++++++++ 9 files changed, 267 insertions(+) create mode 100644 src/assets/icons/thumbs-down.svg create mode 100644 src/assets/icons/thumbs-up.svg create mode 100644 src/components/Feedback.astro create mode 100644 src/scripts/modules/feedback.js diff --git a/src/assets/icons/thumbs-down.svg b/src/assets/icons/thumbs-down.svg new file mode 100644 index 0000000000..52aa171be6 --- /dev/null +++ b/src/assets/icons/thumbs-down.svg @@ -0,0 +1,6 @@ + + + + diff --git a/src/assets/icons/thumbs-up.svg b/src/assets/icons/thumbs-up.svg new file mode 100644 index 0000000000..cda73f907a --- /dev/null +++ b/src/assets/icons/thumbs-up.svg @@ -0,0 +1,6 @@ + + + + diff --git a/src/components/Feedback.astro b/src/components/Feedback.astro new file mode 100644 index 0000000000..d9c1862a1a --- /dev/null +++ b/src/components/Feedback.astro @@ -0,0 +1,61 @@ +--- +import { accelerator } from '@lib/accelerator'; +import { Lang, Translations } from '@util/Languages'; +import Button from './Button.astro'; + +const stats = new accelerator.statistics('components/Feedback.astro'); +stats.start(); + +// Properties +type Props = { + lang: string; +}; +const { lang } = Astro.props satisfies Props; + +// Language +const _ = Lang(lang); + +stats.stop(); +--- + + diff --git a/src/data/language.json b/src/data/language.json index 0d074fd80a..e7934969fc 100644 --- a/src/data/language.json +++ b/src/data/language.json @@ -28,6 +28,26 @@ "en": "Legal and support" } }, + "octopus_feedback": { + "question": { + "en": "Was this page helpful?" + }, + "yes": { + "en": "Yes" + }, + "no": { + "en": "No" + }, + "comment_label": { + "en": "Why did you give this rating? (optional)" + }, + "send": { + "en": "Send" + }, + "thanks": { + "en": "Thanks for your feedback!" + } + }, "octopus_github": { "edit_on_github": { "en": "Edit on GitHub" diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 924b009989..c1268ac8b2 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -16,6 +16,7 @@ import Taxonomy from '@components/Taxonomy.astro'; // Custom components import ArticleHeader from '../components/ArticleHeader.astro'; import ArticleNav from '../components/ArticleNav.astro'; +import Feedback from '../components/Feedback.astro'; import Header from '../components/Header.astro'; import Related from '../components/Related.astro'; import ArticleJourney from '../components/ArticleJourney.astro'; @@ -119,6 +120,7 @@ const lastUpdated = frontmatter.modDate ?? frontmatter.pubDate ?? null; lang={lang} /> --> +