Skip to content

♻️ Refactor : 채팅 로딩 추가 & 북마크 - 상세 페이지만 삭제#140

Merged
skyblue1232 merged 4 commits intodevelopfrom
refactor/#132/chat-bookmark
Nov 15, 2025
Merged

♻️ Refactor : 채팅 로딩 추가 & 북마크 - 상세 페이지만 삭제#140
skyblue1232 merged 4 commits intodevelopfrom
refactor/#132/chat-bookmark

Conversation

@KongMezu
Copy link
Copy Markdown
Contributor

@KongMezu KongMezu commented Nov 15, 2025

🔥 작업 내용

  • 채팅 로딩 추가
  • 북마크 상세 이벤트 페이지내에서만 삭제

🔗 이슈

PR Point (To Reviewer)

채팅

답변 받아오는 동안 로딩 애니메이션 추가 해놨습니다(이뻐요)
그리고 전송 버튼도 핑크로 바꿨습니다.

북마크 상세

도저히 연동이 오류 나서 이벤트 - 상세 페이지에서만 북마크 없앴습니다.
나머지 이벤트 페이지 / 마이페이지 / 마이페이지 이벤트 상세에선 다 됩니다.

이벤트 페이지 관련 행사

1개뜨면 밑에 1개만 뜨도록 했고 2개 다 없는 경우에는 아예 안뜨게 했습니다.
이게 더 깔끔하고 이쁠거 같아서요

📸 스크린샷

채팅 로딩

20251115-1458-58.0124398.mp4
image

이벤트 페이지 & 이벤트 상세

image image image

마이페이지 & 마이페이지 상세

image image

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 챗봇 메시지 송신 시 로딩 애니메이션 추가
    • 관련 이벤트 표시 방식 개선
  • 스타일

    • 전송 버튼 색상 업데이트
  • 버그 수정

    • 이벤트 페이지 오류 리다이렉트 로직 개선

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
af-fe Ready Ready Preview Comment Nov 15, 2025 3:51pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 15, 2025

Walkthrough

채봇 로딩 애니메이션 기능을 추가하고, 이벤트 카드의 좋아요 버튼 숨김 기능을 구현했습니다. 채봇 입력 버튼 색상을 업데이트하고, 관련 이벤트 렌더링 로직을 단순화했습니다.

Changes

Cohort / File(s) Change Summary
채봇 로딩 상태 관리
src/pages/chatbot/components/ChattingInput.tsx, src/pages/chatbot/components/ChattingLoading.tsx, src/pages/chatbot/index.tsx
새로운 ChattingLoading 컴포넌트를 추가하여 메시지 전송 중 로딩 상태를 시각적으로 표시. 채봇 인덱스 파일에 isLoading 상태 관리 로직 추가. 전송 버튼 배경색을 bg-mint-500에서 bg-pink-200으로 변경.
이벤트 카드 좋아요 버튼 제어
src/shared/components/container/EventCard.tsx
EventCardProps에 hideLike 속성 추가. 좋아요 버튼과 북마크 버튼을 hideLike 값에 따라 조건부 렌더링. 소형 레이아웃에서 컨테이너 너비를 17rem에서 전체 너비로 조정.
이벤트 페이지 관련 이벤트 렌더링
src/pages/events/[id].tsx
isEmptyItem 타입 가드 제거. 관련 이벤트 렌더링 로직을 단순화하여 nextEvents 기반으로 1개 또는 다중 항목 레이아웃 처리. 메인 EventCard에 hideLike={true} 추가.
마이페이지 이벤트 페이지 로직 개선
src/pages/mypage/events/[id].tsx
이펙트 훅의 리다이렉트 조건을 (!isLoading || !eventDetail)에서 (isError || !eventDetail)로 변경. Image 컴포넌트의 sizes 속성 따옴표 스타일 수정.
로딩 애니메이션 스타일
src/styles/globals.css
dotJump1, dotJump2, dotJump3 키프레임 애니메이션 추가. animate-dot1, animate-dot2, animate-dot3 유틸리티 클래스 추가 (0.7초 지속, 무한 반복, 0s/0.15s/0.3s 스테이거 지연).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as ChattingInput
    participant State as ChatPage State
    participant API as Chatbot API
    participant Loader as ChattingLoading

    User->>UI: 메시지 입력 후 전송 클릭
    UI->>State: 메시지 전송 트리거
    State->>State: isLoading = true
    State->>Loader: 렌더링 (show)
    State->>API: 챗봇 응답 요청
    API-->>State: 응답 수신
    State->>State: 메시지 포맷팅 및<br/>isLoading = false
    Loader-->>UI: 언마운트 (hide)
    UI->>User: 업데이트된 채팅 표시
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • EventCard.tsx: hideLike 속성이 여러 곳에서 조건부 렌더링에 사용되므로 의도된 동작 확인 필요
  • src/pages/events/[id].tsx: 관련 이벤트 렌더링 로직이 리팩토링되었으므로 레이아웃과 네비게이션 동작 검증 필요
  • ChatPage 로딩 상태: isLoading 상태 관리가 모든 메시지 전송 시나리오를 올바르게 처리하는지 확인
  • CSS 애니메이션: 새로운 dotJump 애니메이션이 의도한 시각적 효과를 제공하는지 검토

