From 24c18e646042aab9dd1fc9b31f4a46cd0d6d9a02 Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Wed, 19 Aug 2026 18:06:15 +1200 Subject: [PATCH 1/2] Bounce feedback to the prefilled Google form instead of posting it Send becomes a link to the form's viewform URL with the page, rating and comment prefilled. The reader submits on Google's side, so nothing on our page can be made to submit anything. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Feedback.astro | 16 +++-- src/data/language.json | 2 +- src/scripts/modules/feedback-form.js | 29 +++++++- src/scripts/modules/feedback.js | 68 +++++------------- tests/feedback.spec.ts | 103 +++++++++++++++++---------- 5 files changed, 122 insertions(+), 96 deletions(-) diff --git a/src/components/Feedback.astro b/src/components/Feedback.astro index 53d1db839b..2d695e24e5 100644 --- a/src/components/Feedback.astro +++ b/src/components/Feedback.astro @@ -3,7 +3,11 @@ import { accelerator } from '@lib/accelerator'; import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter'; import { Lang, Translations } from '@util/Languages'; import Button from './Button.astro'; -import { RATING_NO, RATING_YES } from '../scripts/modules/feedback-form.js'; +import { + prefillUrl, + RATING_NO, + RATING_YES, +} from '../scripts/modules/feedback-form.js'; const stats = new accelerator.statistics('components/Feedback.astro'); stats.start(); @@ -21,6 +25,11 @@ const pageTitle = await accelerator.markdown.getTextFrom(frontmatter.title); // Language const _ = Lang(lang); +// The link the reader follows before any of the widget's own script has run, +// carrying what is known at build time. The script adds the rating, the comment +// and the full address once someone starts answering. +const feedbackUrl = prefillUrl(pageTitle, null, ''); + stats.stop(); --- @@ -62,13 +71,10 @@ stats.stop(); label={_(Translations.octopus_feedback.send)} size="small" importance="loud" + href={feedbackUrl} data-feedback-send /> - -