{# Reusable project-picker combobox (spec 164). Replaces the native (which only matches the typed text against the option *value* = project id, so typing a project's display NAME finds nothing) with a small, dependency-free combobox that filters on display name OR project id and submits the canonical project id. Degrades gracefully: with no discovered projects, or with JavaScript disabled, it is a plain free-text input (manual project-id entry still works). Light + dark mode variants included. Usage: {% from "components/_project_combobox.html" import project_combobox, project_combobox_script %} {{ project_combobox("gcp_project_id", gcp_projects, value=..., required=true, autofocus=true) }} ... (any number of pickers on the page) ... {{ project_combobox_script() }} {# emit ONCE per page #} #} {%- macro project_combobox(field_id, projects, value="", required=false, autofocus=false, disabled=false, pattern="", placeholder="") -%}
{% if projects %} {% endif %}
{%- endmacro -%} {%- macro project_combobox_script() -%} {%- endmacro -%}