feat(search): 'why this matched' highlights #15

Merged
cesnimda merged 1 commits from feature/search-why-matched into develop 2026-07-01 22:22:39 +02:00
Owner

Slice 3 of search-core. Results show a ts_headline 'why this matched' fragment; matched terms rendered as escaped elements (safe against untrusted email content). Only for free-text queries; browse unchanged. Verified translation+execution against live Postgres.

🤖 Generated with Claude Code

Slice 3 of search-core. Results show a ts_headline 'why this matched' fragment; matched terms rendered as escaped <mark> elements (safe against untrusted email content). Only for free-text queries; browse unchanged. Verified translation+execution against live Postgres. 🤖 Generated with Claude Code
cesnimda added 1 commit 2026-07-01 22:19:27 +02:00
feat(search): 'why this matched' highlights (ts_headline)
CI / backend (pull_request) Successful in 48s
CI / frontend (pull_request) Successful in 14s
Security / secrets (pull_request) Successful in 3s
Security / dependencies (pull_request) Successful in 51s
4c43bfed0d
Slice 3 of search-core. Search results now show WHY they matched: a ts_headline
body fragment with matched terms highlighted. The API returns U+E000/U+E001
sentinels around matches (NOT HTML); the client tokenises them into escaped
<mark> React elements, so untrusted email content can never inject markup (no
dangerouslySetInnerHTML). Subtle accent tint. Only when there's a free-text query
(browse unchanged); projection branched (no DB function in a ternary) for
unambiguous EF translation.

Verified: build + all 40 tests; ts_headline output shape in raw Postgres; and the
ranked+headline EF query proven to translate + execute against a live Postgres via
a throwaway test (removed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cesnimda force-pushed feature/search-why-matched from 18acd9f6e8 to 4c43bfed0d 2026-07-01 22:19:27 +02:00 Compare
cesnimda merged commit 9bbab5d32a into develop 2026-07-01 22:22:39 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cesnimda/Inboxintel#15