hot fix for j dawg

This commit is contained in:
Nate Kelley 2025-08-21 14:50:58 -06:00
parent 253a6b427a
commit 39b68445a0
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 18 additions and 10 deletions

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "next dev --turbo", "dev": "next dev --turbo",
"dev:fast": "make start-fast", "dev:fast": "make fast",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint && npx prettier --write . '!src/components/ui/icons/**' --log-level error", "lint": "next lint && npx prettier --write . '!src/components/ui/icons/**' --log-level error",

View File

@ -64,6 +64,9 @@ export const ReportEditor = React.memo(
// Initialize the editor instance using the custom useEditor hook // Initialize the editor instance using the custom useEditor hook
const isReady = useRef(false); const isReady = useRef(false);
// readOnly = true;
// isStreaming = true;
const editor = useReportEditor({ const editor = useReportEditor({
isStreaming, isStreaming,
mode, mode,
@ -127,12 +130,12 @@ export const ReportEditor = React.memo(
variant={variant} variant={variant}
readonly={readOnly} readonly={readOnly}
disabled={disabled} disabled={disabled}
className={containerClassName}> className={cn('pb-[20vh]', containerClassName)}>
<Editor <Editor
style={style} style={style}
placeholder={placeholder} placeholder={placeholder}
disabled={disabled} disabled={disabled}
className={cn('pb-[20vh]', className)} className={className}
autoFocus autoFocus
/> />
</EditorContainer> </EditorContainer>

View File

@ -53,14 +53,19 @@ export const StreamContentPlugin = createPlatePlugin({
} }
// Prevent undo/redo and defer normalization for performance // Prevent undo/redo and defer normalization for performance
editor.tf.withScrolling(() => { editor.tf.withScrolling(
editor.tf.withoutSaving(() => { () => {
editor.tf.withoutNormalizing(() => { editor.tf.withoutSaving(() => {
const operations = buildUpdateOperations(editor, chunks); editor.tf.withoutNormalizing(() => {
executeOperations(operations); const operations = buildUpdateOperations(editor, chunks);
executeOperations(operations);
});
}); });
}); },
}); {
scrollOptions: { behavior: 'smooth' }
}
);
} }
} }
})); }));