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 /> - -