@php $products = $this->products; $product = $this->selectedProduct; $diagrams = $this->matchedDiagrams; $preview = $this->previewUrl; $filterCounts = $this->filterCounts; $companies = $this->companies; @endphp {{-- ── Page action bar ───────────────────────────────────────────────────── --}}
Queuing job…
{{-- Clear All confirmation modal --}}

Clear all diagram assignments?

This will permanently delete all {{ number_format($filterCounts['assigned'] ?? 0) }} assigned diagrams, remove them from product images, and delete the generated files from storage. This cannot be undone.

{{-- Unassign confirmation modal --}}

Remove diagram assignment?

This will remove all assigned diagrams for , delete the generated images from storage, and remove them from the product's image gallery. This cannot be undone.

{{-- ── Left: Product list ─────────────────────────────────────────────── --}}
Products {{ number_format($products['total']) }}
jobRunning) wire:poll.3s="checkJobStatus" @endif> @foreach (['all' => 'All', 'matched' => 'Has Diagrams', 'assigned' => 'Assigned', 'unassigned' => 'Unassigned', 'errors' => 'Errors'] as $key => $label) @endforeach
@if (count($products['items']) === 0)
No products match.
@else
@foreach ($products['items'] as $row) @php $sel = $this->selectedProductId === $row->id; @endphp
{{ $row->sku }}
{{ $row->name }}
@if ($row->diagram_count > 0) {{ $row->diagram_count }} diag @else no match @endif @if (($row->error_count ?? 0) > 0) {{ $row->error_count }} failed @endif @if ($row->assigned_count > 0) {{ $row->assigned_count }} done @endif
@endforeach
{{-- /sda-products-scroll --}}
Page {{ $products['page'] }} of {{ $products['last_page'] }}
@endif
{{-- ── Right: Diagram assignment ───────────────────────────────────────── --}}
@if (! $product)
{{-- Loading state while selectProduct request is in-flight --}}
Loading diagrams…
Select a product on the left to view matched diagrams.
@else {{-- Product header --}}
{{ $product->sku }}
{{ $product->name }}
@if (count($diagrams) > 0)
{{-- Generate all loading state --}} Generating all…
@endif
@if (count($diagrams) === 0)
No matched JLR diagrams with stored SVGs for this SKU.
@else
{{-- Diagram list --}}
Matched Diagrams
@foreach ($diagrams as $d) @php $selD = $this->selectedNodeId === $d->node_id; @endphp
{{ $d->callout_code }} {{ $d->cat_hie_desc ?? 'Diagram' }}
@if ($d->assignment_status === 'done') Done @elseif ($d->assignment_status === 'failed') Failed @elseif ($d->assignment_status === 'pending') Pending @endif
{{ $d->vehicle_name }} — node #{{ $d->node_id }}
@if ($d->breadcrumb_path)
{{ $d->breadcrumb_path }}
@endif
@endforeach
{{-- Preview panel --}} @php $selDiagram = collect($diagrams)->firstWhere('node_id', $this->selectedNodeId); $targetCallout = (string) ($selDiagram?->callout_code ?? ''); $previewSku = $product?->sku ?? ''; $generatedUrl = $this->generatedImageUrl; @endphp
Preview
{{-- Shimmer: shown during Livewire loading --}}
@if ($preview)
{{-- Always render the source SVG natively — it scales losslessly at any display size. The generated JPEG is only for product images pushed to Shopify; showing it here at ~27% scale made badges unreadably small. --}}
@if ($selDiagram?->assigned_at || $generatedUrl)
@if ($selDiagram?->assigned_at) Generated {{ \Carbon\Carbon::parse($selDiagram->assigned_at)->diffForHumans() }} — pushed to product images @endif @if ($generatedUrl) View image ↗ @endif
@endif @else
Select a diagram to preview.
@endif
@endif @endif
{{-- Notes drawer --}}
{{-- /x-data --}}