Mejorar la responsividad de los chats fix #202
This commit is contained in:
@@ -20,8 +20,6 @@ import { useState, useEffect, useRef, useMemo } from 'react'
|
||||
|
||||
import { ImprovementCard } from './SaveAsignatura/ImprovementCardProps'
|
||||
|
||||
import type { IASugerencia } from '@/types/asignatura'
|
||||
|
||||
import ReferenciasParaIA from '@/components/planes/wizard/PasoDetallesPanel/ReferenciasParaIA'
|
||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar'
|
||||
import { Button } from '@/components/ui/button'
|
||||
@@ -55,16 +53,7 @@ interface SelectedField {
|
||||
value: string
|
||||
}
|
||||
|
||||
interface IAAsignaturaTabProps {
|
||||
asignatura?: Record<string, any>
|
||||
onAcceptSuggestion: (sugerencia: IASugerencia) => void
|
||||
onRejectSuggestion: (messageId: string) => void
|
||||
}
|
||||
|
||||
export function IAAsignaturaTab({
|
||||
onAcceptSuggestion,
|
||||
onRejectSuggestion,
|
||||
}: IAAsignaturaTabProps) {
|
||||
export function IAAsignaturaTab() {
|
||||
const queryClient = useQueryClient()
|
||||
const { asignaturaId } = useParams({
|
||||
from: '/planes/$planId/asignaturas/$asignaturaId',
|
||||
@@ -147,7 +136,7 @@ export function IAAsignaturaTab({
|
||||
const dynamicFields = datosGenerales?.datos
|
||||
? Object.keys(datosGenerales.datos).map((key) => {
|
||||
const estructuraProps =
|
||||
datosGenerales?.estructuras_asignatura?.definicion?.properties || {}
|
||||
datosGenerales.estructuras_asignatura?.definicion?.properties || {}
|
||||
return {
|
||||
key,
|
||||
label:
|
||||
|
||||
@@ -210,7 +210,7 @@ function RouteComponent() {
|
||||
return messages
|
||||
})
|
||||
}, [mensajesDelChat, activeChatId, availableFields])
|
||||
const scrollToBottom = (behavior = 'smooth') => {
|
||||
const scrollToBottom = (behavior: ScrollBehavior = 'smooth') => {
|
||||
if (scrollRef.current) {
|
||||
const scrollContainer = scrollRef.current.querySelector(
|
||||
'[data-radix-scroll-area-viewport]',
|
||||
@@ -218,7 +218,7 @@ function RouteComponent() {
|
||||
if (scrollContainer) {
|
||||
scrollContainer.scrollTo({
|
||||
top: scrollContainer.scrollHeight,
|
||||
behavior: behavior, // 'instant' para carga inicial, 'smooth' para mensajes nuevos
|
||||
behavior,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -576,7 +576,7 @@ function RouteComponent() {
|
||||
onBlur={(e) => {
|
||||
if (editingChatId === chat.id) {
|
||||
const newTitle =
|
||||
e.currentTarget.textContent?.trim() || ''
|
||||
e.currentTarget.textContent.trim() || ''
|
||||
if (newTitle && newTitle !== chat.nombre) {
|
||||
updateTitleMutation({
|
||||
id: chat.id,
|
||||
|
||||
Reference in New Issue
Block a user