From 78b8a76e6c13aeef6b59fb442bfea3d53ca3331c Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 19:26:16 +0100 Subject: [PATCH] feat(analytics): session recordings show the site's text Recordings masked every piece of text (maskTextSelector "*"), so a replay showed rows of asterisks and could not tell which page or link a visitor struggled with. The site's text is public, so recordings now show it. Fields stay masked, and so do a member's own name and address on the ideas pages. The privacy policy says so in EN, RU and ES. Co-Authored-By: Claude Opus 5.5 --- components/ideas/sign-in-panel.tsx | 2 +- lib/analytics.ts | 5 ++++- lib/privacy.ts | 12 ++++++------ scripts/analytics.test.ts | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/components/ideas/sign-in-panel.tsx b/components/ideas/sign-in-panel.tsx index f9900dee..bc043643 100644 --- a/components/ideas/sign-in-panel.tsx +++ b/components/ideas/sign-in-panel.tsx @@ -139,7 +139,7 @@ export function SignInPanel({ lang, next, embedded = false }: { lang: string; ne return (
{words.title} -

{words.signedIn(maskEmail(member.email))}

+

{words.signedIn(maskEmail(member.email))}

{words.continue} diff --git a/lib/analytics.ts b/lib/analytics.ts index cce704d9..de35b10f 100644 --- a/lib/analytics.ts +++ b/lib/analytics.ts @@ -6,6 +6,8 @@ export type ConsentChoice = "granted" | "denied" | "pending" const { posthogKey, posthogHost } = siteConfig.analytics const productionHostname = new URL(siteConfig.url).hostname +export const privateText = ".ideas-identity-name, .ideas-identity-email, .ideas-member-who, .ideas-sign-in-who" + export const openConsentEvent = "wirecat:open-consent" export function analyticsEnabled(hostname: string, key: string = posthogKey): boolean { @@ -29,7 +31,8 @@ export const posthogOptions: Partial = { enable_recording_console_log: false, disable_surveys: true, disable_session_recording: true, - session_recording: { maskAllInputs: true, maskTextSelector: "*" }, + // Page text is public, so recordings show it; a member's own name and address stay hidden. + session_recording: { maskAllInputs: true, maskTextSelector: privateText }, } export function startConsentedFeatures(posthog: PostHog): void { diff --git a/lib/privacy.ts b/lib/privacy.ts index 89ea33f2..ebffb977 100644 --- a/lib/privacy.ts +++ b/lib/privacy.ts @@ -8,7 +8,7 @@ export const privacyCopy: Record< title: "Privacy Policy", intro: "How WireCat handles Google, Microsoft, Zoom and email account data, local documents, optional AI processing, WireCat Desktop's update and news checks and bug reports, and visits to wirecat.dev. Learn what is shared and how to disconnect or delete your local copy.", - updated: "Last updated: 16 November 2026", + updated: "Last updated: 18 November 2026", contact: "Questions and requests about your data:", sections: [ { @@ -148,7 +148,7 @@ export const privacyCopy: Record< title: "If you accept", paragraphs: [ "PostHog stores a random identifier in a cookie and in your browser's local storage for this site, so a return visit counts as the same visitor.", - "We also record sessions: page layout, scrolling, clicks and mouse movement. All page text and everything typed into fields is masked in your browser before it is sent. Recordings show us which pages are hard to use.", + "We also record sessions: page layout, scrolling, clicks and mouse movement. Recordings show the site's own text. Everything typed into fields, and your name and email address on the ideas pages, are masked in your browser before they are sent. Recordings show us which pages are hard to use.", ], }, { @@ -185,7 +185,7 @@ export const privacyCopy: Record< title: "Политика конфиденциальности", intro: "Как WireCat обрабатывает данные аккаунтов Google, Microsoft, Zoom и почты, локальные документы, дополнительные ИИ-запросы, проверку обновлений и новостей и отчёты об ошибках в WireCat Desktop и посещения wirecat.dev. Узнайте, что передаётся и как отключить доступ или удалить локальную копию.", - updated: "Обновлено: 16 ноября 2026 г.", + updated: "Обновлено: 18 ноября 2026 г.", contact: "Вопросы и запросы о ваших данных:", sections: [ { @@ -325,7 +325,7 @@ export const privacyCopy: Record< title: "Если вы согласились", paragraphs: [ "PostHog сохраняет случайный идентификатор в cookie и в локальном хранилище браузера для этого сайта, чтобы повторный визит считался тем же посетителем.", - "Мы также записываем сессии: расположение элементов, прокрутку, клики и движения мыши. Весь текст страницы и всё, что вводится в поля, скрывается в браузере до отправки. Записи показывают, какими страницами неудобно пользоваться.", + "Мы также записываем сессии: расположение элементов, прокрутку, клики и движения мыши. В записи виден текст самого сайта. Всё, что вводится в поля, а также ваше имя и адрес почты на страницах идей скрываются в браузере до отправки. Записи показывают, какими страницами неудобно пользоваться.", ], }, { @@ -362,7 +362,7 @@ export const privacyCopy: Record< title: "Política de privacidad", intro: "Cómo WireCat trata los datos de cuentas de Google, Microsoft, Zoom y correo, los documentos locales, el procesamiento opcional con IA, las comprobaciones de actualizaciones y novedades y los informes de errores de WireCat Desktop, y las visitas a wirecat.dev. Conoce qué se comparte y cómo desconectar o borrar tu copia local.", - updated: "Última actualización: 16 de noviembre de 2026", + updated: "Última actualización: 18 de noviembre de 2026", contact: "Preguntas y solicitudes sobre tus datos:", sections: [ { @@ -502,7 +502,7 @@ export const privacyCopy: Record< title: "Si aceptas", paragraphs: [ "PostHog guarda un identificador aleatorio en una cookie y en el almacenamiento local de tu navegador para este sitio, de modo que una nueva visita cuenta como el mismo visitante.", - "También grabamos sesiones: la disposición de la página, el desplazamiento, los clics y el movimiento del ratón. Todo el texto de la página y todo lo que se escribe en los campos se oculta en tu navegador antes de enviarse. Las grabaciones nos muestran qué páginas son difíciles de usar.", + "También grabamos sesiones: la disposición de la página, el desplazamiento, los clics y el movimiento del ratón. Las grabaciones muestran el texto del propio sitio. Todo lo que se escribe en los campos, y tu nombre y tu correo en las páginas de ideas, se ocultan en tu navegador antes de enviarse. Las grabaciones nos muestran qué páginas son difíciles de usar.", ], }, { diff --git a/scripts/analytics.test.ts b/scripts/analytics.test.ts index fdf89689..fe8cc631 100644 --- a/scripts/analytics.test.ts +++ b/scripts/analytics.test.ts @@ -1,6 +1,6 @@ import type { PostHog } from "posthog-js" import { describe, expect, it, vi } from "vitest" -import { analyticsEnabled, applyConsent, posthogOptions, startConsentedFeatures } from "../lib/analytics" +import { analyticsEnabled, applyConsent, posthogOptions, privateText, startConsentedFeatures } from "../lib/analytics" const client = (status: "granted" | "denied" | "pending") => ({ @@ -26,7 +26,7 @@ describe("analytics consent", () => { autocapture: false, capture_performance: false, enable_recording_console_log: false, - session_recording: { maskAllInputs: true, maskTextSelector: "*" }, + session_recording: { maskAllInputs: true, maskTextSelector: privateText }, }) }) it("starts recording only after an explicit acceptance", () => {