@extends('setting.nav') @section('title', 'Sentiment Labels') @section('content')

Sentiment & Issue Detection

The labels the classifier may return. These rows drive the AI prompt, the mail list pills, the Sentiment filter menu and the dashboard breakdown. The list is shared by everyone — a label an administrator adds here is in force for every user's mail, not just their own.

@if (session('success')) @endif @if (session('error')) @endif @if ($errors->any())
Please fix the following:
@endif @php $isAdmin = auth()->check() && auth()->user()->auth_id == 0; @endphp @if ($usingDefaults) {{-- Nothing configured yet. The app is running on the built-in three, so say so plainly rather than showing an empty table. --}}
Running on the built-in labels. Positive, Neutral and Negative are in force because nothing has been configured here yet. Add the standard set below to start managing them — including Angry, Complaint and Urgent.
@endif
{{ $usingDefaults ? 'Labels in force' : 'Labels' }}
@if ($isAdmin && $canSeed)
@csrf
@endif
{{-- Counted across every mailbox, because deactivating a label affects every mailbox. The link opens your own listing. --}} @forelse ($sentiments as $sentiment) @empty {{-- No rows, so show the defaults that are actually in force. --}} @foreach ($effective as $sentiment) @endforeach @endforelse
Label AI code Mail (all users) Active Actions
{{ $loop->iteration }} {{ $sentiment->name }} @if ($sentiment->description)
{{ \Illuminate\Support\Str::limit($sentiment->description, 120) }}
@endif @if ($sentiment->ai_aliases)
also matches: {{ $sentiment->ai_aliases }}
@endif
{{ $sentiment->code }}
/mails/{{ $sentiment->filter_slug }}
@php $used = $counts[(int) $sentiment->legacy_code] ?? 0; @endphp @if ($used > 0) {{ number_format($used) }} @else 0 @endif @if ($isAdmin)
@csrf
@else {{ $sentiment->is_active ? 'Active' : 'Inactive' }} @endif
@if ($isAdmin) {{-- Order is what the prompt uses to break ties between two labels that both fit a mail. --}}
@csrf
@csrf
@csrf @method('DELETE')
@endif
{{ $loop->iteration }} {{ $sentiment->name }} @if ($sentiment->description)
{{ \Illuminate\Support\Str::limit($sentiment->description, 120) }}
@endif
{{ $sentiment->code }}
/mails/{{ $sentiment->filter_slug }}
{{ number_format($counts[(int) $sentiment->legacy_code] ?? 0) }} Built in not editable yet
@if ($isAdmin)
Add label
@csrf @include('sentiments._fields', ['sentiment' => null, 'colours' => $colours])
@endif
{{-- Edit dialogs, one per row. --}} @if ($isAdmin) @foreach ($sentiments as $sentiment) @endforeach @endif
@endsection