CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.
TypeScript ai-agentsai-diagramai-presentationbomcadcanvasdiagramdiagram-generatordrawioflowchartinfographicspptppt-generatorpresentation-generatorreactsvgedittext-to-diagramtypescriptworkflow
refactor: delete the chat props nobody reads
codingFeng101ecacae730dbd
diff --git a/client/pages/portal/PortalPage.tsx b/client/pages/portal/PortalPage.tsxindex 812bc95..274d29d 100644--- a/client/pages/portal/PortalPage.tsx+++ b/client/pages/portal/PortalPage.tsx@@ -295,7 +295,6 @@ function OrbitCard({function Header({uiLang,copy,- activeCanvas,activeSection,setActiveSection,setActiveCanvas,@@ -303,7 +302,6 @@ function Header({}: {uiLang: UiLanguage;copy: { home: string; openRepo: string };- activeCanvas: PortalWorkspace;activeSection: PortalSection;setActiveSection: (section: PortalSection) => void;setActiveCanvas: (workspace: PortalWorkspace) => void;@@ -644,7 +642,6 @@ export function PortalPage({ onEnterWorkspace }: PortalPageProps) {<HeaderuiLang={uiLang}copy={copy}- activeCanvas={activeCanvas}activeSection={activeSection}setActiveSection={setActiveSection}setActiveCanvas={setActiveCanvas}diff --git a/client/workspaces/cad/chat/ChatMessageDisplay.tsx b/client/workspaces/cad/chat/ChatMessageDisplay.tsxindex a41989b..856dbeb 100644--- a/client/workspaces/cad/chat/ChatMessageDisplay.tsx+++ b/client/workspaces/cad/chat/ChatMessageDisplay.tsx@@ -29,7 +29,6 @@ export type { MessagePart, UIMessage };// Typesinterface ChatMessageDisplayProps {messages: UIMessage[];- setInput: (input: string) => void;onApplyCode?: (code: string, language?: string) => void | boolean | Promise<void | boolean>;onRegenerate?: (messageIndex: number) => void;onEditMessage?: (messageIndex: number, newText: string) => void;@@ -222,7 +221,6 @@ function CadPatchEditsDisplay({ edits, uiLang }: { edits: CadPatchEdit[]; uiLangexport function ChatMessageDisplay({messages,- setInput,onApplyCode,onRegenerate,onEditMessage,diff --git a/client/workspaces/cad/chat/ChatPanel.tsx b/client/workspaces/cad/chat/ChatPanel.tsxindex 28b7306..b7a6b4b 100644--- a/client/workspaces/cad/chat/ChatPanel.tsx+++ b/client/workspaces/cad/chat/ChatPanel.tsx@@ -73,9 +73,6 @@ interface ChatPanelProps {svg2d?: string;analysisImages?: Array<{ title: string; url: string }>;};- flowContext?: {- xml?: string;- };onClearWorkspace?: () => void;}@@ -103,7 +100,6 @@ export function ChatPanel({onClearVersionHistory,onClearAttachments,cadContext,- flowContext,onClearWorkspace}: ChatPanelProps) {const uiLang = useUiLanguage();@@ -2395,7 +2391,6 @@ export function ChatPanel({<div className="flex-1 w-full overflow-hidden"><ChatMessageDisplaymessages={uiMessages}- setInput={setInput}status={isLoading ? "streaming" : "idle"}onDisplayChart={(xml) => onCodeAction?.(xml, 'flow')}onApplyCode={applyCodeFromMessage}diff --git a/client/workspaces/flow/chat/ChatMessageDisplay.tsx b/client/workspaces/flow/chat/ChatMessageDisplay.tsxindex 7f553ee..f5df7ca 100644--- a/client/workspaces/flow/chat/ChatMessageDisplay.tsx+++ b/client/workspaces/flow/chat/ChatMessageDisplay.tsx@@ -115,10 +115,7 @@ function stripFileSectionsFromText(text: string): string {// Get only the user's original text, excluding appended file contentinterface ChatMessageDisplayProps {messages: UIMessage[]- setInput: (input: string) => void- setFiles: (files: File[]) => voidprocessedToolCallsRef: MutableRefObject<Set<string>>- sessionId?: stringonRegenerate?: (messageIndex: number) => voidonEditMessage?: (messageIndex: number, newText: string) => voidstatus?: "streaming" | "submitted" | "idle" | "error" | "ready"@@ -127,10 +124,7 @@ interface ChatMessageDisplayProps {export function ChatMessageDisplay({messages,- setInput,- setFiles,processedToolCallsRef,- sessionId,onRegenerate,onEditMessage,status = "idle",diff --git a/client/workspaces/flow/chat/ChatPanel.tsx b/client/workspaces/flow/chat/ChatPanel.tsxindex fd368f4..0cabc84 100644--- a/client/workspaces/flow/chat/ChatPanel.tsx+++ b/client/workspaces/flow/chat/ChatPanel.tsx@@ -1353,10 +1353,7 @@ Please fix the XML issues. Ensure cell_id values exist in the current XML and th<main className="flex-1 w-full overflow-hidden min-h-0"><ChatMessageDisplaymessages={messages}- setInput={setInput}- setFiles={handleFileChange}processedToolCallsRef={processedToolCallsRef}- sessionId={sessionId}onRegenerate={handleRegenerate}status={status}isParsingFiles={isParsingFiles}diff --git a/client/workspaces/ppt/chat/ChatMessageDisplay.tsx b/client/workspaces/ppt/chat/ChatMessageDisplay.tsxindex 901d371..d81d213 100644--- a/client/workspaces/ppt/chat/ChatMessageDisplay.tsx+++ b/client/workspaces/ppt/chat/ChatMessageDisplay.tsx@@ -29,7 +29,6 @@ export type { MessagePart, UIMessage };// Typesinterface ChatMessageDisplayProps {messages: UIMessage[];- setInput: (input: string) => void;onRegenerate?: (messageIndex: number) => void;onEditMessage?: (messageIndex: number, newText: string) => void;status?: "streaming" | "submitted" | "idle" | "error" | "ready";@@ -39,7 +38,6 @@ interface ChatMessageDisplayProps {// Helper to split text content into regular text and file sectionsexport function ChatMessageDisplay({messages,- setInput,onRegenerate,onEditMessage,status = "idle",@@ -595,7 +593,7 @@ export function ChatMessageDisplay({pre({ children }: any) {return <>{children}</>;},- code({ node, inline, className, children, ...props }: any) {+ code({ node: _node, inline, className, children, ...props }: any) {const match = /language-(\w+)/.exec(className || "");const isStreaming = status === "streaming" && isLastAssistantMessage;const language = match?.[1] || "text";diff --git a/client/workspaces/ppt/chat/ChatPanel.tsx b/client/workspaces/ppt/chat/ChatPanel.tsxindex aeafee0..0dfc87f 100644--- a/client/workspaces/ppt/chat/ChatPanel.tsx+++ b/client/workspaces/ppt/chat/ChatPanel.tsx@@ -53,9 +53,6 @@ interface ChatPanelProps {plan?: any;svg2d?: string;};- flowContext?: {- xml?: string;- };onClearWorkspace?: () => void;}@@ -664,7 +661,6 @@ const getPptTag = (slideId: string, title: string, kind: "outline" | "slide_imag<div className="flex-1 w-full overflow-hidden"><ChatMessageDisplaymessages={uiMessages}- setInput={setInput}status={isLoading ? "streaming" : "idle"}onDisplayChart={(xml) => onCodeAction?.(xml, 'flow')}onRegenerate={handleRegenerate}diff --git a/server/routes/chat.ts b/server/routes/chat.tsindex b051c87..922877c 100644--- a/server/routes/chat.ts+++ b/server/routes/chat.ts@@ -363,7 +363,7 @@ ${parsedFilesContext ? `\n\nParsed file summaries:\n"""md\n${parsedFilesContext}}// Normalize messages to expected format (convert content to parts if needed)- const normalizedMessages = messages.map((message: any, index: number) => {+ const normalizedMessages = messages.map((message: any, _index: number) => {// Handle completely malformed messagesif (!message) {return { role: 'user', parts: [{ type: 'text', text: '' }] }