Possibly related PRs

Suggested labels

feat, style

Suggested reviewers

  • skyblue1232
  • jjangminii

Poem

🐰 분홍 점들이 춤을 추고,
채봇은 생각하는 척 기다리고,
좋아요 버튼은 숨을 수 있고,
이벤트 카드는 우아해지고,
모든 게 멋지게 흘러간답! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 명확하게 설명합니다: 채팅 로딩 애니메이션 추가와 북마크 삭제 기능(상세 페이지만)의 두 가지 주요 변경을 요약하고 있습니다.
Description check ✅ Passed PR 설명이 필수 섹션(작업 내용, 이슈, 검토 포인트, 스크린샷)을 모두 포함하고 있으며 각 변경사항이 명확히 설명되어 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#132/chat-bookmark

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🏷️ Labeler has automatically applied labels based on your PR title, branch name, or commit message.
Please verify that they are correct before merging.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/styles/globals.css (1)

255-271: 키프레임 애니메이션 중복 제거 권장

dotJump1, dotJump2, dotJump3 키프레임이 동일한 정의를 가지고 있습니다. 하나의 키프레임으로 통합하고 유틸리티 클래스에서만 지연 시간을 다르게 설정하는 것이 더 효율적입니다.

다음과 같이 리팩토링을 권장합니다:

-@keyframes dotJump1 {
-  0%   { transform: translateY(0); opacity: 0.5; }
-  50%  { transform: translateY(-0.35rem); opacity: 1; }
-  100% { transform: translateY(0); opacity: 0.5; }
-}
-
-@keyframes dotJump2 {
-  0%   { transform: translateY(0); opacity: 0.5; }
-  50%  { transform: translateY(-0.35rem); opacity: 1; }
-  100% { transform: translateY(0); opacity: 0.5; }
-}

