feat(webui): add lightweight session messaging via mentions
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { SessionHandle } from "@/lib/types";
|
||||
|
||||
interface MarkdownTextProps {
|
||||
children: string;
|
||||
@@ -15,6 +16,7 @@ interface MarkdownTextProps {
|
||||
streaming?: boolean;
|
||||
preserveStreamingLayout?: boolean;
|
||||
onOpenFilePreview?: (path: string) => void;
|
||||
sessionHandles?: SessionHandle[];
|
||||
}
|
||||
|
||||
const loadMarkdownRenderer = () => import("@/components/MarkdownTextRenderer");
|
||||
@@ -26,12 +28,14 @@ const MemoizedMarkdownRenderer = memo(function MemoizedMarkdownRenderer({
|
||||
highlightCode,
|
||||
streaming,
|
||||
onOpenFilePreview,
|
||||
sessionHandles,
|
||||
}: {
|
||||
source: string;
|
||||
className?: string;
|
||||
highlightCode: boolean;
|
||||
streaming: boolean;
|
||||
onOpenFilePreview?: (path: string) => void;
|
||||
sessionHandles?: SessionHandle[];
|
||||
}) {
|
||||
return (
|
||||
<LazyMarkdownRenderer
|
||||
@@ -39,6 +43,7 @@ const MemoizedMarkdownRenderer = memo(function MemoizedMarkdownRenderer({
|
||||
highlightCode={highlightCode}
|
||||
streaming={streaming}
|
||||
onOpenFilePreview={onOpenFilePreview}
|
||||
sessionHandles={sessionHandles}
|
||||
>
|
||||
{source}
|
||||
</LazyMarkdownRenderer>
|
||||
@@ -77,6 +82,7 @@ export function MarkdownText({
|
||||
streaming = false,
|
||||
preserveStreamingLayout = false,
|
||||
onOpenFilePreview,
|
||||
sessionHandles,
|
||||
}: MarkdownTextProps) {
|
||||
const renderedSource = children;
|
||||
const renderPhase = streaming ? "streaming" : "complete";
|
||||
@@ -108,6 +114,7 @@ export function MarkdownText({
|
||||
highlightCode={highlightCode}
|
||||
streaming={renderWithStreamingLayout}
|
||||
onOpenFilePreview={onOpenFilePreview}
|
||||
sessionHandles={sessionHandles}
|
||||
/>
|
||||
</Suspense>
|
||||
</MarkdownRendererBoundary>
|
||||
|
||||
Reference in New Issue
Block a user