From 488f992bd34076b2986aa37efeb8c3a4c2ef4b4b Mon Sep 17 00:00:00 2001 From: Florian Schmidt Date: Mon, 16 Nov 2026 10:23:05 +0100 Subject: [PATCH] fix(web): send workspace-relative notebook paths from the chat panel (#8) The app passes notebook paths relative to notebooks/, but the chat protocol uses workspace paths (notebooks/...). Every message sent while a notebook was open was rejected as invalid, and "Open notebook" links on Claude's edits loaded a non-existent path. ChatPanel now converts at its boundary in both directions. --- apps/web/src/ChatPanel.tsx | 5 +++-- apps/web/src/tests/chat.test.tsx | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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(""); }}>