Inbox
{{-- ── LEFT RAIL: sender list ──────────────────────────────────── --}}
Inboxes
@forelse($senders as $sender) @empty
No sender addresses configured.
@endforelse
{{-- ── MIDDLE: message list ─────────────────────────────────────── --}}
{{-- Search bar --}}
{{-- Classification filter bar --}} @if($senderId)
@php $filters = [ '' => 'All', 'dsar_response' => 'DSAR', 'dsar_matched' => 'Matched', 'dsar_unmatched' => 'Unmatched', 'generic' => 'Generic', 'unclassified' => 'Unclassified', ]; @endphp @foreach($filters as $val => $label) @endforeach
@endif @if(!$senderId)
Select an inbox to view messages.
@elseif($messages->isEmpty())
No emails found.
@else
@foreach($messages as $msg) @php $isUnread = is_null($msg->read_at); @endphp @endforeach
@if($messages->hasPages())
{{ $messages->links() }}
@endif @endif
{{-- ── RIGHT: message detail ────────────────────────────────────── --}}
@if($openMessage)
{{-- ── Message meta ── --}}
{{ $openMessage->subject ?: '(no subject)' }}
From: {{ $openMessage->from_email }} • {{ $openMessage->created_at->format('d M Y, H:i') }} @if($openMessage->classification || $openMessage->classification_status === 'processing') Synapse @if($openMessage->classification_status === 'processing') Classifying… @elseif($openMessage->classification === 'dsar_response') DSAR Response @elseif($openMessage->classification === 'generic') Generic @endif @if($openMessage->classification_confidence) {{ ucfirst($openMessage->classification_confidence) }} confidence @endif @if($openMessage->messageable_type && str_contains($openMessage->messageable_type, 'Dsar') && $openMessage->messageable) @php $dsar = $openMessage->messageable; @endphp DSAR #{{ $dsar->id }} @endif @if($openMessage->classification_notes) {{ $openMessage->classification_notes }} @endif @endif
{{-- ── Action toolbar ── --}}
@if($openMessage->read_at) @endif
@if($openMessage->body_html) @elseif($openMessage->body_text)
{{ $openMessage->body_text }}
@else

This email has no body content.

@endif
@if($openMessage->attachments->isNotEmpty())
Attachments ({{ $openMessage->attachments->count() }})
@foreach($openMessage->attachments as $attachment) @php $exStatus = $attachment->extraction_status; $needsNote = in_array($exStatus, ['skipped', 'failed', null]); $hasNote = !empty($attachment->extracted_text); @endphp
{{-- File row --}}
{{ $attachment->filename }} @if($attachment->size) ({{ number_format($attachment->size / 1024, 1) }} KB) @endif
{{-- Action buttons --}}
@php $previewable = str_starts_with($attachment->mime ?? '', 'image/') || str_contains($attachment->mime ?? '', 'pdf') || str_starts_with($attachment->mime ?? '', 'text/'); @endphp @if($previewable) @endif
{{-- Extraction status badge (clickable when text exists) --}} @if($exStatus === 'completed') @elseif($exStatus === 'manual') @elseif($exStatus === 'processing') Extracting… @elseif($exStatus === 'failed') Extraction failed @elseif($exStatus === 'skipped' || is_null($exStatus)) Not readable @endif
{{-- Extracted text viewer (completed) --}} @if($exStatus === 'completed' && !empty($attachment->extracted_text))
{{ $attachment->extracted_text }}
@endif {{-- For non-extractable types: show a link to add a manual context note --}} @if($needsNote)
@endif {{-- Editable textarea shown when textOpen (manual note or edit of extracted text) --}} @if($needsNote || $exStatus === 'manual')
@if($needsNote)

Describe what this attachment contains — Synapse will use this when re-classifying.

@endif
@endif
@endforeach
@endif
{{-- /flex-grow-1 overflow-auto --}} @else

Select an email to read it

@endif
{{-- ── ATTACHMENT PREVIEW MODAL ──────────────────────────────────── --}}
{{-- Backdrop --}}
{{-- Panel --}}
{{-- Modal header --}} {{-- Modal body --}}
{{-- Image viewer --}} {{-- PDF / text viewer (iframe) --}}