chore: drop dead _qid helper and surface ocr_confidence on SearchHit

- app/indexing/qdrant_client.py: remove the identity-only _qid()
  helper and pass chunk_id straight to PointStruct (Qdrant accepts
  the UUID string directly).
- services/types.ts: SearchHit gets an explicit, optional
  ocr_confidence field so consumers can type the value instead of
  casting through metadata.
- widgets/SearchResultCard.tsx: replaces the
  (hit.metadata as { ocr_confidence? }) cast with the new field. No
  behavior change when the backend omits it.

tsc --noEmit: clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vadim Malanov
2026-05-13 16:55:32 +03:00
parent 785d3be970
commit f42fb978a8
3 changed files with 3 additions and 9 deletions

View File

@@ -47,6 +47,7 @@ export interface SearchHit {
citation: Citation;
quality_flags: QualityFlags;
metadata: Record<string, unknown>;
ocr_confidence?: number | null;
}
export interface SearchResponse {

View File

@@ -20,9 +20,7 @@ interface Props {
}
export function SearchResultCard({ hit, query, active, onSelect, reranked }: Props) {
const ocrConf =
(hit.metadata as { ocr_confidence?: number })?.ocr_confidence ??
null;
const ocrConf = hit.ocr_confidence ?? null;
return (
<motion.button
layout