{{-- The five sections of a conversation summary. Rendered both by the Email Summary page and by the modal on the mail list, so the two can never drift apart. Everything here is escaped. The model returns data, not markup — nothing on this page comes out of Gemini as HTML. Expects: $summary — App\Models\ThreadSummary $thread — the collector's array, or null when only the stored copy is known $stale — true when a newer reply has arrived since this was written --}} @php $actions = $summary->section('pending_actions') ?: []; $discussion = $summary->section('previous_discussion') ?: []; $counterpart = $summary->summary_json['counterpart'] ?? ''; $truncated = (bool) ($summary->summary_json['truncated'] ?? false); $messageCount = $thread['message_count'] ?? $summary->message_count; @endphp
{{ $summary->summary_json['subject'] ?? 'Conversation' }}
{{ $messageCount }} {{ $messageCount === 1 ? 'message' : 'messages' }} @if ($counterpart !== '') {{ $counterpart }} @endif @if ($summary->generated_at) Summarised {{ $summary->generated_at->diffForHumans() }} @endif
{{ $summary->status() }}
@if ($stale)
New mail has arrived in this conversation since this summary was written. Regenerate it to include the latest messages.
@endif @if ($truncated)
This conversation is long enough that the oldest messages were shortened before summarising.
@endif {{-- 1. Customer requirement --}}

Customer requirement

@if ($summary->section('customer_requirement'))

{{ $summary->section('customer_requirement') }}

@else

The thread does not state a clear requirement.

@endif
{{-- 2. Previous discussion --}}

Previous discussion

@if (!empty($discussion)) @else

Nothing was exchanged beyond the opening message.

@endif
{{-- 3. Current status --}}

Current status

@if ($summary->section('current_status'))

{{ $summary->section('current_status') }}

@else

The thread does not make the current position clear.

@endif
{{-- 4. Pending actions --}}

Pending actions

@if (!empty($actions)) @else

Nothing is outstanding on either side.

@endif
{{-- 5. Next step --}}

Next step

@if ($summary->section('next_step'))

{{ $summary->section('next_step') }}

@else

No next step follows from the thread.

@endif

Written by AI from the messages in this conversation. Check anything you are going to act on against the mail itself.