Improve vision suggestions display in layout review
This commit is contained in:
parent
0764e698d3
commit
d974a14110
|
|
@ -1987,48 +1987,43 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% set vision_fields = vision_candidate_fields or [] %}
|
{% set vision_fields = vision_candidate_fields or [] %}
|
||||||
{% set vision_suggestions = vision_field_suggestions or [] %}
|
{% set vision_suggestions = vision_field_suggestions or [] %}
|
||||||
|
|
||||||
{% if vision_suggestions %}
|
{% if vision_suggestions %}
|
||||||
<div class="detail-card" style="margin:0.75rem 0; border-left:4px solid #16a34a;">
|
<div class="detail-card" style="margin:0.75rem 0; border-left:4px solid #16a34a;">
|
||||||
<div style="display:flex; justify-content:space-between; gap:1rem; align-items:center;">
|
<div style="display:flex; justify-content:space-between; gap:1rem; align-items:center;">
|
||||||
<h3 style="margin:0;">Vision Field Suggestions</h3>
|
<h3 style="margin:0;">Vision Suggested Additions</h3>
|
||||||
<span style="font-size:0.85rem; color:#64748b;">{{ vision_suggestions|length }} suggestions</span>
|
<span style="font-size:0.85rem; color:#64748b;">{{ vision_suggestions|length }} suggestions</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top:0.5rem; overflow-x:auto;">
|
|
||||||
<table class="data-table" style="width:100%;">
|
<div style="display:grid; gap:0.5rem; margin-top:0.75rem;">
|
||||||
<thead>
|
{% for suggestion in vision_suggestions[:8] %}
|
||||||
<tr>
|
<div style="padding:0.65rem 0.75rem; border:1px solid #dbe3ea; border-radius:0.75rem; background:#f8fafc;">
|
||||||
<th>Action</th>
|
<div style="font-size:0.78rem; color:#64748b; font-weight:700; text-transform:uppercase;">
|
||||||
<th>Field</th>
|
{{ suggestion.get("target_field", "") }} · {{ suggestion.get("action", "") }}
|
||||||
<th>Value</th>
|
</div>
|
||||||
<th>Confidence</th>
|
<div style="font-size:1rem; font-weight:700; margin-top:0.2rem; color:#1e293b;">
|
||||||
<th>OCR Conf.</th>
|
{{ suggestion.get("value", "") }}
|
||||||
</tr>
|
</div>
|
||||||
</thead>
|
<div style="font-size:0.78rem; color:#64748b; margin-top:0.2rem;">
|
||||||
<tbody>
|
confidence {{ suggestion.get("confidence", "") }}
|
||||||
{% for suggestion in vision_suggestions[:12] %}
|
{% if suggestion.get("ocr_confidence") is not none %}
|
||||||
<tr>
|
· OCR {{ suggestion.get("ocr_confidence", "") }}
|
||||||
<td>{{ suggestion.get("action", "") }}</td>
|
{% endif %}
|
||||||
<td>{{ suggestion.get("target_field", "") }}</td>
|
</div>
|
||||||
<td><code>{{ suggestion.get("value", "") }}</code></td>
|
</div>
|
||||||
<td>{{ suggestion.get("confidence", "") }}</td>
|
{% endfor %}
|
||||||
<td>{{ suggestion.get("ocr_confidence", "") }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if vision_fields %}
|
{% if vision_fields %}
|
||||||
<div class="detail-card" style="margin:0.75rem 0; border-left:4px solid #7c3aed;">
|
<details class="detail-card" style="margin:0.75rem 0; border-left:4px solid #7c3aed;">
|
||||||
<div style="display:flex; justify-content:space-between; gap:1rem; align-items:center;">
|
<summary style="cursor:pointer; font-weight:700; font-size:1.05rem;">
|
||||||
<h3 style="margin:0;">Vision Candidate Fields</h3>
|
Raw Vision Candidate Fields · {{ vision_fields|length }} candidates
|
||||||
<span style="font-size:0.85rem; color:#64748b;">{{ vision_fields|length }} candidates</span>
|
</summary>
|
||||||
</div>
|
|
||||||
<div style="margin-top:0.5rem; overflow-x:auto;">
|
<div style="margin-top:0.5rem; overflow-x:auto;">
|
||||||
<table class="data-table" style="width:100%;">
|
<table class="data-table" style="width:100%;">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -2040,7 +2035,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for field in vision_fields[:12] %}
|
{% for field in vision_fields[:20] %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ field.get("candidate_type", "") }}</td>
|
<td>{{ field.get("candidate_type", "") }}</td>
|
||||||
<td><code>{{ field.get("value", "") }}</code></td>
|
<td><code>{{ field.get("value", "") }}</code></td>
|
||||||
|
|
@ -2051,7 +2046,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</details>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="layout-review-shell">
|
<div id="layout-review-shell">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue