From 011bf0fbca88b1f1bbc7902f6ac781208248c706 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 30 Apr 2026 21:40:55 -0500 Subject: [PATCH] up --- resources/views/chat-publico.blade.php | 91 ++++++++++- .../views/livewire/chat/public-chat.blade.php | 144 +++++++++++------- 2 files changed, 179 insertions(+), 56 deletions(-) diff --git a/resources/views/chat-publico.blade.php b/resources/views/chat-publico.blade.php index c4d8caf..6c224d5 100644 --- a/resources/views/chat-publico.blade.php +++ b/resources/views/chat-publico.blade.php @@ -2,18 +2,105 @@ - + {{-- viewport-fit=cover expone las safe areas del notch/Dynamic Island --}} + + + {{-- Apple PWA / standalone --}} + + + Chat en vivo | {{ config('app.name') }} + @livewireStyles - + @livewireScripts + + diff --git a/resources/views/livewire/chat/public-chat.blade.php b/resources/views/livewire/chat/public-chat.blade.php index 0bb150f..7aaf45f 100644 --- a/resources/views/livewire/chat/public-chat.blade.php +++ b/resources/views/livewire/chat/public-chat.blade.php @@ -1,11 +1,17 @@ -
+{{-- + id="chat-root" es el ancla que usa el visualViewport JS para ajustar altura cuando + aparece el teclado iOS. Ocupa todo el viewport disponible (cuerpo del body). +--}} +
{{-- ══ PASO 1: Formulario de inicio ══ --}} @if ($paso === 'telefono') -
-
+
+
-
+
@@ -17,20 +23,36 @@
- - + + {{-- font-size 16px (via CSS global) evita el zoom automático en Safari --}} + @error('telefono') {{ $message }} @enderror
- - + +
+ {{-- min-height 48px = cumple Apple HIG de target táctil --}} @@ -43,73 +65,87 @@ @else
+ x-on:scroll-chat.window="$nextTick(() => { + const el = document.getElementById('pub-messages'); + if (el) el.scrollTop = el.scrollHeight; + })"> - {{-- Header --}} -
-
- - - -
-
-

Soporte en línea

-

- @if ($estadoConv === 'agente') Atendido por un agente - @elseif ($estadoConv === 'cerrada') Conversación cerrada - @else Bot activo - @endif -

+ {{-- Header + safe area top (para el notch / Dynamic Island) --}} +
+
+
+ + + +
+
+

Soporte en línea

+

+ @if ($estadoConv === 'agente') Atendido por un agente + @elseif ($estadoConv === 'cerrada') Conversación cerrada + @else Bot activo + @endif +

+
- {{-- Mensajes --}} -
+ {{-- Mensajes — ios-scroll da momentum nativo en iPhone --}} +
@forelse($mensajes as $msg) @if ($msg['tipo'] === 'usuario')
-
-

{{ $msg['contenido'] }}

- {{ $msg['created_at'] }} +
+

{{ $msg['contenido'] }}

+ {{ $msg['created_at'] }}
@else
-
+
@if ($msg['tipo'] === 'agente') - Agente + Agente @endif -

{{ $msg['contenido'] }}

- {{ $msg['created_at'] }} +

{{ $msg['contenido'] }}

+ {{ $msg['created_at'] }}
@endif @empty
Iniciando chat...
@endforelse + {{-- Ancla para scroll al fondo --}} +
- {{-- Input --}} + {{-- Input + safe area bottom (home indicator iPhone X+) --}} @if ($estadoConv !== 'cerrada') -
- - +
+
+ + {{-- 44x44 mínimo Apple HIG --}} + +
@else -
+
Esta conversación ha sido cerrada.
@endif