mirror of https://github.com/buster-so/buster.git
update streaming message
This commit is contained in:
parent
77af33a068
commit
f9bf526e6e
|
@ -24,7 +24,6 @@ export const StreamingMessageCode: React.FC<{
|
|||
modified?: [number, number][];
|
||||
animation?: 'blur-in' | 'fade-in';
|
||||
}> = React.memo(({ isStreamFinished, fileName, buttons, collapsible = false, text }) => {
|
||||
const [lineSegments, setLineSegments] = useState<LineSegment[]>([]);
|
||||
const { openSuccessMessage } = useBusterNotifications();
|
||||
|
||||
const copyToClipboard = () => {
|
||||
|
@ -49,64 +48,6 @@ export const StreamingMessageCode: React.FC<{
|
|||
return buttons;
|
||||
}, [buttons]);
|
||||
|
||||
// useEffect(() => {
|
||||
// const processText = () => {
|
||||
// // Split the text into lines, keeping empty lines
|
||||
// const lines = (text || '').split('\n');
|
||||
// const segments: LineSegment[] = [];
|
||||
// let currentLine = 1;
|
||||
|
||||
// if (!modified || modified.length === 0) {
|
||||
// for (const line of lines) {
|
||||
// segments.push({
|
||||
// type: 'text',
|
||||
// content: line,
|
||||
// lineNumber: currentLine++
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// // Sort modified ranges to ensure proper processing
|
||||
// const sortedModified = [...modified].sort((a, b) => a[0] - b[0]);
|
||||
|
||||
// let lastEnd = 0;
|
||||
// for (const [start, end] of sortedModified) {
|
||||
// // Add visible lines before the hidden section
|
||||
// for (let i = lastEnd; i < start - 1; i++) {
|
||||
// segments.push({
|
||||
// type: 'text',
|
||||
// content: lines[i],
|
||||
// lineNumber: currentLine++
|
||||
// });
|
||||
// }
|
||||
|
||||
// // Add hidden section
|
||||
// const hiddenLineCount = end - start + 1;
|
||||
// segments.push({
|
||||
// type: 'hidden',
|
||||
// content: '',
|
||||
// lineNumber: currentLine,
|
||||
// numberOfLines: hiddenLineCount
|
||||
// });
|
||||
// currentLine += hiddenLineCount;
|
||||
// lastEnd = end;
|
||||
// }
|
||||
|
||||
// // Add remaining visible lines after the last hidden section
|
||||
// for (let i = lastEnd; i < lines.length; i++) {
|
||||
// segments.push({
|
||||
// type: 'text',
|
||||
// content: lines[i],
|
||||
// lineNumber: currentLine++
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// setLineSegments(segments);
|
||||
// };
|
||||
|
||||
// processText();
|
||||
// }, [text, modified]);
|
||||
|
||||
return (
|
||||
<FileCard collapsible={collapsible} fileName={fileName} headerButtons={buttonComponent}>
|
||||
<div className="w-full pr-0">
|
||||
|
|
Loading…
Reference in New Issue