49171e841f
Rebuilds the Compliance Advisor floating widget from a plain chat into an Evidence
Workspace: pinned last question, markdown-rendered answer (clean prose), and separate
panes for Sources (hierarchical Knowledge Units), Figures (C8, conditional) and
Footnotes (C-FN), plus a stats bar (Quellen/Regelwerke/Diagramme/Fußnoten). Scrollable
turn history; stays a floating icon on every SDK page.
Architecture (user direction): the frontend renders ONLY structured evidence and NEVER
parses the answer text. The proxy now returns a JSON AdvisorEvidenceMeta line followed
by the streamed markdown answer; advisor-rag exposes structured results; an adapter maps
RAG/compiler output to the frontend envelope. Figures/footnotes wire in once the
RAG-ingestion contract lands (requested on the board) — figures pane is conditional.
- lib/sdk/advisor/{evidence,evidence-adapter}.ts (+ adapter test, 7 cases)
- components/sdk/advisor/* panes + in-house safe Markdown (no new dep, no dangerouslySetInnerHTML) + test
- useAdvisorStream (meta-line parse + streamed answer) + useAdvisorEmail (escaped)
- proxy: evidence-meta-v1 envelope + clean-prose prompt (no inline citations)
- tsc clean, 11 vitest pass, check-loc 0. ESLint not installed in this node_modules -> CI lints on push.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
22 lines
782 B
TypeScript
22 lines
782 B
TypeScript
'use client'
|
|
|
|
import { HelpCircle } from 'lucide-react'
|
|
|
|
/** The last question, pinned so it never scrolls out of view while the answer grows. */
|
|
export function StickyQuestion({ question }: { question: string }) {
|
|
if (!question) return null
|
|
return (
|
|
<div className="sticky top-0 z-10 border-b border-indigo-100 bg-indigo-50/95 px-4 py-2 backdrop-blur">
|
|
<div className="flex items-start gap-2">
|
|
<HelpCircle className="mt-0.5 h-4 w-4 flex-shrink-0 text-indigo-500" />
|
|
<div className="min-w-0">
|
|
<div className="text-[10px] font-semibold uppercase tracking-wide text-indigo-400">
|
|
Letzte Frage
|
|
</div>
|
|
<div className="text-sm font-medium text-gray-800">{question}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|