The diagnostics snapshot.
An absolute viewform URL, or undefined when no form is configured.
buildGoogleFormUrl(diag); // "https://docs.google.com/forms/d/e/…/viewform?usp=pp_url&…"
export function buildGoogleFormUrl(d: Diagnostics): string | undefined {
const { id, entries } = reportConfig.googleForm;
if (!id) return undefined;
const params = new URLSearchParams();
params.set('usp', 'pp_url');
params.set(entries.summary, d.message.slice(0, 120));
params.set(entries.version, d.version);
params.set(entries.diagnostics, formatMetadata(d));
params.set(entries.logs, truncate(formatLogs(d), reportConfig.maxChars.formLogs));
// `description` is left blank on purpose — the user writes that part.
return `https://docs.google.com/forms/d/e/${id}/viewform?${params.toString()}`;
}
Builds a prefilled Google Form
viewformURL. Field ids come fromconfig.json(report.googleForm.entries); thelogsvalue is truncated to the form-specific budget (Google Forms drops prefills on very long URLs).