<%# locals: (sidebar_aware: false) %> <% theme = Current.user&.theme || "system" %> " class="h-[var(--app-height, 100dvh)] text-primary bg-surface overflow-hidden overscroll-none font-sans <%= @os %>"> <%= render "layouts/shared/head" %> <%= yield :head %> data-controller="notification-tray"<% end %>> <% if Rails.env.development? %> <% end %> <% if Current.family %> <%= turbo_stream_from Current.family %> <% end %> <%= turbo_frame_tag "modal" %> <%= turbo_frame_tag "drawer" %> <%# Custom overrides for browser's confirm API %> <%= render "layouts/shared/confirm_dialog" %> <%= render "impersonation_sessions/super_admin_bar" if Current.true_user&.super_admin? && show_super_admin_bar? %> <%= render "impersonation_sessions/approval_bar" if Current.true_user&.impersonated_support_sessions&.initiated&.any? %> <%= yield %> <%# `left-1/2 -translate-x-1/2` centers on the viewport by default, correct for every single-column layout. Layouts with a persistent sidebar (settings, application) pass sidebar_aware: true, which wires up notification_tray_controller.js to override `left` with the actual content pane's center instead — see that controller for why a ResizeObserver beats hand-rolled sidebar-width math, and for why it also has to guard that inline style against turbo_refreshes_with's morph reconciliation. %>
data-notification-tray-target="tray" data-action="turbo:before-morph-attribute->notification-tray#preserveStyle"<% end %>> <%= render "layouts/shared/notification_tray" %>