From 038a2b4188d5998037416f5879d960975946c546 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 29 Sep 2026 14:16:42 +0200 Subject: [PATCH] usertest: pick the session language, starting with Dutch (#198) The session page gets a language switch at the top (English, Nederlands; the list lives in page/i18n.js with a flag per language), also reachable as `&lang=nl` in the invite link and remembered per browser. Switching changes the page's texts and tester instructions, including the typed-answer box (label, placeholder, Send, the "your turn" and "the microphone is not working" notices, "You (typed)"), the speech recognizer's language, the interviewer voice (nl-NL, else nl-BE, else the default) and the moderator's language, also mid-session; switching back to English restores all of it from the next line on. The page tells the moderator with POST /sessions//lang. Every turn carries a `[Language]` line, so the system prompt (script and English session plan) stays the same and cached; script.md now says to speak that language and translate the plan's tasks. meta.json records `lang` and `langChanges`; the transcript records each switch and each tester turn's language; analyze.mjs still writes its findings in English. Not done: the Atomic app's own UI stays English, because the data-browser has no Dutch translation (en, es, fr, de only). Co-Authored-By: Claude Opus 5.5 --- usertest/README.md | 19 ++- usertest/moderator/analyze.mjs | 5 +- usertest/moderator/script.md | 2 +- usertest/moderator/server.mjs | 57 ++++++++- usertest/page/app.js | 202 +++++++++++++++++++++++-------- usertest/page/i18n.js | 210 +++++++++++++++++++++++++++++++++ usertest/page/index.html | 97 +++++---------- 7 files changed, 467 insertions(+), 125 deletions(-) create mode 100644 usertest/page/i18n.js diff --git a/usertest/README.md b/usertest/README.md index c0459135a..ce9f60ab1 100644 --- a/usertest/README.md +++ b/usertest/README.md @@ -101,6 +101,20 @@ tasks to give. Without it, a link gets `calendar`. The code is in `/etc/usertest without speech recognition (a browser other than Chrome or Edge), the session still starts, typed only, and records the screen without sound. +The page is in English or Dutch (Nederlands), picked with the buttons at the +top, by `&lang=nl` in the invite link, or remembered from a previous visit. +The choice switches the page's texts, the speech recognizer, the +moderator's voice (a `nl-NL` voice, else `nl-BE`, else the browser's default) +and the language the moderator speaks, also mid-session: switching back to +English restores all of it from the next line on. Session plans stay in +English; each turn tells Claude the language in a `[Language]` line, so the +cached system prompt does not change. The Atomic app in the second window +stays in English: the data-browser has no Dutch translation yet (it has +English, Spanish, French and German). To add a language, see the top of +`page/i18n.js`. Checked on 2026-09-29 with a stub in place of the Claude API +and a macOS Dutch voice; not yet with a Dutch-speaking tester, so the speech +recognition of Dutch is not verified. + The moderator (`moderator/server.mjs`) asks Claude (`claude-opus-5`, effort `low`, server-side refusal fallback on) for the next line, following the interview script in `moderator/script.md` and the session's plan: short spoken questions, mostly @@ -139,9 +153,10 @@ Measured on 2026-09-28 on session 1 (about 11 minutes): 34 s, about 2,000 input and 2,400 output tokens, 6 findings. Per session, `/var/lib/usertest-sessions//` holds `meta.json` (with -`input`, `voice` or `typed` for how the session started, and `typedTurns`), +`input`, `voice` or `typed` for how the session started, `typedTurns`, +`lang`, the current language, and `langChanges`, each switch with its time), `transcript.jsonl` (both sides, with the log lines each turn saw, token -usage, and `input: "typed"` or `"voice"` per tester turn), `screen-NNN.jpg` per turn, `recording.webm`, and after the analysis +usage, and `input: "typed"` or `"voice"` and `lang` per tester turn), `screen-NNN.jpg` per turn, `recording.webm`, and after the analysis `findings.json`, `findings.md` and, when filed, `filed.json`. Limits: the invite code on every request, at most 120 turns per session and 20 sessions per UTC day. The moderator keeps sessions in memory, so restarting it ends the sessions in progress. diff --git a/usertest/moderator/analyze.mjs b/usertest/moderator/analyze.mjs index f06e0c456..60a311c4b 100644 --- a/usertest/moderator/analyze.mjs +++ b/usertest/moderator/analyze.mjs @@ -30,7 +30,7 @@ const MODEL = process.env.ANALYSIS_MODEL ?? 'claude-opus-5'; const REPO = process.env.GITHUB_FINDINGS_REPO ?? 'ontola/usertest-findings'; const MAX_SHOTS = 12; -const INSTRUCTIONS = `You analyze one remote usability test of Atomic (a personal data app) and its drive apps, plugins that import data from services like Google Calendar, GitHub, Notion and Clockify. A voice moderator (also Claude) ran the session; you get its transcript (speech-to-text, so expect recognition errors; turns marked TESTER (typed) were typed by the tester instead), the app's log lines each turn saw, and some screenshots of the tester's screen. +const INSTRUCTIONS = `You analyze one remote usability test of Atomic (a personal data app) and its drive apps, plugins that import data from services like Google Calendar, GitHub, Notion and Clockify. A voice moderator (also Claude) ran the session; you get its transcript (speech-to-text, so expect recognition errors; turns marked TESTER (typed) were typed by the tester instead), the app's log lines each turn saw, and some screenshots of the tester's screen. The session may be in another language than English, or switch language midway (marked "(lang ...)"); write the findings in English anyway, translating the few words you quote. Find what should change. Two kinds: - "app": a problem in Atomic or a drive app: confusion, a dead end, a wrong expectation, an error, missing feedback. Give "repo": "atomic-plugins" for a drive app (integrations//, the catalog) and "atomic-server" for the host (drive, navigation, Integrations page, settings, tables). @@ -64,7 +64,8 @@ function transcriptText(entries) { ); } else if (e.role === 'moderator') lines.push(`${time} MODERATOR: ${e.say || '(stayed silent)'}`); - else if (e.event) lines.push(`${time} (${e.event})`); + else if (e.event) + lines.push(`${time} (${e.event}${e.lang ? ` ${e.lang}` : ''})`); } return lines.join('\n'); diff --git a/usertest/moderator/script.md b/usertest/moderator/script.md index cb48cb573..769f7cefb 100644 --- a/usertest/moderator/script.md +++ b/usertest/moderator/script.md @@ -7,7 +7,7 @@ Find out where people get stuck, what they expect, and what confuses them. The p ## How to speak - One or two short sentences per turn, then stop. No lists, markdown, emoji, URLs or code: everything is spoken. -- Speak English only, even if the tester answers in another language: the voice and the speech recognizer are set to English. If they speak another language, kindly ask them to continue in English. +- Speak only the language named in the [Language] line of the latest turn: the tester chose it on the page, and the voice and the speech recognizer are set to it. It is English unless the tester picked another. When it changes mid-session, switch at once, without commenting on it. The session plan below is written in English; say its tasks naturally in the session's language, but keep names of apps, buttons and screens as the tester sees them (the Atomic app itself may stay in English). If the tester speaks a different language than [Language], kindly ask them to continue in that language, or to switch the language at the top of their page. - Ask open questions: "What do you expect to happen?", "What are you looking for now?", "What do you make of that?" Never ask leading questions. - Encourage thinking aloud. If they fall silent (you get "(silence)"), gently ask what they are doing or thinking. - If they ask you to wait, say "Sure" once, then answer [WAIT] to every "(silence)" until they speak again. diff --git a/usertest/moderator/server.mjs b/usertest/moderator/server.mjs index 55bfa9cc6..afd277686 100644 --- a/usertest/moderator/server.mjs +++ b/usertest/moderator/server.mjs @@ -17,6 +17,12 @@ * `typedTurns`. meta.json's `input` says how the session started: `voice`, * or `typed` when the page had no microphone or speech recognition. * + * The tester picks the language on the page (English by default, see + * LANGUAGES) and can switch mid-session (`POST /sessions//lang`). Every + * turn tells Claude the language to speak in a `[Language]` line, so the + * system prompt (script and plan, in English) stays the same and cached. + * meta.json keeps the current `lang` and every switch in `langChanges`. + * * The endpoints spend API money and are public, so every request needs the * invite code (USERTEST_CODE, sent as `x-usertest-code`), a session takes at * most MAX_TURNS turns, and at most MAX_SESSIONS_PER_DAY sessions start per @@ -54,6 +60,18 @@ const MAX_TURNS = 120; const MAX_SESSIONS_PER_DAY = 20; const MAX_CHUNK = 32 * 1024 * 1024; const MAX_LOG_LINES = 15; +/** The page's languages (../page/i18n.js), by the BCP 47 tag it sends. */ +const LANGUAGES = { + 'en-US': { + name: 'English', + lost: 'Sorry, I lost my train of thought. Could you tell me what you are doing now?', + }, + 'nl-NL': { + name: 'Dutch (Nederlands)', + lost: 'Sorry, ik ben de draad even kwijt. Kun je vertellen wat je nu aan het doen bent?', + }, +}; +const DEFAULT_LANG = 'en-US'; if (!CODE || CODE.length < 12) throw new Error('USERTEST_CODE must be set (at least 12 characters)'); @@ -89,7 +107,7 @@ const DEFAULT_PLAN = 'calendar'; if (!PLANS[DEFAULT_PLAN]) throw new Error(`sessions/${DEFAULT_PLAN}.md is missing`); const client = new Anthropic(); -/** id -> { dir, meta, started, plan, cursor, clients, messages, turns, done, analyzed } */ +/** id -> { dir, meta, lang, langChanged, started, plan, cursor, clients, messages, turns, done, analyzed } */ const sessions = new Map(); mkdirSync(SESSIONS_DIR, { recursive: true }); @@ -173,11 +191,13 @@ async function nextLine(session, said, screenshot, typed) { typeof screenshot === 'string' && /^[A-Za-z0-9+/=]+$/.test(screenshot) ? screenshot : undefined; + const language = LANGUAGES[session.lang]; const opening = session.meta.input === 'typed' ? '(the session starts now; the tester has no working microphone or speech recognition and types their answers)' : '(the session starts now)'; const content = [ + `[Language] ${language.name}${session.langChanged ? '. The tester just switched to it: speak it from now on.' : ''}`, log.length ? `[Log]\n${log.join('\n')}` : '[Log]\n(nothing new)', `[Tester${typed ? ', typed' : ''}]\n${session.turns === 0 ? opening : heard}`, ].join('\n\n'); @@ -199,10 +219,12 @@ async function nextLine(session, said, screenshot, typed) { join(session.dir, `screen-${String(session.turns).padStart(3, '0')}.jpg`), Buffer.from(shot, 'base64'), ); + session.langChanged = false; record(session, { role: 'tester', said: heard, input: typed ? 'typed' : 'voice', + lang: session.lang, log, screenshot: !!shot, }); @@ -248,8 +270,7 @@ async function nextLine(session, said, screenshot, typed) { const wait = !done && /^\[WAIT\]$/.test(text); const say = wait ? '' - : text.replace('[END]', '').replace('[WAIT]', '').trim() || - 'Sorry, I lost my train of thought. Could you tell me what you are doing now?'; + : text.replace('[END]', '').replace('[WAIT]', '').trim() || language.lost; session.messages.push({ role: 'assistant', content: wait ? '[WAIT]' : say }); session.turns++; @@ -333,13 +354,18 @@ createServer(async (req, res) => { const dir = join(SESSIONS_DIR, id); mkdirSync(dir); const started = new Date().toISOString(); + const lang = Object.hasOwn(LANGUAGES, body.lang) + ? body.lang + : DEFAULT_LANG; const session = { dir, meta: { id, started, name: String(body.name ?? '').slice(0, 80), - lang: String(body.lang ?? '').slice(0, 20), + lang, + // Every switch after the start: [{ t, lang }]. + langChanges: [], plan, // How the page started: `typed` without a microphone or speech // recognition. Typed turns are counted either way. @@ -348,6 +374,8 @@ createServer(async (req, res) => { userAgent: req.headers['user-agent'], model: MODEL, }, + lang, + langChanged: false, started, plan, cursor: started, @@ -364,7 +392,7 @@ createServer(async (req, res) => { } const match = url.pathname.match( - /^\/sessions\/([\w-]+)\/(turn|recording|end|news)$/, + /^\/sessions\/([\w-]+)\/(turn|recording|end|news|lang)$/, ); const session = match && sessions.get(match[1]); if (!session) return reply(404, { error: 'Unknown session' }); @@ -408,6 +436,25 @@ createServer(async (req, res) => { return reply(204); } + if (req.method === 'POST' && match[2] === 'lang') { + const { lang } = JSON.parse((await readBody(req, 1024)).toString()); + if (!Object.hasOwn(LANGUAGES, lang)) + return reply(400, { + error: `Unknown language; known: ${Object.keys(LANGUAGES).join(', ')}`, + }); + + if (lang !== session.lang) { + session.lang = lang; + session.langChanged = true; + session.meta.lang = lang; + session.meta.langChanges.push({ t: new Date().toISOString(), lang }); + writeMeta(session); + record(session, { role: 'page', event: 'lang', lang }); + } + + return reply(200, { lang }); + } + if (req.method === 'POST' && match[2] === 'end') { record(session, { role: 'page', event: 'end' }); session.done = true; diff --git a/usertest/page/app.js b/usertest/page/app.js index 501340fb8..8e6d0a84a 100644 --- a/usertest/page/app.js +++ b/usertest/page/app.js @@ -2,7 +2,10 @@ // turns speech into text with the browser's recognizer, sends turns to the // moderator (../moderator/server.mjs) and speaks its answers. Served at // /usertest/ on the test instance, so it shares the data-browser's origin -// and can set the test catalog before opening the app. +// and can set the test catalog before opening the app. The tester picks the +// language at the top (i18n.js); switching changes this page, the speech +// recognizer, the voice and the moderator's language, also mid-session. +import { DEFAULT_LANG, LANGS, QUESTION, TEXT } from './i18n.js'; const API = '/usertest/api'; const CATALOG_URL = `https://catalog.${location.hostname.replace(/^plugins\./, '')}/catalog.json`; @@ -11,8 +14,6 @@ const CATALOG_URL = `https://catalog.${location.hostname.replace(/^plugins\./, ' * their words; the moderator answers [WAIT] when nothing needs saying. */ const PAUSE_AFTER_QUESTION = 2000; const PAUSE_AFTER_SPEECH = 5000; -const QUESTION = - /\b(how|what|where|why|which|who|when|can you|could you|should i|do i|is it|is there|are there)\b/i; /** Screenshots sent with a turn: at most this wide, as JPEG. */ const SHOT_WIDTH = 1280; /** Ask what's happening after this much silence. */ @@ -30,7 +31,34 @@ function inviteCode() { } const code = inviteCode(); + +/** Remembered per browser; `?lang=nl` (or nl-NL) in the link picks one. */ +function initialLang() { + const wanted = params.get('lang') ?? stored('usertest-lang'); + const match = LANGS.find(l => wanted && [l.code, l.short].includes(wanted)); + + return match?.code ?? DEFAULT_LANG; +} + +function stored(key, value) { + try { + if (value === undefined) return localStorage.getItem(key); + localStorage.setItem(key, value); + } catch { + // Storage blocked: the choice is not remembered. + } + + return undefined; +} + +let lang = initialLang(); +const t = () => TEXT[lang]; +/** What the status line and the error line show, as keys into TEXT, so a + * language switch can redraw them. */ +let statusKey = 'starting'; +let errorText; let session; +let recordingOn = false; let recognition; let recorder; let speaking = false; @@ -60,42 +88,108 @@ function show(who, text, typed = false) { const p = document.createElement('p'); if (who === 'me') p.className = 'me'; p.textContent = - who === 'me' ? `${typed ? 'You (typed)' : 'You'}: ${text}` : text; + who === 'me' ? `${typed ? t().youTyped : t().you}: ${text}` : text; $('log').prepend(p); } -function status(text) { - $('status').textContent = text; +function status(key) { + statusKey = key; + $('status').textContent = t().status[key]; } -/** English only for now: in a Dutch trial (2026-09-28) the moderator switched - * language on its own while the voice stayed on the one picked at the start. */ -const LANG = 'en-US'; +function showError(text) { + errorText = text; + $('error').textContent = text?.() ?? ''; + $('error').hidden = !text; +} -/** One voice for the whole session. Chrome fills getVoices() only after - * `voiceschanged`, so without waiting the first line got the default voice - * and later lines another one. */ -let voice; +/** Puts every text on the page in the current language. */ +function applyTexts() { + const texts = t(); + const { short } = LANGS.find(l => l.code === lang); + document.documentElement.lang = short; + document.title = texts.title; + for (const el of document.querySelectorAll('[data-text]')) + el.textContent = texts[el.dataset.text]; + // Constants from i18n.js only. + for (const el of document.querySelectorAll('[data-placeholder]')) + el.placeholder = texts[el.dataset.placeholder]; + for (const el of document.querySelectorAll('[data-html]')) + el.innerHTML = texts[el.dataset.html]; + $('langs').setAttribute('aria-label', texts.languageLabel); + for (const button of $('langs').children) + button.setAttribute('aria-pressed', String(button.value === lang)); + $('status').textContent = texts.status[statusKey]; + $('rec').textContent = recordingOn ? texts.recording : ''; + showError(errorText); +} -function pickVoice() { - const english = speechSynthesis - .getVoices() - .filter(v => v.lang.replace('_', '-') === LANG); +/** Switches everything to `code`: the page at once, the recognizer after a + * restart, the voice from the next line on (a line being spoken finishes in + * the old voice), and the moderator from its next turn. */ +function setLang(code) { + if (code === lang) return; + lang = code; + stored('usertest-lang', code); + applyTexts(); + + if (recognition) { + recognition.lang = lang; + // onend restarts it, now in the new language; words already recognized + // stay in `heard`. + recognition.abort(); + } - return ( - english.find(v => /google/i.test(v.name)) ?? - english.find(v => v.localService) ?? - english[0] - ); + if (session) { + checkVoice(); + api(`/sessions/${session}/lang`, { + method: 'POST', + body: JSON.stringify({ lang }), + }).catch(error => console.error(error)); + } +} + +function renderLangs() { + for (const { code: value, name, flag } of LANGS) { + const button = document.createElement('button'); + button.type = 'button'; + button.value = value; + button.textContent = `${flag} ${name}`; + button.addEventListener('click', () => setLang(value)); + $('langs').append(button); + } +} + +/** One voice per language for the whole session. Chrome fills getVoices() + * only after `voiceschanged`, so without waiting the first line got the + * default voice and later lines another one. */ +const voices = new Map(); + +function pickVoice(code) { + const all = speechSynthesis.getVoices(); + const norm = v => v.lang.replace('_', '-'); + const exact = all.filter(v => norm(v) === code); + // nl-BE rather than an English voice reading Dutch. + const near = all.filter(v => norm(v).split('-')[0] === code.split('-')[0]); + + for (const list of [exact, near]) { + const found = + list.find(v => /google/i.test(v.name)) ?? + list.find(v => v.localService) ?? + list[0]; + if (found) return found; + } + + return undefined; } -function voiceReady() { - voice ??= pickVoice(); - if (voice) return Promise.resolve(); +function voiceReady(code) { + if (!voices.get(code)) voices.set(code, pickVoice(code)); + if (voices.get(code)) return Promise.resolve(); return new Promise(resolve => { const done = () => { - voice ??= pickVoice(); + if (!voices.get(code)) voices.set(code, pickVoice(code)); resolve(); }; @@ -105,12 +199,21 @@ function voiceReady() { }); } +/** Says on the page when the browser has no voice for the language. */ +async function checkVoice() { + const code = lang; + await voiceReady(code); + if (code === lang) $('voice-note').hidden = !!voices.get(code); +} + async function speak(text) { - await voiceReady(); + const code = lang; + await voiceReady(code); return new Promise(resolve => { const utterance = new SpeechSynthesisUtterance(text); - utterance.lang = LANG; + utterance.lang = code; + const voice = voices.get(code); if (voice) utterance.voice = voice; speaking = true; // The recognizer would otherwise hear the moderator (without headphones). @@ -148,7 +251,7 @@ async function turn(said, typed = false) { $('heard').textContent = ''; lastTurn = Date.now(); if (said) show('me', said, typed); - status('Thinking…'); + status('thinking'); try { const { say, done } = await api(`/sessions/${session}/turn`, { @@ -162,14 +265,14 @@ async function turn(said, typed = false) { if (say) { show('moderator', say); - status('Speaking…'); + status('speaking'); await speak(say); } if (done) return finish(); - status(inputMode === 'typed' ? 'Your turn: type below.' : 'Listening…'); + status(inputMode === 'typed' ? 'yourTurn' : 'listening'); } catch (error) { - status('The moderator is not answering. Keep going; it will try again.'); + status('noAnswer'); console.error(error); } finally { busy = false; @@ -199,7 +302,7 @@ function listen() { function setupRecognition() { recognition = new Recognition(); - recognition.lang = LANG; + recognition.lang = lang; recognition.continuous = true; recognition.interimResults = true; @@ -225,7 +328,7 @@ function setupRecognition() { event.error, ) ) { - status('The microphone is not working here. Type your answers below.'); + status('micTyping'); useTyping(); } }; @@ -249,7 +352,7 @@ function tick() { const text = heard.join(' ').trim(); if (text) { - const wait = QUESTION.test(heard.at(-1) ?? '') + const wait = QUESTION[lang].test(heard.at(-1) ?? '') ? PAUSE_AFTER_QUESTION : PAUSE_AFTER_SPEECH; if (now - lastSpeech > wait) turn(text); @@ -314,7 +417,8 @@ async function startRecording({ screen, mic }) { screenVideo.muted = true; screenVideo.srcObject = new MediaStream(screen.getVideoTracks()); await screenVideo.play(); - $('rec').textContent = '● recording'; + recordingOn = true; + $('rec').textContent = t().recording; // Stopping the share from the browser's bar ends the session. screen.getVideoTracks()[0].addEventListener('ended', () => finish()); } @@ -326,19 +430,20 @@ async function finish() { speechSynthesis.cancel(); if (recorder?.state === 'recording') recorder.stop(); recorder?.stream.getTracks().forEach(track => track.stop()); - status('Saving the recording…'); + status('saving'); // Let the last chunk arrive before saying goodbye. await new Promise(resolve => setTimeout(resolve, 500)); await uploads; await api(`/sessions/${session}/end`, { method: 'POST' }).catch(() => {}); + recordingOn = false; $('rec').textContent = ''; - status('Thank you! The session has ended; you can close both windows.'); + status('ended'); $('end').hidden = true; $('typed-form').hidden = true; } async function start() { - $('error').hidden = true; + showError(undefined); $('start').disabled = true; // The data-browser reads the catalog URL from this origin's storage. localStorage.setItem('plugin-catalog-url', CATALOG_URL); @@ -358,7 +463,7 @@ async function start() { method: 'POST', body: JSON.stringify({ name: $('name').value, - lang: LANG, + lang, // How the session starts; the tester can type at any time anyway. input: inputMode, // Which session plan (moderator/sessions/.md); none = calendar. @@ -370,11 +475,11 @@ async function start() { app?.close(); media?.screen.getTracks().forEach(track => track.stop()); media?.mic?.getTracks().forEach(track => track.stop()); - $('error').textContent = + showError( error.name === 'NotAllowedError' - ? 'The session needs screen sharing. Please allow it and try again.' - : `Could not start the session (${error.message}). Is the invite link complete?`; - $('error').hidden = false; + ? () => t().errors.notAllowed + : () => t().errors.cannotStart(error.message), + ); $('start').disabled = false; return; @@ -383,6 +488,7 @@ async function start() { $('intro').hidden = true; $('consent').hidden = true; $('session').hidden = false; + checkVoice(); if (inputMode === 'voice') setupRecognition(); else useTyping(); setInterval(tick, 1000); @@ -390,12 +496,10 @@ async function start() { turn(''); } +renderLangs(); +applyTexts(); if (!Recognition) $('unsupported').hidden = false; - -if (!code) { - $('error').textContent = 'This page needs the invite link you received.'; - $('error').hidden = false; -} +if (!code) showError(() => t().errors.noCode); $('agree').addEventListener('change', () => { $('start').disabled = !$('agree').checked || !code; diff --git a/usertest/page/i18n.js b/usertest/page/i18n.js new file mode 100644 index 000000000..ff6648acd --- /dev/null +++ b/usertest/page/i18n.js @@ -0,0 +1,210 @@ +// The session page's languages and texts. To add a language: add it to +// LANGS (a BCP 47 tag the browser's speech recognizer and synthesizer know) +// and a full entry to TEXT, then add it to LANGUAGES in +// ../moderator/server.mjs, which tells the moderator which language to speak. +// Session plans stay in English; the moderator translates as it speaks. +// +// Texts marked HTML are set with innerHTML: constants from this file only. + +export const LANGS = [ + { code: 'en-US', short: 'en', name: 'English', flag: '🇬🇧' }, + { code: 'nl-NL', short: 'nl', name: 'Nederlands', flag: '🇳🇱' }, +]; + +export const DEFAULT_LANG = 'en-US'; + +/** A turn is sent sooner after words that make it a question. Chrome's + * recognizer adds no punctuation, so questions are recognized by words. */ +export const QUESTION = { + 'en-US': + /\b(how|what|where|why|which|who|when|can you|could you|should i|do i|is it|is there|are there)\b/i, + 'nl-NL': + /\b(hoe|wat|waar|waarom|welke|wie|wanneer|kun je|kunt u|kan ik|moet ik|is het|is er|zijn er)\b/i, +}; + +export const TEXT = { + 'en-US': { + title: "Try Atomic's new plugins", + languageLabel: 'Language', + // HTML + intro: `

+ Thanks for helping! For about 25 minutes you'll try a new part of + Atomic while a voice moderator (Claude, an AI) asks you what you see + and think. There are no wrong answers: we are testing the app, not + you. +

+
    +
  • Find a quiet place where you can talk, and put on headphones.
  • +
  • Use Chrome or Edge on a laptop or desktop.
  • +
  • + When you start, a second window opens with your own empty Atomic + drive. Put it next to this one; keep this window open. +
  • +
  • + When Chrome asks what to share, choose your + entire screen, so the moderator sees the Atomic + window too. +
  • +
`, + unsupported: + "This browser can't do speech recognition. You can still type your answers, or open this page in Chrome or Edge to talk.", + // HTML + consent: `

What is recorded and where it goes

+
    +
  • + Your screen (the window or screen you choose to share) and your + microphone are recorded and stored on our test server. +
  • +
  • + Your browser turns your speech into text; Chrome does this through + Google's speech service. +
  • +
  • + That text (or what you type instead), a screenshot of your shared screen at each turn, and the + app's error log are sent to Anthropic's Claude API to decide what + the moderator says next. +
  • +
  • + If you connect your own accounts (for example Google Calendar), the + imported data is stored on the test server too. You can disconnect + afterwards. +
  • +
  • + The recordings are only used to improve Atomic and are deleted + after analysis. +
  • +
`, + name: 'Your first name (optional)', + sessionLanguage: + 'The session is in English. You can switch the language at the top of this page at any time.', + agree: 'I agree to the recording and processing described above.', + start: 'Start the session', + ask: 'Ask the moderator', + askHint: 'or just pause after a question', + end: 'End the session', + you: 'You', + youTyped: 'You (typed)', + typedLabel: + "Can't talk out loud, or is the microphone not working? Type your answer here instead.", + typedPlaceholder: 'Type your answer…', + send: 'Send', + sendHint: 'Enter sends; Shift+Enter starts a new line.', + recording: '● recording', + noVoice: + 'This browser has no English voice, so the moderator may sound odd.', + status: { + starting: 'Starting…', + thinking: 'Thinking…', + speaking: 'Speaking…', + listening: 'Listening…', + noAnswer: + 'The moderator is not answering. Keep going; it will try again.', + yourTurn: 'Your turn: type below.', + micTyping: 'The microphone is not working here. Type your answers below.', + saving: 'Saving the recording…', + ended: 'Thank you! The session has ended; you can close both windows.', + }, + errors: { + noCode: 'This page needs the invite link you received.', + notAllowed: + 'The session needs screen sharing. Please allow it and try again.', + cannotStart: message => + `Could not start the session (${message}). Is the invite link complete?`, + }, + }, + + 'nl-NL': { + title: 'Probeer de nieuwe plugins van Atomic', + languageLabel: 'Taal', + // HTML + intro: `

+ Bedankt voor je hulp! Ongeveer 25 minuten lang probeer je een nieuw + deel van Atomic, terwijl een gespreksleider (Claude, een AI) je met + een stem vraagt wat je ziet en denkt. Er zijn geen foute antwoorden: + we testen de app, niet jou. +

+
    +
  • Zoek een rustige plek waar je kunt praten, en zet een koptelefoon op.
  • +
  • Gebruik Chrome of Edge op een laptop of desktop.
  • +
  • + Als je begint, opent een tweede venster met je eigen lege + Atomic-drive. Zet het naast dit venster; laat dit venster open. +
  • +
  • + Als Chrome vraagt wat je wilt delen, kies dan je + hele scherm, zodat de gespreksleider ook het + Atomic-venster ziet. +
  • +
  • + De Atomic-app zelf is in het Engels. Dat hoort zo; je hoeft dat + niet te veranderen. +
  • +
`, + unsupported: + 'Deze browser kan geen spraak herkennen. Je kunt je antwoorden wel typen, of deze pagina in Chrome of Edge openen om te praten.', + // HTML + consent: `

Wat er wordt opgenomen en waar het heen gaat

+
    +
  • + Je scherm (het venster of scherm dat je kiest om te delen) en je + microfoon worden opgenomen en op onze testserver bewaard. +
  • +
  • + Je browser zet je spraak om in tekst; Chrome doet dat via de + spraakdienst van Google. +
  • +
  • + Die tekst (of wat je in plaats daarvan typt), bij elke beurt een schermafbeelding van je gedeelde + scherm, en het foutenlog van de app gaan naar de Claude API van + Anthropic, om te bepalen wat de gespreksleider daarna zegt. +
  • +
  • + Als je je eigen accounts koppelt (bijvoorbeeld Google Agenda), + worden de geïmporteerde gegevens ook op de testserver bewaard. Je + kunt ze daarna weer ontkoppelen. +
  • +
  • + De opnames worden alleen gebruikt om Atomic te verbeteren en na de + analyse verwijderd. +
  • +
`, + name: 'Je voornaam (optioneel)', + sessionLanguage: + 'De sessie is in het Nederlands. Je kunt de taal bovenaan deze pagina op elk moment wisselen.', + agree: 'Ik ga akkoord met de opname en verwerking die hierboven staan.', + start: 'Start de sessie', + ask: 'Vraag het de gespreksleider', + askHint: 'of wacht gewoon even na een vraag', + end: 'Beëindig de sessie', + you: 'Jij', + youTyped: 'Jij (getypt)', + typedLabel: + 'Kun je niet hardop praten, of werkt de microfoon niet? Typ je antwoord dan hier.', + typedPlaceholder: 'Typ je antwoord…', + send: 'Versturen', + sendHint: 'Enter verstuurt; Shift+Enter begint een nieuwe regel.', + recording: '● opname loopt', + noVoice: + 'Deze browser heeft geen Nederlandse stem, dus de gespreksleider kan vreemd klinken.', + status: { + starting: 'Bezig met starten…', + thinking: 'Even denken…', + speaking: 'Aan het woord…', + listening: 'Luistert…', + noAnswer: + 'De gespreksleider antwoordt niet. Ga gewoon door; hij probeert het zo opnieuw.', + yourTurn: 'Jouw beurt: typ hieronder.', + micTyping: 'De microfoon werkt hier niet. Typ je antwoorden hieronder.', + saving: 'De opname wordt opgeslagen…', + ended: 'Bedankt! De sessie is afgelopen; je kunt beide vensters sluiten.', + }, + errors: { + noCode: + 'Deze pagina heeft de uitnodigingslink nodig die je hebt gekregen.', + notAllowed: + 'De sessie heeft schermdelen nodig. Sta dat toe en probeer het opnieuw.', + cannotStart: message => + `De sessie kon niet starten (${message}). Is de uitnodigingslink compleet?`, + }, + }, +}; diff --git a/usertest/page/index.html b/usertest/page/index.html index d33fc7c9b..25af3dcd1 100644 --- a/usertest/page/index.html +++ b/usertest/page/index.html @@ -73,101 +73,66 @@ #status { font-weight: 600; } #log p { margin: 0.4rem 0; } #log .me { color: var(--muted); } + #langs { + display: flex; + gap: 0.5rem; + justify-content: flex-end; + flex-wrap: wrap; + margin-bottom: 1rem; + } + #langs button { padding: 0.3rem 0.7rem; font-size: 0.9rem; } + #langs button[aria-pressed='false'] { + background: transparent; + color: var(--accent); + } [hidden] { display: none !important; }
-

Try Atomic's new plugins

+ + +

-

- Thanks for helping! For about 25 minutes you'll try a new part of - Atomic while a voice moderator (Claude, an AI) asks you what you - see and think. There are no wrong answers: we are testing the app, - not you. -

-
    -
  • Find a quiet place where you can talk, and put on headphones.
  • -
  • Use Chrome or Edge on a laptop or desktop.
  • -
  • - When you start, a second window opens with your own empty Atomic - drive. Put it next to this one; keep this window open. -
  • -
  • - When Chrome asks what to share, choose your - entire screen, so the moderator sees the Atomic - window too. -
  • -
- +
+