{# ABOUTME: Diff panel for the apply-candidate flow — current vs proposed metadata. #} {# ABOUTME: Includes header, per-field rows, and Apply/Back-to-results/Cancel actions. #} {% include "_book_subhead.html" %}

Apply candidate · {{ candidate.source }} · conf {{ "%.2f"|format(candidate.confidence) }}

{% for diff in diffs %} {% include "_field_diff_row.html" %} {% endfor %} {# Cover is an image, not a text field, so it gets a dedicated row rather than going through metadata_diff / _field_diff_row.html. #} {% if candidate.metadata.cover_url %} {% else %} {% endif %} {% if candidate.metadata.cover_url %} {% else %} {% endif %}
Apply Field Current Proposed
Cover Current cover Proposed cover same
{# Apply only writes fields that actually change AND aren't a skipped clear. The cover counts as one change whenever the candidate supplied one. #} {% set write_count = (diffs|selectattr('changed')|rejectattr('skip_clear')|list|length) + (1 if candidate.metadata.cover_url else 0) %} {% set skip_clear_count = diffs|selectattr('skip_clear')|list|length %}
{# Carry the previewed candidate so Apply writes exactly this without re-querying the provider (#234); dispatch fields above back the re-fetch fallback when this payload is absent. #} {# Sentinel distinguishing "user unchecked everything" from a legacy post with no selection support at all (#284). #} Select at least one field to apply. {% if skip_clear_count %} {{ skip_clear_count }} field{{ '' if skip_clear_count == 1 else 's' }} kept — provider had no value {% endif %}