You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(chat): trim duplicated comments on the prompt editor autosize
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.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.test.tsx
+5-24Lines changed: 5 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -33,12 +33,10 @@ let editorWidth = 700
33
33
letautosizeCalls=0
34
34
35
35
/**
36
-
* Mirrors the real observer's contract closely enough to test the width guard.
37
-
* `observe` only registers the target — real deliveries, including the initial
38
-
* one browsers send, are asynchronous, so every test drives them explicitly via
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx
+10-11Lines changed: 10 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -103,18 +103,17 @@ export function PromptEditor({
103
103
},[value,autosize])
104
104
105
105
/**
106
-
* Re-measure when the editor's width changes. The textarea carries an inline
107
-
* pixel height, so a width change (window resize, sidebar or side-panel
108
-
* toggle, chat column reflow) rewraps the text taller while the box stays at
109
-
* its old height. The mirror overlay paints the full text regardless, so the
110
-
* spilled lines render over the scroller with no textarea beneath them —
111
-
* visible, scrollable text that swallows clicks instead of placing the caret.
106
+
* The textarea carries an inline pixel height, so a width change (window
107
+
* resize, sidebar toggle, chat column reflow) rewraps the text taller while
108
+
* the box stays at its old height. The mirror overlay paints the full text
109
+
* regardless, so the spilled lines render over the scroller with no textarea
110
+
* beneath them — visible, scrollable text that swallows clicks instead of
111
+
* placing the caret.
112
112
*
113
-
* Only width is compared: `autosize` writes the textarea's height, which grows
114
-
* the scroller until its cap and re-notifies this observer, so reacting to
115
-
* height would feed itself. The first delivery is measured like any other —
116
-
* the width can change between the mount-time measure and `observe()`, and
117
-
* re-measuring an unchanged width only writes the same height back.
113
+
* Only width is compared: `autosize` writes the textarea's height, which
114
+
* re-notifies this observer, so reacting to height would feed itself. The
115
+
* first delivery is measured like any other — the width can change between
0 commit comments