{# /opportunities summary cards. The first two cards mirror the dashboard's headline metrics - same numbers on both surfaces. The third card turns the listing into a fix-workflow surface: what can be fixed with SQL/materialization work. The cloud-only "Estimated Savings", "Projected Savings", "Clearing Savings", and solution-readiness "X ready / Y% coverage" subvalues are gone (audit doesn't run dry-runs, doesn't generate Solutions, and refuses to surface the existing rules' hardcoded-percentage savings figures). #} {% from "components/_summary_card.html" import summary_card %} {# Single metric: Flagged Jobs - the count of distinct queries that have ≥1 finding. Pairs 1:1 with the dashboard's "Flagged Jobs" card so the user sees the same number on both surfaces. The per-rule row count (``active_count``) is still rendered in the table below but we don't surface it as a headline. #} {% set _opp_sub = [] %} {% if summary.jobs_with_issue_count or summary.jobs_with_suggestion_count %} {% set _ = _opp_sub.append((summary.jobs_with_issue_count or 0) ~ " have issues") %} {% set _ = _opp_sub.append((summary.jobs_with_suggestion_count or 0) ~ " have suggestions") %} {% endif %} {% set _fix_sub = [] %} {% if summary.sql_suggestion_count %} {% set _ = _fix_sub.append(summary.sql_suggestion_count ~ " SQL rewrites") %} {% endif %} {% if summary.objects_with_materialization %} {% set _ = _fix_sub.append(summary.objects_with_materialization ~ " materialization signals") %} {% endif %}
{{ summary_card( "Flagged Jobs", summary.flagged_job_count, subvalues=_opp_sub if _opp_sub else ["across this scan"] ) }} {{ summary_card( "Query Cost", summary.total_query_cost | format_usd, subvalues=["across flagged jobs"] ) }} {{ summary_card( "Actionable Objects", summary.actionable_object_count or 0, subvalues=_fix_sub if _fix_sub else ["no SQL rewrites detected"], accent="emerald" ) }}