Uh oh!
There was an error while loading. Please reload this page.
fix(chat): re-measure the prompt editor when its width changes - #6380
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Adds Reviewed by Cursor Bugbot for commit 8130737. Configure here. |
Greptile SummaryThe PR fixes prompt-editor sizing after container-width changes by observing the scroller and re-running autosizing on each distinct width, including the observer’s first delivery.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx | Adds a width-sensitive ResizeObserver whose first notification re-measures the textarea, resolving the previously reported missed-width window. |
| apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.test.tsx | Adds deterministic coverage for width remeasurement, the first asynchronous observer delivery, loop prevention, and observer cleanup. |
Reviews (3): Last reviewed commit: "chore(chat): trim duplicated comments on..." | Re-trigger Greptile
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1
commented
Aug 7, 2026
waleedlatif1
commented
Aug 7, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 50b2c87. Configure here.
The chat input's textarea grows to its full content height under a mirror overlay, but it only re-measured on text change. A width change after typing (window resize, sidebar toggle, resource panel opening) left the textarea at a stale inline height while the overlay rewrapped taller. The spilled lines still painted and scrolled but had no textarea beneath them, so clicks landed on the scroller and never placed a caret. Re-measure on width change only — the measure writes the textarea's height, so reacting to height would feed itself.
The width can change between the mount-time measure and observe(), so treating the first notification as confirmation of the mount width dropped that change and left the stale height in place.
The failure mode was documented in four places. Keeps one canonical explanation next to the guard and leaves only the per-test whys the test names do not already carry.
50b2c87 to
8130737Comparewaleedlatif1
commented
Aug 7, 2026
waleedlatif1
commented
Aug 7, 2026
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8130737. Configure here.
Summary
ResizeObserverthat re-measures on width change only — the measure writes the textarea's height, so reacting to height would feed itself.Type of Change
Testing
6 unit tests in
prompt-editor.test.tsx. Verified each fails against a broken implementation — removing the observer, dropping the width guard, and skippingdisconnecton unmount each turn tests red.Also reproduced and confirmed the fix in a real browser against the same CSS structure: dead zone 260px → 0, click hit target back to the textarea, caret lands correctly, and no
ResizeObserverloop errors across repeated and sub-pixel width changes.Checklist