Skip to content

Commit 5fe0b5e

Browse files
t3dotggclaude
andcommitted
perf(web): skip the caret layout read when recall cannot step
A typed draft with no active recall never steps, so return before the DOM measurement and the entry build for that common case. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent b2530ad commit 5fe0b5e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,6 +3019,11 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
30193019
) {
30203020
return false;
30213021
}
3022+
// A typed draft with no active recall can never step, so skip the
3023+
// layout read and the entry build for that common case.
3024+
if (promptHistoryPositionRef.current === null && promptRef.current.length > 0) {
3025+
return false;
3026+
}
30223027
const editor = composerEditorRef.current;
30233028
if (!editor?.isCaretOnVisualEdge(direction === "backward" ? "start" : "end")) {
30243029
return false;

0 commit comments

Comments
 (0)