fix: display highlight tracking data in history page UI
- Add highlight_prompt, highlight_response, highlight_time_ms to QueryHistoryDetail type - Add 'Highlights' bar segment with pink color in TimingBar component - Pass highlightTimeMs to TimingBar in HistoryCard expanded view - Add collapsible sections for highlight prompt and response in HistoryCard detail
This commit is contained in:
parent
41f59b396f
commit
90269608bc
|
|
@ -168,6 +168,7 @@ export const HistoryCard: React.FC<HistoryCardProps> = ({
|
|||
retrieverTimeMs={detail.retriever_time_ms}
|
||||
filterTimeMs={detail.filter_time_ms}
|
||||
generatorTimeMs={detail.generator_time_ms}
|
||||
highlightTimeMs={detail.highlight_time_ms}
|
||||
totalTimeMs={detail.total_time_ms}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -213,6 +214,18 @@ export const HistoryCard: React.FC<HistoryCardProps> = ({
|
|||
</CollapsibleSection>
|
||||
)}
|
||||
|
||||
{detail.highlight_prompt && (
|
||||
<CollapsibleSection title="Highlight Prompt">
|
||||
<pre className="text-xs font-mono whitespace-pre-wrap break-all text-gray-700">{detail.highlight_prompt}</pre>
|
||||
</CollapsibleSection>
|
||||
)}
|
||||
|
||||
{detail.highlight_response && (
|
||||
<CollapsibleSection title="Highlight Response">
|
||||
<pre className="text-xs font-mono whitespace-pre-wrap break-all text-gray-700">{detail.highlight_response}</pre>
|
||||
</CollapsibleSection>
|
||||
)}
|
||||
|
||||
{detail.final_answer && (
|
||||
<div>
|
||||
<h4 className="text-sm font-medium text-gray-700 mb-2">Final Answer</h4>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ interface TimingBarProps {
|
|||
retrieverTimeMs: number
|
||||
filterTimeMs: number
|
||||
generatorTimeMs: number
|
||||
highlightTimeMs?: number
|
||||
totalTimeMs: number
|
||||
}
|
||||
|
||||
|
|
@ -26,6 +27,7 @@ export const TimingBar: React.FC<TimingBarProps> = ({
|
|||
retrieverTimeMs,
|
||||
filterTimeMs,
|
||||
generatorTimeMs,
|
||||
highlightTimeMs,
|
||||
totalTimeMs,
|
||||
}) => {
|
||||
const segments: BarSegment[] = [
|
||||
|
|
@ -33,6 +35,7 @@ export const TimingBar: React.FC<TimingBarProps> = ({
|
|||
{ label: 'Retrieve', timeMs: retrieverTimeMs, colorClass: 'bg-green-400' },
|
||||
{ label: 'Filter', timeMs: filterTimeMs, colorClass: 'bg-amber-400' },
|
||||
{ label: 'Generate', timeMs: generatorTimeMs, colorClass: 'bg-purple-400' },
|
||||
{ label: 'Highlights', timeMs: highlightTimeMs ?? 0, colorClass: 'bg-pink-400' },
|
||||
]
|
||||
|
||||
const maxTime = totalTimeMs > 0 ? totalTimeMs : 1
|
||||
|
|
|
|||
|
|
@ -151,6 +151,9 @@ export interface QueryHistoryDetail {
|
|||
final_answer: string | null
|
||||
sources: string | null
|
||||
profile_used: string | null
|
||||
highlight_prompt: string | null
|
||||
highlight_response: string | null
|
||||
highlight_time_ms: number
|
||||
created_at: string
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue