useCanadianChat hook wires Next.js UI to Python backend; CanLII fallback viewer added to DocPanel
Two commits bridge the upstream TypeScript frontend to jrklaus8's Python sovereignty backend. The assistant page is rewired to call `/api/v1/query` instead of the upstream TS chat route, and DocPanel gets a fallback branch for MCP-sourced documents.
1bab274 adds frontend/src/app/hooks/useCanadianChat.ts and swaps it in for useAssistantChat in the assistant page. The hook POSTs { query, is_tribunal_matter: false } to /api/v1/query, maps data.citation and data.highlight_text from the Python backend's response into MikeMessage/MikeCitationAnnotation types, and sets document_id: "mcp-doc-1". The response shaping is specific to what the fork's backend returns - it hardcodes the annotation ref: 1 and uses data.result || "" as the assistant content, falling back to a templated string when a citation is present.
08203008 adds a documentId.startsWith("mcp-") branch in DocPanel. When the panel receives an MCP-sourced document ID, it shows a placeholder card explaining that full PDF rendering isn't available for external CanLII citations.
This is the point where the two stacks actually touch. The Python backend becomes the live inference path for anyone running this fork. The hook still imports the MikeMessage and MikeCitationAnnotation types from upstream, so the type surface is shared, but the runtime behavior is entirely different.
The coupling is tight. useCanadianChat expects data.citation and data.highlight_text keys that only the fork's Python backend produces. Drop-in use against the upstream TS backend would silently produce empty responses.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?