591cae5ebc
Reworks the advisor toward a Compliance Case Workspace (review feedback): - Rename user-facing "Quellen" -> "Evidence". - Evidence grouped by document/regulation family (count + expandable) — no more unsorted DSK/DSK/DPF/... jumble. - Human-readable regulation names via a display registry (DSK Sdm B51 -> "DSK Standard-Datenschutzmodell (SDM)" / Kapitel B51); generic, bridges G2. - Evidence summary "Antwort basiert auf" with meaningful counts; Regelwerke = distinct FAMILIES (fixes the inflated count). NO fabricated trust score (needs a defined basis). - Expanded mode = 3-column workspace (question+summary | answer | evidence, independent scroll) + history switcher; narrow mode stays stacked. - Prompt: push aggressive markdown structure (## per aspect, numbered phases). Deferred/coordinated on board: C8 diagrams (RAG contract), answer<->evidence coupling [1] (needs LLM citation anchors — phase 2), G1 retrieval relevance + G2 metadata (RAG). tsc clean, 17 vitest, check-loc 0. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
'use client'
|
|
|
|
import type { AdvisorTurn } from './useAdvisorStream'
|
|
import { EvidenceSummary } from './EvidenceSummary'
|
|
import { AnswerPane } from './AnswerPane'
|
|
import { EvidencePane } from './EvidencePane'
|
|
import { FiguresPane } from './FiguresPane'
|
|
import { FootnotesPane } from './FootnotesPane'
|
|
|
|
/** One question/answer turn as stacked panels (collapsed / narrow layout). */
|
|
export function TurnView({ turn, showQuestion }: { turn: AdvisorTurn; showQuestion?: boolean }) {
|
|
const streaming = turn.status === 'streaming'
|
|
return (
|
|
<div className="space-y-2 border-b border-gray-100 pb-4 last:border-0">
|
|
{showQuestion && (
|
|
<div className="text-xs text-gray-500">
|
|
<span className="font-medium text-gray-400">Frage:</span> {turn.question}
|
|
</div>
|
|
)}
|
|
<EvidenceSummary meta={turn.meta} />
|
|
<AnswerPane answer={turn.answer} streaming={streaming} error={turn.error} />
|
|
<EvidencePane sources={turn.meta.sources} />
|
|
<FiguresPane figures={turn.meta.figures} />
|
|
<FootnotesPane footnotes={turn.meta.footnotes} />
|
|
</div>
|
|
)
|
|
}
|