{# Shared markup fragments; IDs/classes must stay stable for JS/CSS. clock_thumb_header / loading_overlay: omitted here because manual-log vs tooth-count vs frequencies headers and graph loading shells differ in wrapping elements and IDs; duplicating one pattern would not reduce real drift. #} {# Status bar items: whatever is inside moves into the shell's status bar while the view is mounted (modules/app/statusBar.js). Use {% call cg.status_bar_slot() %}…{% endcall %}. #} {% macro status_bar_slot() -%} {%- endmacro %} {# ---- Header controls (modules/app/appBar.js, tools/headerControls.js) ---------------- A view on the app bar keeps its header controls in its template, in this fallback box: {% call cg.header_controls() %} {% call cg.header_primary() %}…{% endcall %} {% call cg.header_secondary() %}…{% endcall %} {% endcall %} A primary mount moves the two groups into the app bar (mountHeaderControls); modal and embedded mounts show the box as a plain bar inside the view. Primary: what the user needs while looking at the view; secondary: setup and rarely changed controls (they may wrap to the app bar's second row, which retracts on scroll). #} {% macro header_controls(label=None, hidden=False) -%} {%- endmacro %} {# `flat=True`: in the app bar the group's children are items of the bar's own row (the group and its slot are `display: contents`), so a view can let one of them wrap to row 2 and keep another on row 1 (Beat Scope's playback group and panel buttons). Each child is then its own unit. #} {% macro header_primary(flat=False) -%}
{% if caller %}{{ caller() }}{% endif %}
{%- endmacro %} {# `pin="row2"` pins the whole group to the app bar's second row (a group of setup controls that must never be promoted to the first row, even on a wide bar). #} {% macro header_secondary(pin=None) -%}
{% if caller %}{{ caller() }}{% endif %}
{%- endmacro %} {# Extra attributes for a header control: name=value pairs, underscores become dashes (aria_pressed="false" -> aria-pressed="false"); True renders a bare attribute (hidden), False or None leaves it out. #} {% macro _hdr_attrs(attrs) -%} {%- for k, v in attrs | dictsort -%} {%- if v is sameas true %} {{ k | replace("_", "-") }}{% elif v is not none and v is not sameas false %} {{ k | replace("_", "-") }}="{{ v }}"{% endif -%} {%- endfor -%} {%- endmacro %} {% macro _hdr_icon(icon) -%} {%- endmacro %} {# A header button, text or icon and text. `js` is the view's hook class (js-…); `variant` a cg-hbtn modifier (primary, danger, quiet). #} {% macro header_button(label, js, icon=None, title=None, variant=None) -%} {%- endmacro %} {# A square icon button; `label` is its accessible name (and tooltip unless `title`). #} {% macro header_icon_button(icon, js, label, title=None, variant=None) -%} {%- endmacro %} {# Joined buttons (step back / forward): {% call cg.header_group("Step") %}…{% endcall %}. #} {% macro header_group(label, js=None) -%}
{% if caller %}{{ caller() }}{% endif %}
{%- endmacro %} {# A button that opens a popover (the caller's content): {% call cg.header_menu("i-kebab", "js-pickerBtn", "Choose…", "js-pickerMenu", wrap_js="js-picker") %}…{% endcall %}. `js` is the button's hook, `menu_js` the popover's, `wrap_js` the wrapper's (what an outside click is measured against). The view opens and closes it (it toggles the `hidden` class on the popover and aria-expanded on the button); the popover hangs below the button, right-aligned, above the content. #} {% macro header_menu(icon, js, label, menu_js, wrap_js=None, menu_label=None, title=None) -%}
{%- endmacro %} {# Live status text in the header. #} {% macro header_status(js, text="") -%} {{ text }} {%- endmacro %} {% macro chime_type_options() -%} {%- endmacro %} {% macro spectrum_key(spectrum_id) -%} {%- endmacro %}