Fix assistant white screen when sending chat messages
Fix
Submitting an assistant message with Enter or clicking an example prompt blanked the console in Chrome 157. The chat scroll effect implicitly returned scrollIntoView()'s Promise, which React treated as an effect cleanup function. On the next update, React tried to call it and threw Uncaught TypeError: Y is not a function.
Use a block-bodied effect so scrolling never returns a cleanup value. This fixes the regression introduced by #75 without changing chat actions, authentication or the proxy.
Evidence and regression coverage
- Reproduced both reported interactions against the unpatched production build in installed Chrome 157.0.8103.51, using native scrolling (no scroll mock). Both failed with the exact
Y is not a functionerror. The deployedindex-DkZAc3R8.js:8:93160points to React callingm.destroy. - Chrome 157 returns a Promise from native
scrollIntoView(); the earlier Playwright Chromium 149.0.7827.55 returnedundefined. This explains why the earlier browser checks missed it. Chrome's documentation covers the API change. - Added six production-browser tests: Enter and example clicks with native, Promise-returning and void-returning scrolling. Each checks a follow-up message, an intact dashboard, leaving the assistant, and no page errors. Capve/OpenAI responses are local fixtures; no real credentials or external account are used.
- The new suite runs in CI after the production build, with explicit Promise coverage even on older Chromium versions.
Validation
bun run typecheckpassed.bun run buildpassed.bun run test: all 34 Workers test files passed.bun run test:browser: all 6 cases passed on Chromium 149.PLAYWRIGHT_CHANNEL=chrome bun run test:browser: all 6 cases passed on Chrome 157, including both native regressions.
No production deployment performed. After approval and green CI, Martin can merge and let the normal deployment workflow ship the fix.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the assistant white screen in Chrome 157 when sending a message with Enter or clicking an example prompt. Chrome's scrollIntoView() now returns a Promise, and the chat scroll effect returned it as React's effect cleanup function, which threw on the next update. The effect now uses a block body so it never returns a cleanup value.
Adds six production-browser tests with local fixtures covering Enter and example triggers with native, Promise-returning, and void-returning scrolling, run in CI after the build.