hsa-app/internal/web/templates/ai_review.html
Jean-Michel Tremblay c715c8e0c0
All checks were successful
Build and Test / build-and-test (push) Successful in 37s
AI classifier correction notes + misread review (AI tab)
Add a global, temporal ai_notes list appended to the classifier prompt
(seeded once from no-PII defaults, documented in README), managed inline
on a new AI tab with a read-only view of the assembled prompt. Every
AI-run upload records the browser-round-tripped suggestion blob + model;
misreads are derived (final field != AI guess) and reviewed one by one
(image + per-field guess-vs-entered + notes-since), attributing which
note fixed each or closing unresolved. Update SPEC (new section 10),
DESIGN item 15, README, and changelog (0.0.3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 16:04:30 -04:00

38 lines
1.4 KiB
HTML

{{define "title"}}Review misread{{end}}
{{define "content"}}
<header>
<span><a href="/ai">← AI</a></span>
<span>classified by {{.Model}} · {{.When}}</span>
</header>
<h1>Review misread</h1>
<p><a href="/receipt/{{.ReceiptID}}/file" target="_blank">Open the receipt image ↗</a></p>
<table class="tally">
<thead><tr><th>Field</th><th>AI guessed</th><th>You entered</th></tr></thead>
<tbody>
{{range .Fields}}
<tr{{if .Overridden}} class="miss"{{end}}>
<th>{{.Field}}</th>
<td>{{.Suggested}}</td>
<td>{{.Final}}{{if .Overridden}} ✎{{end}}</td>
</tr>
{{end}}
</tbody>
</table>
<p><small>Rows marked ✎ are where you overrode the AI.</small></p>
<form method="post" action="/ai/review/{{.ReceiptID}}">
<h2>What fixed it?</h2>
{{if .SinceNotes}}
<p><small>Notes added since this receipt was classified — tick any that address this misread:</small></p>
{{range .SinceNotes}}
<label class="check"><input type="checkbox" name="fix" value="{{.ID}}"> {{.Text}}</label>
{{end}}
{{else}}
<p><small>No notes were added after this receipt was classified. Add a correction note on the <a href="/ai">AI page</a> first if one would help, then come back — or close this as unresolved.</small></p>
{{end}}
<button type="submit" class="primary">Done reviewing</button>
<p><small>Ticking one or more notes marks this as fixed; ticking none closes it as unresolved.</small></p>
</form>
{{end}}