{#- chirp-ui: App Shell component Full-page shell with topbar, sidebar, and main content area. Navigation is driven by explicit hx-boost on sidebar_link/nav_link, targeting #main to keep the sidebar and topbar persistent. In filesystem apps, the route/layout tree should declare matching Chirp domain metadata plus an outlet of main so route-aware links and boosted responses resolve to this shell consistently. Named slots: brand (when brand_slot=true), topbar, topbar_end, sidebar, default (main content). For routed apps, wrap the main slot with shell_outlet() so custom shells use the same #page-content contract as app_shell_layout.html. Usage: import app_shell plus shell_outlet provide brand / topbar / topbar_end / sidebar slots wrap the main slot with shell_outlet() for routed shells enable sidebar_collapsible=true for the resizable shell variant -#} {% from "chirpui/shell_actions.html" import shell_actions_bar %} {% from "chirpui/shell_frame.html" import shell_runtime_script %} {% def app_shell(brand="", brand_url="/", brand_slot=false, brand_boost=true, sidebar_collapsible=false, topbar_variant="default", sidebar_variant="default", shell_actions=none, cls="") %} {% set topbar_variant = topbar_variant | validate_variant(("default","glass","gradient"), "default") %} {% set sidebar_variant = sidebar_variant | validate_variant(("default","glass","muted"), "default") %} {% set topbar_class = " chirpui-app-shell__topbar--" ~ topbar_variant if topbar_variant != "default" else "" %} {% set sidebar_class = " chirpui-app-shell__sidebar--" ~ sidebar_variant if sidebar_variant != "default" else "" %} {% set shell_actions_target = shell_actions.target if shell_actions else "chirp-shell-actions" %} {% if sidebar_collapsible %}
{% else %}
{% end %}
{% if brand_slot %} {% slot brand %} {% else %} {{ brand }} {% end %}
{% slot topbar %}
{% if shell_actions %} {{ shell_actions_bar(shell_actions) }} {% end %}
{% slot topbar_end %}
{#- No whitespace before/after slot: stray text nodes inside grid main break layout/scroll. -#}
{%- slot -%}
{{ shell_runtime_script() }} {% end %}