feat(chat): 종료 세션 진입 차단 + 협상중 인디케이터 sticky 유지
- init 에서 미참여/거부(4·5) 세션 진입을 NEGO_NOT_PARTICIPABLE 로 차단 (participate/reject 와 동일 규칙). 프론트는 목록으로 복귀 처리. - init 을 '진입 스냅샷'으로 격리: 화면 도중·포커스 재조회 제거, 언마운트 시 캐시 비움 → 정상 종료 후 튕김 방지 + 재진입 시 진입 게이트 재적용. - 인디케이터를 session_status 직접 비교 → wasInProgress sticky 플래그로 전환: 진행 화면에서 실시간 완료돼도 유지, 완료/거부 결과 열람 재진입 시엔 숨김. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e7be7d5b5f
commit
fc71526d5a
6 files changed
+62
-20
No files matched your search
@@ -2,7 +2,6 @@ import { useEffect, useRef, memo } from 'react'
|
||||
import { cn } from '@/lib'
|
||||
import { useChatStore } from '@/features/chat/stores/useChatStore'
|
||||
import { useChatInitStore } from '@/features/chat/stores/useChatInitStore'
|
||||
import { SessionStatus } from '@/apis/negotiation/negotiation.type'
|
||||
import type { ChatMessage as ChatMessageType } from '@/features/chat/types'
|
||||
import { renderEmphasis } from '@/features/chat/lib/emphasis'
|
||||
import { Indicator } from '@/features/chat/components/templates/Indicator'
|
||||
@@ -94,9 +93,10 @@ const MessageItem = memo(function MessageItem({
|
||||
})
|
||||
|
||||
const BotMessage = memo(function BotMessage({ message, isFirst }: { message: ChatMessageType; isFirst?: boolean }) {
|
||||
// 인디케이터는 진행 중인 협상에서만 표시 — 완료/거부 등 결과 열람 재진입 시에는 값이 와도 숨긴다
|
||||
const sessionStatus = useChatInitStore((s) => s.session_status)
|
||||
const showIndicator = sessionStatus === SessionStatus.IN_PROGRESS
|
||||
// 인디케이터는 이번 방문에서 '협상중'이었던 세션에서만 표시.
|
||||
// 진행 화면에서 실시간으로 완료되면 sticky 플래그로 계속 노출하고,
|
||||
// 완료/거부 세션에 결과 열람 목적으로 재진입한 경우엔 값이 와도 숨긴다.
|
||||
const showIndicator = useChatInitStore((s) => s.wasInProgress)
|
||||
return (
|
||||
<div className="mb-[56px]">
|
||||
<div className={cn('flex flex-col', !isFirst && 'pt-[36px]')}>
|
||||
|
||||
Reference in new issue
Block a user