[Bug]: React #185 loop returns in the resting composer controls after #9393 #9481
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
Desktop / web UI
Steps to reproduce#
Open the app with the composer at rest and the resting controls cluster sitting within ~1px of an overflow threshold (a sidebar width where a trailing block is about to move into the overflow menu), then click New thread.
Expected behavior#
The thread opens.
Actual behavior#
The renderer crashes with Minified React error #185 ("Maximum update depth exceeded").
Impact#
Crashes the renderer.
Version or commit#
Build tracking main; the affected code is identical at d2b6f3b92.
Environment#
macOS 27.0.0 (Darwin), Electron desktop.
Logs or stack traces#
Error: Minified React error #185
at ChatView-BXKdiQa4.js:10:49445
-> apps/web/src/components/chat/ChatComposer.tsx:878:5 (setLayout)
Diagnosis#
Resolving the minified frame through the bundle's own sourcemap lands on apps/web/src/components/chat/ChatComposer.tsx:878 (setLayout), inside useRestingComposerControlsLayout. useLayoutEffect(measure) carries no dependency array, so it re-measures on every render, and setLayout re-resolves the layout from that measurement.
resolveRestingComposerControlsLayout is pure and stable given a stable measurement — but the measurement is not stable. providerModelPickerNaturalWidth computes min(renderedWidth + hiddenLabelWidth, maxWidth), where scrollWidth/clientWidth are integers while getBoundingClientRect().width is fractional. As the flexible picker grows and shrinks, that sum varies by a fraction of a pixel. With hostWidth exactly on a threshold, hiddenCount flips every render and React aborts after ~50 nested updates.
#9393 removed the strip-reservation feedback path; this one survives it, because it runs entirely inside the composer's own measure -> resolve -> render cycle. Follow-up to #9390.
juliusmarminge closed this
Sign in to join this conversation.