feat(corpus): category filter, passage expand, drill enhancements, URL hash state

- Search: category filter pills scope results to a legal domain
- Search: full chunk text returned; click to expand inline beyond 600-char excerpt
- Drill panel: total count label ("Showing X of Y"), sort dropdown, title filter (300ms debounce)
- URL hash: preserves query/mode/lang/category/drill state for bookmarking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 15:47:56 +02:00
parent ffcf887428
commit 2e2dfd7310
3 changed files with 208 additions and 42 deletions
+4
View File
@@ -29,6 +29,7 @@ try {
'category' => $h['category'] ?? '',
'section' => $h['section'] ?? null,
'excerpt' => $h['excerpt'] ?? ($h['chunk_text'] ?? ''),
'full_text' => $h['full_text'] ?? $h['chunk_text'] ?? $h['excerpt'] ?? '',
'score' => $h['score'] ?? null,
'document_id' => $h['document_id'] ?? null,
'chunk_id' => $h['chunk_id'] ?? null,
@@ -93,6 +94,7 @@ try {
'category' => $r['category'] ?? '',
'section' => $r['section'] ?? null,
'excerpt' => mb_substr((string)($r['excerpt'] ?? ''), 0, 600, 'UTF-8'),
'full_text' => (string)($r['excerpt'] ?? ''),
'score' => isset($r['score']) ? round((float)$r['score'], 4) : null,
'document_id' => (int)$r['document_id'],
'chunk_id' => isset($r['chunk_id']) ? (int)$r['chunk_id'] : null,
@@ -148,6 +150,7 @@ try {
'category' => $p['category'] ?? '',
'section' => $p['section_title'] ?? null,
'excerpt' => mb_substr((string)($p['content'] ?? ''), 0, 600, 'UTF-8'),
'full_text' => (string)($p['content'] ?? ''),
'score' => round((float)($pt['score'] ?? 0), 4),
'document_id' => isset($p['document_id']) ? (int)$p['document_id'] : null,
'chunk_id' => $pt['id'] ?? null,
@@ -234,6 +237,7 @@ try {
'category' => $d['category'] ?? '',
'section' => $d['section_title'] ?? null,
'excerpt' => mb_substr((string)($d['content'] ?? ''), 0, 600, 'UTF-8'),
'full_text' => (string)($d['content'] ?? ''),
'score' => round((float)($d['@search.rerankerScore'] ?? $d['@search.score'] ?? 0), 4),
'document_id' => null,
'chunk_id' => $d['chunk_id'] ?? $d['id'] ?? null,