From ead27dabcce7f516053deb88d00e6289061edf6d Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sun, 5 Jul 2026 16:19:12 -0700 Subject: [PATCH] [eric] paste-dialog: uncontrolled editor (large pastes typed like molasses through controlled MUI autosize) --- .../ChatInput/view/PastePreviewDialog.tsx | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/frontend/src/app/pages/AgentChat/ChatInput/view/PastePreviewDialog.tsx b/frontend/src/app/pages/AgentChat/ChatInput/view/PastePreviewDialog.tsx index d4ca875e..213bcc31 100644 --- a/frontend/src/app/pages/AgentChat/ChatInput/view/PastePreviewDialog.tsx +++ b/frontend/src/app/pages/AgentChat/ChatInput/view/PastePreviewDialog.tsx @@ -1,8 +1,7 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState } from 'react'; import Dialog from '@mui/material/Dialog'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; -import TextField from '@mui/material/TextField'; import { useClaudeTokens } from '@/shared/styles/ThemeContext'; import { getPasteContent } from '@/app/components/editor/richEditorUtils'; @@ -12,25 +11,48 @@ interface Props { onSave: (pasteId: string, text: string) => void; } +// Uncontrolled on purpose: huge pastes are this dialog's whole job, and a controlled MUI autosize field re-reconciles the full string + re-measures a shadow textarea per keystroke (typing molasses at ~300KB). +const PasteEditor: React.FC<{ pasteId: string; initial: string; onSave: Props['onSave']; onCount: (n: number) => void }> = ({ pasteId, initial, onSave, onCount }) => { + const c = useClaudeTokens(); + return ( +