-@keyframes dotJump3 {
+@keyframes dotJump {
   0%   { transform: translateY(0); opacity: 0.5; }
   50%  { transform: translateY(-0.35rem); opacity: 1; }
   100% { transform: translateY(0); opacity: 0.5; }
 }

 .animate-dot1 {
-  animation: dotJump1 0.7s infinite ease-in-out;
+  animation: dotJump 0.7s infinite ease-in-out;
 }
 .animate-dot2 {
-  animation: dotJump2 0.7s infinite ease-in-out;
+  animation: dotJump 0.7s infinite ease-in-out;
   animation-delay: 0.15s;
 }
 .animate-dot3 {
-  animation: dotJump3 0.7s infinite ease-in-out;
+  animation: dotJump 0.7s infinite ease-in-out;
   animation-delay: 0.3s;
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2880f95 and 11aa366.

📒 Files selected for processing (7)
  • src/pages/chatbot/components/ChattingInput.tsx (1 hunks)
  • src/pages/chatbot/components/ChattingLoading.tsx (1 hunks)
  • src/pages/chatbot/index.tsx (4 hunks)
  • src/pages/events/[id].tsx (1 hunks)
  • src/pages/mypage/events/[id].tsx (2 hunks)
  • src/shared/components/container/EventCard.tsx (5 hunks)
  • src/styles/globals.css (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
src/pages/chatbot/components/ChattingLoading.tsx (1)
src/pages/chatbot/components/ChattingBubble.tsx (2)
  • Chatting (32-44)
  • ChattingProps (28-30)
src/shared/components/container/EventCard.tsx (2)
src/shared/icons/components/icon.tsx (1)
  • Icon (58-130)
src/shared/hooks/events/useBookmark.ts (1)
  • eventId (8-48)
src/styles/globals.css (1)
src/shared/components/flipCard/FlipCard.tsx (1)
  • FlipCardProps (12-62)
src/pages/chatbot/index.tsx (1)
src/pages/chatbot/components/ChattingLoading.tsx (1)
  • ChattingLoading (3-11)
src/pages/events/[id].tsx (1)
src/shared/lib/utils.ts (1)
  • cn (71-73)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-deploy
🔇 Additional comments (10)
src/pages/chatbot/components/ChattingInput.tsx (1)

53-53: 전송 버튼 색상 변경 확인 완료

bg-mint-500에서 bg-pink-200으로 색상이 변경되어 PR 목표에 부합합니다.

src/pages/mypage/events/[id].tsx (1)

17-17: 리다이렉트 조건 로직 개선

이전 조건 (!isLoading || !eventDetail)은 논리적으로 항상 true가 될 수 있었습니다. 새로운 조건 (isError || !eventDetail)은 로딩이 완료된 후 에러 상태를 정확하게 확인합니다.

src/shared/components/container/EventCard.tsx (3)

21-21: hideLike 프로퍼티 추가 확인

북마크 버튼을 조건부로 숨기는 기능이 올바르게 구현되었습니다. 기본값 false로 기존 동작이 유지됩니다.

Also applies to: 34-34


107-128: 북마크 버튼 조건부 렌더링 구현 확인

!hideLike 조건으로 북마크 버튼이 올바르게 제어됩니다. medium과 large 사이즈 모두 일관되게 적용되었습니다.

Also applies to: 155-176


52-52: small 사이즈 레이아웃 변경 확인 완료

git 이력 검증 결과, 해당 변경은 의도적입니다:

  • 원본 (commit 6f5ecbb): w-[17rem] + justify-center
  • 현재 (commit 2093444): w-full + justify-start

변경사항은 "관련행사 분기별 처리" 커밋에서 수행되었으며, small 사이즈 EventCard는 src/pages/events/[id].tsx의 관련 행사 섹션에서만 2곳 사용됩니다. w-fulljustify-start는 부모 그리드 컨테이너(max-w-[35.4rem])의 레이아웃 맥락에서 적절한 변경으로, 다른 페이지에는 영향이 없습니다.

src/pages/events/[id].tsx (2)

98-98: 메인 이벤트 카드에 북마크 숨김 적용 확인

hideLike={true}가 추가되어 PR 목표대로 이벤트 상세 페이지의 메인 카드에서 북마크 버튼이 제거됩니다.


101-139: 관련 행사 렌더링 로직 단순화 및 북마크 동작 확인

isEmptyItem 타입 가드를 제거하고 렌더링 로직을 단순화했습니다. 코드가 더 명확해졌습니다.

다만, 관련 행사 카드들에는 hideLike 프로퍼티가 전달되지 않아 기본값 false가 적용되어 북마크 버튼이 표시됩니다. 이것이 의도된 동작인지 확인이 필요합니다. PR 목표는 "이벤트 상세 페이지에서만 북마크 삭제 기능 제거"인데, 관련 행사 섹션도 이벤트 상세 페이지의 일부입니다.

또한 관련 행사 카드의 addressdescription이 빈 문자열로 설정되어 있습니다. small 사이즈에서는 이 필드들이 표시되지 않으므로 문제없지만, 의도를 명확히 하기 위해 주석을 추가하는 것을 고려해보세요.

src/pages/chatbot/index.tsx (1)

125-129: 로딩 컴포넌트 렌더링 확인

isLoading 상태에 따라 ChattingLoading 컴포넌트가 조건부로 렌더링됩니다. 레이아웃도 적절하게 구성되었습니다.

src/pages/chatbot/components/ChattingLoading.tsx (1)

3-11: 로딩 컴포넌트 구현 확인

세 개의 애니메이션 점으로 구성된 간단하고 효과적인 로딩 인디케이터입니다. CSS 애니메이션을 활용하여 성능도 우수합니다.

src/styles/globals.css (1)

273-283: 애니메이션 유틸리티 클래스 구현 확인

지연 시간(delay)을 다르게 설정하여 순차적인 애니메이션 효과를 만들었습니다. 의도한 대로 동작합니다.


export default function ChatPage() {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

로딩 상태 관리 로직 구현 확인

isLoading 상태가 메시지 전송 전후로 올바르게 설정됩니다.

다만, catch 블록(Line 75-77)에서 에러 발생 시 isLoading이 리셋되지 않아 로딩 인디케이터가 계속 표시될 수 있습니다.

다음과 같이 수정을 권장합니다:

    } catch (err) {
+     setIsLoading(false);
      console.error('챗봇 응답 실패:', err);
    }

Also applies to: 61-68

🤖 Prompt for AI Agents
In src/pages/chatbot/index.tsx around line 32 (and similarly lines 61–68), the
isLoading state is set true before sending messages but not reset in the catch
block, causing the loading indicator to remain; update the error handling so
isLoading is set to false when an exception occurs (either by adding
setIsLoading(false) inside the catch block or refactoring to use a finally block
to always reset isLoading after the async operation), and ensure any early
returns still reset isLoading.

Copy link
Copy Markdown
Contributor

@skyblue1232 skyblue1232 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!!

@skyblue1232 skyblue1232 merged commit b971788 into develop Nov 15, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comment 필요한 주석 추가 및 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 북마크 동기화(상세 이벤트 페이지만) & 챗봇 채팅

2 participants