From aff9ccf98a7b07d18d9c23a4c05b762078bbc6d7 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 25 May 2026 23:22:06 -0700 Subject: [PATCH] =?UTF-8?q?[eric]=20windows=201.1.57:=20four=20fixes=20?= =?UTF-8?q?=E2=80=94=20(a)=20textarea=20Enter-to-send=20now=20actually=20c?= =?UTF-8?q?lears=20the=20input=20(missed=20editor.innerHTML=3D''=20at=20Ch?= =?UTF-8?q?atInput.tsx:181=20in=20the=20post-send=20path);=20(b)=20textare?= =?UTF-8?q?a=20draft=20restore=20(useDraftLoad)=20routes=20through=20.valu?= =?UTF-8?q?e=20instead=20of=20innerHTML=20on=20Windows=20so=20a=20saved=20?= =?UTF-8?q?draft=20repopulates=20the=20input=20on=20remount;=20(c)=20resto?= =?UTF-8?q?re=20the=20=20+=20attach=20button=20on?= =?UTF-8?q?=20Windows=20since=20the=20original=201.1.54=20crash=20root=20c?= =?UTF-8?q?ause=20was=20the=20contentEditable=20TSF=20init=20not=20the=20f?= =?UTF-8?q?ile=20input=20=E2=80=94=20replacing=20contentEditable=20with=20?= =?UTF-8?q?textarea=20was=20the=20actual=20fix,=20file=20input=20was=20ove?= =?UTF-8?q?r-ablated;=20(d)=20relax=20CSP=20frame-src=20to=20allow=20http:?= =?UTF-8?q?/https:=20so=20BrowserCard=20iframe=20can=20render=20external?= =?UTF-8?q?=20sites;=20(e)=20gate=20AgenticCursor's=20portaled=20Framer=20?= =?UTF-8?q?Motion=20infinite-loop=20animation=20on=20Windows=20so=20onboar?= =?UTF-8?q?ding=20panel=20commit=20no=20longer=200xC0000005=20segfaults;?= =?UTF-8?q?=20Mac=20path=20untouched?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/app/pages/AgentChat/ChatInput.tsx | 2 +- .../app/pages/AgentChat/ChatInput/hooks/draftStore.ts | 11 ++++++++++- .../AgentChat/ChatInput/toolbar/ToolbarActions.tsx | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/pages/AgentChat/ChatInput.tsx b/frontend/src/app/pages/AgentChat/ChatInput.tsx index c0fb6eec..1dea3b31 100644 --- a/frontend/src/app/pages/AgentChat/ChatInput.tsx +++ b/frontend/src/app/pages/AgentChat/ChatInput.tsx @@ -178,7 +178,7 @@ const ChatInput = forwardRef(({ onSend, disabled, mode, sendSkills, browserIds.length > 0 ? browserIds : undefined, ); - editor.innerHTML = ''; + if (editor.tagName === 'TEXTAREA') (editor as unknown as HTMLTextAreaElement).value = ''; else editor.innerHTML = ''; deleteDraft(ownerId); for (const img of images) { if (img.preview?.startsWith('blob:')) { diff --git a/frontend/src/app/pages/AgentChat/ChatInput/hooks/draftStore.ts b/frontend/src/app/pages/AgentChat/ChatInput/hooks/draftStore.ts index 9186b787..15dbe594 100644 --- a/frontend/src/app/pages/AgentChat/ChatInput/hooks/draftStore.ts +++ b/frontend/src/app/pages/AgentChat/ChatInput/hooks/draftStore.ts @@ -29,7 +29,16 @@ export function useDraftLoad(editorRef: RefObject, ownerId: stri useEffect(() => { const saved = _draftStore.get(ownerId); const editor = editorRef.current; - if (saved && editor && !editor.textContent?.trim()) { + if (!saved || !editor) return; + // Textarea path (Windows ablation): drafts were saved as plain text in .value, so just restore as text. The div path below is for contentEditable on Mac where drafts are HTML with skill pills. + if (editor.tagName === 'TEXTAREA') { + const ta = editor as unknown as HTMLTextAreaElement; + if (ta.value.trim()) return; + ta.value = saved; + try { ta.selectionStart = ta.selectionEnd = ta.value.length; } catch (_) {} + return; + } + if (!editor.textContent?.trim()) { editor.innerHTML = saved; const range = document.createRange(); range.selectNodeContents(editor); diff --git a/frontend/src/app/pages/AgentChat/ChatInput/toolbar/ToolbarActions.tsx b/frontend/src/app/pages/AgentChat/ChatInput/toolbar/ToolbarActions.tsx index 3c7c3899..5fb8fc8e 100644 --- a/frontend/src/app/pages/AgentChat/ChatInput/toolbar/ToolbarActions.tsx +++ b/frontend/src/app/pages/AgentChat/ChatInput/toolbar/ToolbarActions.tsx @@ -3,8 +3,9 @@ import Box from '@mui/material/Box'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; -// Windows-only ablation: mounting a hidden on Windows initializes the IFileDialog COM shim which is implicated in the Chromium 144 + Electron 40 commit-phase segfault. We hide both the file input and its trigger button on Windows; drag-and-drop file attach still works via the AttachmentChips drop zone. Mac unchanged. +// File input was ablated in v1.1.54 as a suspected crasher, but the actual crasher turned out to be contentEditable's TSF init (now replaced with textarea in EditorSurface). Restored on both platforms in v1.1.57. Keeping IS_WIN reference removal would require touching call sites; harmless left here as a constant. const IS_WIN = typeof navigator !== 'undefined' && navigator.userAgent.includes('Windows'); +void IS_WIN; import MicNoneOutlinedIcon from '@mui/icons-material/MicNoneOutlined'; import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward'; import StopIcon from '@mui/icons-material/Stop'; @@ -92,7 +93,7 @@ export const ToolbarActions: React.FC = ({ })()} {/* Windows-only ablation: hidden + attach button skipped on Windows to test whether IFileDialog COM init is the trigger for the Chromium 144 commit-phase segfault. Mac still renders both (drag/paste/click attach all work). On Windows, drag-and-drop attach still works via AttachmentChips drop zone. */} - {!IS_WIN && ( + {true && ( = ({ }} /> )} - {!IS_WIN && ( + {true && (