From b96f3d3d0e1cf214da5e56557ff7f18d4fc0a360 Mon Sep 17 00:00:00 2001 From: George Turkington Date: Mon, 5 Oct 2026 06:16:28 +0000 Subject: [PATCH] Fix blank screen on the pronoun levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening Singular Pronomen rendered nothing at all. The console said "Cannot read properties of undefined (reading 'w')". My regression, from the commit that added the "why Regens?" explainer. That button is rendered on the screen shared by the article, contraction, possessive AND pronoun questions, and its visibility test calls nounForm(q.noun, q.cas) — but pronoun questions have no noun. The read threw, React unmounted the tree, and the whole page went blank rather than losing just that one line. Guarded the access. Then swept all 32 levels across the six tabs in a real browser: every one renders with no page errors. Also wrote the contract down, since this is the second field a screen has dereferenced without checking. engine.test.js now asserts which question types carry a noun and which deliberately do not, that pronoun questions stay noun-less (so the guard keeps being necessary rather than quietly redundant), and that every question of every type has an answer and a blank to fill. A new question type that lands on a shared screen without the fields that screen reads is now a test failure instead of a blank page. 170 tests pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_017Uza6mhTpAvSwMQuFc4Cz8 --- src/App.jsx | 3 ++- src/engine.test.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 3beb3a1..c935f3b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -606,7 +606,8 @@ export default function App() { {q.tw !== null && q.tw !== undefined && <> · {q.tw ? '→ motion' : '● location'}} - {nounForm(q.noun, q.cas) !== q.noun.w && ( + {/* Pronoun questions have no noun at all, so this must be guarded. */} + {q.noun && nounForm(q.noun, q.cas) !== q.noun.w && (