feat(redact): tag highlighting, inventory panel, before/after toggle, gpt-4o upgrade

- CSS: colour-coded [TAG] spans by entity type (person=pink, org=blue,
  place=green, date=amber, id=purple)
- Inventory panel: collapsible list showing tag → original text mappings
  with occurrence counts, sourced from new redaction_map API response key
- Before/after toggle: Redacted / Original view-switch buttons wired to
  lastOriginalText captured at submission time
- One-click gpt-4o upgrade button when mini or GPU engine was used
- Backend: redaction_map built from applied LLM entities (tag → originals
  + occurrence count via substr_count on final text)
- renderResults now calls setupRedactViewToggle() after DOM is written

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 08:22:41 +02:00
parent 850937e4b3
commit 59b39ff85b
3 changed files with 132 additions and 0 deletions
+2
View File
@@ -1317,6 +1317,8 @@ function renderResults(data) {
els.results.innerHTML = sections.join('');
setupFeedbackWidget(data.tool || state.activeTool);
if (data.tool === 'redact') setupRedactViewToggle();
const sortDoc = document.getElementById('sortDocOrder');
const sortChr = document.getElementById('sortChronological');
if (sortDoc && sortChr) {