.message-container class="mb-4" id=dom_id(message) - if message.role == 'model' || message.role == 'assistant' .message.p-3.rounded style="background-color: #E5F0FB;" .mb-2 strong.text-purple= t(:assistant) .hidden-assistant-content style="display: none;" pre id="#{dom_id(message, 'content')}" = message.message .markdown-content - if message.message.blank? / This is the placeholder for status updates during processing #assistant_status_indicator.assistant-status-indicator.d-flex.align-items-center.gap-2 data-typing-indicator="true" .typing-indicator.flex-shrink-0 .dot .dot .dot .status-text.text-muted.small.fst-italic | Analyzing your question... - else = markdown_render message.message - elsif message.role == 'user' .message.p-3.rounded.position-relative style="background-color: #ffffff; border: 1px solid #E5F0FB;" .d-flex.justify-content-between.align-items-center.mb-2 strong.text-primary= t(:you) / Filter Toggle Button - if message.metadata.present? && message.metadata["filters"].present? button.btn.btn-sm.btn-light.border.text-muted.d-flex.align-items-center.gap-1.rounded-pill.py-1.px-2 type="button" data-bs-toggle="collapse" data-bs-target="#msgFilters-#{message.id}" aria-expanded="false" style="font-size: 0.75rem; transition: background-color 0.2s;" i.bi.bi-sliders span Filters div.user-content = markdown_render message.message / Collapsible Filters Area (Reads directly from JSON) - if message.metadata.present? && message.metadata["filters"].present? .collapse.mt-3 id="msgFilters-#{message.id}" .p-2.rounded-3.border style="background-color: #F9FAFB; font-size: 0.8rem;" ruby: # Fetch pre-baked names for UI names = message.metadata["context_names"] || {} r_names = names["respondents"] || "All Respondents" s_name = names["section"] || "All Sections" # Fetch raw IDs for logic/debugging raw_filters = message.metadata["filters"] || {} r_ids = raw_filters["respondent_ids"] || [] s_id = raw_filters["section"] .d-flex.flex-column.gap-2 div .d-flex.align-items-center.mb-1 i.bi.bi-person.text-muted.me-2 strong.text-muted style="font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;" Respondents .text-dark.ms-4 = r_names / Uncomment below if you want to see IDs in the UI while testing / .text-muted.small.ms-4 [IDs: #{r_ids.join(', ')}] - if s_id.present? div .d-flex.align-items-center.mb-1 i.bi.bi-list.text-muted.me-2 strong.text-muted style="font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;" Section .text-dark.ms-4 = s_name / Uncomment below if you want to see ID in the UI while testing / .text-muted.small.ms-4 [ID: #{s_id}]