diff --git a/app/embeddings.py b/app/embeddings.py index e77b8ef..e3e44a5 100644 --- a/app/embeddings.py +++ b/app/embeddings.py @@ -777,9 +777,14 @@ def render_highlighted_page(programm_id: str, seite: int, query: str) -> Optiona rects = [] if needle: clean = needle.replace("\u00ad", "") + # LLMs ziehen h\u00e4ufig die Seitenzahl-Header (\u201e44 Gute Bildung \u2026") + # mit ins Zitat. Wenn die ersten Tokens reine Ziffern sind, + # strippen wir sie f\u00fcr die Suche \u2014 sonst matched search_for nicht. + import re as _re + clean = _re.sub(r"^\s*\d+\s+", "", clean).strip() words = clean.split() anchor = " ".join(words[:5]) if len(words) >= 5 else clean - # Versuch 1: angegebene Seite, Volltext + # Versuch 1: angegebene Seite, Volltext (gestrippt) rects = src[target_page_idx].search_for(clean) # Versuch 2: angegebene Seite, 5-Wort-Anker if not rects: diff --git a/app/static/v2/v2.css b/app/static/v2/v2.css index b8c07c3..2360001 100644 --- a/app/static/v2/v2.css +++ b/app/static/v2/v2.css @@ -66,15 +66,21 @@ body.v2 :focus-visible { grid-area: topbar; background: var(--paper); border-bottom: 1px solid var(--hairline); - padding: 4px 24px; - min-height: 32px; + padding: 2px 24px; display: flex; align-items: center; gap: var(--space-4); font-family: var(--font-mono); font-size: 11px; + line-height: 1.2; color: var(--ecg-dark); } +.v2-topbar > *, +.v2-topbar button, +.v2-topbar select { + padding-top: 2px; + padding-bottom: 2px; +} .v2-topbar-spacer { flex: 1;