Apply learned mask reviews by local cue and highlight the reviewed mention.
Deploy Development / deploy (push) Successful in 58s
Test Suite / pytest-backend (push) Successful in 2m59s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 16s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-09-10 20:08:59 +02:00
1 parent 3f7c0d71a5
commit f7ffd28332
10 files changed
+413 -36

No files matched your search

+13
View File
@@ -695,3 +695,16 @@ pre.code {
flex-wrap: wrap;
gap: 0.8rem;
}
.mask-excerpt {
margin: 0.35rem 0 0;
color: var(--ink);
font-size: 0.95rem;
line-height: 1.45;
}
.mask-excerpt mark {
background: #f3e2b8;
color: inherit;
font-weight: 600;
padding: 0 0.12em;
border-radius: 3px;
}
+32 -2
View File
@@ -1,3 +1,28 @@
function HighlightedExcerpt({ excerpt, highlightStart, highlightEnd, label }) {
if (!excerpt) return null
const start = Number(highlightStart)
const end = Number(highlightEnd)
if (Number.isInteger(start) && Number.isInteger(end) && start >= 0 && end <= excerpt.length && end > start) {
return (
<p className="mask-excerpt">
{excerpt.slice(0, start)}
<mark>{excerpt.slice(start, end)}</mark>
{excerpt.slice(end)}
</p>
)
}
const needle = label || ''
const at = needle ? excerpt.toLowerCase().indexOf(needle.toLowerCase()) : -1
if (at < 0) return <p className="mask-excerpt">{excerpt}</p>
return (
<p className="mask-excerpt">
{excerpt.slice(0, at)}
<mark>{excerpt.slice(at, at + needle.length)}</mark>
{excerpt.slice(at + needle.length)}
</p>
)
}
export default function MaskReviewPanel({ review, busy, onSubmit }) {
if (!review?.candidates?.length) return null
return (
@@ -7,7 +32,7 @@ export default function MaskReviewPanel({ review, busy, onSubmit }) {
<div>
<h2 id="mask-review-title">Maskierung prüfen</h2>
<p className="runlog-status">
Lernmodus: nur diese Nennung. Bestätigen legt die Bezeichnung lokal ab.
Lernmodus: nur die gelb markierte Nennung. Bestätigen legt die Bezeichnung lokal ab.
„Nicht schützenswert“ verhindert die Maskierung. Beides bei demselben Wort markiert es als mehrdeutig.
</p>
</div>
@@ -30,7 +55,12 @@ export default function MaskReviewPanel({ review, busy, onSubmit }) {
<div>
<strong>{item.text}</strong>
<span className="muted"> · {item.entity_type}{item.ambiguous ? ' · mehrdeutig' : ''}</span>
{item.excerpt && <p className="muted">{item.excerpt}</p>}
<HighlightedExcerpt
excerpt={item.excerpt}
highlightStart={item.highlight_start}
highlightEnd={item.highlight_end}
label={item.text}
/>
</div>
<fieldset className="row-actions">
<label className="check">