Fix: Corregir bugs en interfaz de mensajes
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m8s

- Corregir modal de imagen vacío (agregar template #default a UModal)
- Agregar soporte para click derecho y long press en selector de reacciones
- Agregar fondo sólido al card de reacciones (bg-[var(--wa-surface)])
This commit is contained in:
2025-12-03 09:51:56 -06:00
parent 768d8ee8e2
commit b335405ac9
3 changed files with 62 additions and 37 deletions

View File

@@ -15,6 +15,10 @@
<div <div
class="relative max-w-[70%] rounded-lg overflow-hidden" class="relative max-w-[70%] rounded-lg overflow-hidden"
:class="bubbleClass" :class="bubbleClass"
@contextmenu.prevent="showReactionPicker = true"
@touchstart="onTouchStart"
@touchend="onTouchEnd"
@touchmove="onTouchEnd"
> >
<!-- Quoted message --> <!-- Quoted message -->
<div v-if="message.quoted" class="px-2 pt-2"> <div v-if="message.quoted" class="px-2 pt-2">
@@ -235,6 +239,22 @@ const emit = defineEmits<{
const showDebug = ref(false) const showDebug = ref(false)
const showReactionPicker = ref(false) const showReactionPicker = ref(false)
// Long press timer for mobile
let longPressTimer: ReturnType<typeof setTimeout> | null = null
const onTouchStart = () => {
longPressTimer = setTimeout(() => {
showReactionPicker.value = true
}, 500) // 500ms long press
}
const onTouchEnd = () => {
if (longPressTimer) {
clearTimeout(longPressTimer)
longPressTimer = null
}
}
// Handle reaction selection // Handle reaction selection
const handleReaction = (emoji: string) => { const handleReaction = (emoji: string) => {
emit('react', props.message, emoji) emit('react', props.message, emoji)

View File

@@ -1,7 +1,7 @@
<template> <template>
<div <div
v-if="visible" v-if="visible"
class="absolute z-50 bg-[var(--wa-bg-dark)] rounded-full shadow-lg border border-[var(--wa-border)] p-1 flex items-center gap-1" class="absolute z-50 bg-[var(--wa-surface)] rounded-full shadow-lg border border-[var(--wa-border)] p-1 flex items-center gap-1"
:class="position === 'top' ? 'bottom-full mb-2' : 'top-full mt-2'" :class="position === 'top' ? 'bottom-full mb-2' : 'top-full mt-2'"
@click.stop @click.stop
> >
@@ -24,26 +24,28 @@
<!-- Full emoji picker modal --> <!-- Full emoji picker modal -->
<UModal v-model="showFullPicker"> <UModal v-model="showFullPicker">
<div class="p-4"> <template #default>
<h3 class="text-lg font-semibold mb-4 text-[var(--wa-text)]">Elegir reacción</h3> <div class="p-4 bg-[var(--wa-surface)]">
<h3 class="text-lg font-semibold mb-4 text-[var(--wa-text)]">Elegir reaccion</h3>
<div class="grid grid-cols-8 gap-2 max-h-64 overflow-y-auto"> <div class="grid grid-cols-8 gap-2 max-h-64 overflow-y-auto">
<button <button
v-for="emoji in allEmojis" v-for="emoji in allEmojis"
:key="emoji" :key="emoji"
class="w-10 h-10 flex items-center justify-center text-2xl hover:bg-[var(--wa-bg-light)] rounded transition-transform hover:scale-110" class="w-10 h-10 flex items-center justify-center text-2xl hover:bg-[var(--wa-bg-light)] rounded transition-transform hover:scale-110"
@click="selectReaction(emoji); showFullPicker = false" @click="selectReaction(emoji); showFullPicker = false"
> >
{{ emoji }} {{ emoji }}
</button> </button>
</div> </div>
<div class="mt-4 flex justify-end"> <div class="mt-4 flex justify-end">
<UButton variant="ghost" @click="showFullPicker = false"> <UButton variant="ghost" @click="showFullPicker = false">
Cancelar Cancelar
</UButton> </UButton>
</div>
</div> </div>
</div> </template>
</UModal> </UModal>
</template> </template>

View File

@@ -89,25 +89,28 @@
<!-- Fullscreen modal --> <!-- Fullscreen modal -->
<UModal v-model="showFullscreen" :ui="{ width: 'max-w-[95vw]' }"> <UModal v-model="showFullscreen" :ui="{ width: 'max-w-[95vw]' }">
<div class="relative bg-black flex items-center justify-center min-h-[50vh]"> <template #default>
<img <div class="relative bg-black flex items-center justify-center min-h-[50vh]">
:src="imageUrl" <img
:alt="'Imagen'" v-if="showFullscreen"
class="max-w-full max-h-[90vh] object-contain" :src="imageUrl"
/> :alt="'Imagen'"
<button class="max-w-full max-h-[90vh] object-contain"
class="absolute top-4 right-4 p-2 rounded-full bg-black/50 text-white hover:bg-black/70" />
@click="showFullscreen = false" <button
> class="absolute top-4 right-4 p-2 rounded-full bg-black/50 text-white hover:bg-black/70"
<UIcon name="i-lucide-x" class="w-6 h-6" /> @click="showFullscreen = false"
</button> >
<button <UIcon name="i-lucide-x" class="w-6 h-6" />
class="absolute bottom-4 right-4 p-2 rounded-full bg-black/50 text-white hover:bg-black/70" </button>
@click="downloadImage" <button
> class="absolute bottom-4 right-4 p-2 rounded-full bg-black/50 text-white hover:bg-black/70"
<UIcon name="i-lucide-download" class="w-6 h-6" /> @click="downloadImage"
</button> >
</div> <UIcon name="i-lucide-download" class="w-6 h-6" />
</button>
</div>
</template>
</UModal> </UModal>
</template> </template>