diff --git a/apps/web/src/ChatPanel.tsx b/apps/web/src/ChatPanel.tsx index 0b3a13e..d781259 100644 --- a/apps/web/src/ChatPanel.tsx +++ b/apps/web/src/ChatPanel.tsx @@ -11,6 +11,7 @@ export interface ChatSocket { const connectChat = (): ChatSocket => new WebSocket(`${location.protocol === "https:" ? "wss:" : "ws:"}//${location.host}/api/chat`); type Message = { role: "user" | "assistant" | "tool"; text: string; path?: string }; +/** notebookPath and openNotebook use app paths (relative to notebooks/); the chat wire uses workspace paths. */ export function ChatPanel({ notebookPath, openNotebook, openTerminal, connect = connectChat }: { notebookPath?: string; openNotebook(path: string): void; openTerminal(): void; connect?: () => ChatSocket; }) { @@ -77,7 +78,7 @@ export function ChatPanel({ notebookPath, openNotebook, openTerminal, connect =
{!messages.length &&

{selected ? "Continue this conversation. Earlier messages are retained by the Claude CLI; this view shows messages from this browser session." : "Ask Claude to create or edit a notebook. Do not send secrets."}

} {messages.map((m, i) =>
- {m.role === "tool" ? {m.text} {m.path && } : <>{m.role === "user" ? "You" : "Claude"}{m.text}} + {m.role === "tool" ? {m.text} {m.path && } : <>{m.role === "user" ? "You" : "Claude"}{m.text}}
)}
{error &&

{error}

} @@ -86,7 +87,7 @@ export function ChatPanel({ notebookPath, openNotebook, openTerminal, connect = {!messages.length &&
{["Create a notebook that…", "Add a check that…"].map(prompt => )}
}
{ e.preventDefault(); if (!ready || busy || !text.trim()) return; setMessages(previous => [...previous, { role: "user", text }]); setBusy(true); setError(""); setLogin(false); setSummary(""); - send({ type: "send", conversationId: selectedRef.current || undefined, message: text, notebookPath, allowShell }); setText(""); + send({ type: "send", conversationId: selectedRef.current || undefined, message: text, notebookPath: notebookPath && `notebooks/${notebookPath}`, allowShell }); setText(""); }}>