Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#837 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 #846

Merged
merged 16 commits into from
Feb 15, 2025

Conversation

Hyogyeong8
Copy link
Contributor

@Hyogyeong8 Hyogyeong8 commented Feb 4, 2025

Summary

It closes #837

Images or Screenshots

image

@Hyogyeong8 Hyogyeong8 self-assigned this Feb 4, 2025
@Hyogyeong8 Hyogyeong8 linked an issue Feb 4, 2025 that may be closed by this pull request
3 tasks
Copy link

netlify bot commented Feb 4, 2025

Deploy Preview for taxi-dev-preview failed.

Name Link
🔨 Latest commit 965268b
🔍 Latest deploy log https://app.netlify.com/sites/taxi-dev-preview/deploys/67b0bdd80d743600084fd0a2

@Hyogyeong8 Hyogyeong8 changed the title Add: posting for upadate readAt time 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 Feb 4, 2025
@Hyogyeong8 Hyogyeong8 changed the title 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 #837 채팅창에서 메세지별로 안 읽은 사람 수 보여주기 Feb 4, 2025
Copy link
Member

@kmc7468 kmc7468 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다..! 동작 엄청 잘 되네요! 드디어 숙원 사업 중 하나가 완료되는군요. 몇 가지 코멘트 남겼는데 확인 부탁드립니다

)}
<div css={styleMessageDetail}>
{unreadUsersNum(chat.time) > 0 && (
<UnreadUsers value={unreadUsersNum(chat.time)} />
Copy link
Member

Choose a reason for hiding this comment

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

UnreadUsers 컴포넌트를 별도로 분리하신 이유가 있나요?? 그냥 div를 바로 사용해도 좋을 것 같습니다

Copy link
Contributor Author

@Hyogyeong8 Hyogyeong8 Feb 15, 2025

Choose a reason for hiding this comment

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

넵 div 바로 사용하면 될 것 같습니다!

@@ -74,6 +81,24 @@ const MessageSet = ({ chats, layoutType, roomInfo }: MessageSetProps) => {
const isBot = authorId === "bot";
const isAlone = roomInfo.part.length === 1;

// Chat의 time에 따라 안 읽은 사람 수 설정
const unreadUsersNum = useCallback(
Copy link
Member

Choose a reason for hiding this comment

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

useCallback을 사용하는 것보다는, useMemo를 이용해서 안 읽은 사람 수 자체를 메모이제이션 하는게 성능상 더 유리할 것 같습니다!

Copy link
Contributor Author

@Hyogyeong8 Hyogyeong8 Feb 15, 2025

Choose a reason for hiding this comment

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

GPT 랑 얘기를 좀 해봤는데, 어짜피 readAtList랑 time이 많이 바뀌니깐 메모이제이션 해봤자 별 효용이 없다고 하네요. 그리고 웬만한 최적화는 react가 알아서 해준다고 합니다. 그래서 걍 메모이제이션 뺐습니다.

Copy link
Member

@kmc7468 kmc7468 left a comment

Choose a reason for hiding this comment

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

LGTM! 수고하셨습니다! 많은 요청사항 잘 들어주셔서 감사합니다~~

머지 전에 loadenv 수정 꼭 부탁드려용

@Hyogyeong8 Hyogyeong8 merged commit 34aaf27 into dev Feb 15, 2025
0 of 4 checks passed
@Hyogyeong8 Hyogyeong8 deleted the #837-show-number-of-unread-people-per-messages branch February 15, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

채팅창에서 메세지별로 안 읽은 사람 수 보여주기
2 participants