{# Tabbed code viewer component (spec 040, updated spec 048). Expects: solution_id (str/int — unique per solution for element IDs) diff_lines (list of dicts with 'type' and 'content', or None) compiled_original (str — original SQL baseline, or None) compiled_original_label (str — source label for original SQL, optional) compiled_modified (str — optimized SQL with solution applied, or None) verification_sql (str — generated verification SQL script, or None) verification_profile (str — verification check profile id, optional) verification_output_mode (str — verification output mode id, optional) verification_source_label (str — provenance of original SQL for verification) verification_warnings (list[dict], optional) verification_unavailable_reason (str, optional) file_path (str, optional) #} {% if file_path %}
{{ file_path }}
{% endif %} {# Tab bar #}
Diff {% if compiled_original %} Original SQL {% endif %} {% if compiled_modified %} Optimized SQL {% endif %} {% if verification_sql or verification_unavailable_reason %} Verification SQL {% endif %}
{# Diff panel (default visible) #}
{% if diff_lines %} {% with diff_lines=diff_lines %} {% include "components/code_diff.html" ignore missing %} {% endwith %} {% else %}

No diff available.

{% endif %}
{# Original SQL panel — manifest compiled baseline, or latest executed SQL fallback #} {% if compiled_original %} {% endif %} {# Optimized SQL panel — compiled SQL with solution changes applied #} {% if compiled_modified %} {% endif %} {# Verification SQL panel — manual BigQuery result-equivalence checks #} {% if verification_sql or verification_unavailable_reason %} {% endif %}