Task 3: Simplify `helper.js`
**Files:** - Modify: `lib/brainstorm-server/helper.js` - [ ] **Step 1: Remove `sendToClaude` function** Delete the `sendToClaude` function (lines 92-106) — the function body and the page takeover HTML. - [ ] **Step 2: Remove `window.send` function** Delete the `window.send` function (lines 120-129) — was tied to the removed Send button. - [ ] **Step 3: Remove form submission and input change handlers** Delete the form submission handler (lines 57-71) and the input change handler (lines 73-89) including the `inputTimeout` variable. - [ ] **Step 4: Remove `pageshow` event listener** Delete the `pageshow` listener we added earlier (no textarea to clear anymore). - [ ] **Step 5: Narrow click handler to `[data-choice]` only** Replace the click handler (lines 36-55) with a narrower version: ```javascript // Capture clicks on choice elements document.addEventListener('click', (e) => { const target = e.target.closest('[data-choice]'); if (!target) return; sendEvent({ type: 'click', text: target.textContent.trim(), choice: target.dataset.choice, id: target.id || null }); }); ``` - [ ] **Step 6: Add indicator bar update on choice click** After the `sendEvent` call in the click handler, add: ```javascript // Update indicator bar const indicator = document.getElementById('indicator-text'); if (indicator) { const label = target.querySelector('h3, .content h3, .card-body h3')?.textContent?.trim() || target.dataset.choice; indicator.innerHTML = '' + label + ' selected — return to terminal to continue'; } ``` - [ ] **Step 7: Remove `sendToClaude` from `window.brainstorm` API** Update the `window.brainstorm` object (lines 132-136) to remove `sendToClaude`: ```javascript window.brainstorm = { send: sendEvent, choice: (value, metadata = {}) => sendEvent({ type: 'choice', value, ...metadata }) }; ``` - [ ] **Step 8: Run tests** ```bash cd /Users/drewritter/prime-rad/superpowers && node tests/brainstorm-server/server.test.js ``` - [ ] **Step 9: Commit** ```bash git add lib/brainstorm-server/helper.js git commit -m "Simplify helper.js: remove feedback functions, narrow to choice capture + indicator" ``` ---