{# Caller may set toolbar_hx_target (e.g. "#portfolio-body") to enable HTMX-driven swaps. When absent, the toolbar falls back to a plain GET form whose period/account changes do a full page reload (preserving the prior behavior on pages like /positions that have no body fragment endpoint). #} {% if toolbar_hx_target %} {# hx-push-url is intentionally NOT "true": HTMX would push the fragment URL (toolbar_hx_get), which reload-breaks the page. /portfolio/body sets a canonical HX-Push-Url header so the address bar shows the parent URL. #}
{% include "_spinner.html" %} {% else %} {% endif %}
{% import "_account_multi_select.html" as macros_acc %}
{{ macros_acc.account_multi_select(accounts_available, selected_accounts) }}
{# Edit layout / Done / Reset controls — client-side Alpine; no form submission. Sized + line-height-matched to the Period/Account selects on the same row (px-2 py-1 text-[12px] leading-[18px]) so the toolbar reads as one row of equal-height controls instead of a button towering over selects. #} {# Freshness chip — absorbs the data-source disclaimer in its tooltip. Reload runs after the refresh POST completes so the chip + KPIs pick up fresh quotes; reloading via onclick would race-cancel the in-flight POST. #} {# Single direct action — was an overflow kebab when this slot held multiple admin-grade actions; collapsed back to a button while only "Sync splits" lives here. Keep data-testid="toolbar-overflow" so existing tests + screenreaders still find it. #}