fix(frontend): add X-Accel-Buffering to sse stream and optimize textarea input height resize

This commit is contained in:
2026-06-04 11:16:21 -07:00
parent 48ab562577
commit 9def97c3a5
2 changed files with 8 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ export async function GET(
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache, no-transform",
Connection: "keep-alive",
"X-Accel-Buffering": "no",
},
});
}

View File

@@ -2025,8 +2025,13 @@ export function ChatPanel({
}}
onInput={(e) => {
const el = e.currentTarget;
const newlines = (el.value.match(/\n/g) || []).length;
// Cache lastNewlines on the DOM element to avoid state re-render lag
if ((el as any).lastNewlines !== newlines) {
(el as any).lastNewlines = newlines;
el.style.height = "auto";
el.style.height = Math.min(el.scrollHeight, 120) + "px";
}
}}
/>
{selectToggle}