Skip to content

Comments

[refactor] 활동사진 지연로딩 제거#354

Merged
seongwon030 merged 6 commits intodevelop-fefrom
refactor/#353-load-images-at-once-FE-97
May 2, 2025
Merged

[refactor] 활동사진 지연로딩 제거#354
seongwon030 merged 6 commits intodevelop-fefrom
refactor/#353-load-images-at-once-FE-97

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Apr 29, 2025

#️⃣연관된 이슈

ex) #353

📝작업 내용

기존 동작

  • 이미지 순서대로 순차 로딩 방식

문제점

  • 데스크탑인 경우 다수의 이미지가 순차로딩되는 효과가 버벅거리는 것처럼 보입니다.
2025-04-29.13.04.03.mov

개선하기

  • delay * delayMs에서delayMs제거하여 일정 시간으로 유지. a13e618
  • 순차로딩 테스트코드 제거 ecadd77
2025-04-29.14.11.32.mov

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • Refactor

    • 이미지 지연 로딩 기능에서 개별 지연 시간(index, delayMs) 설정 옵션을 제거하고, 고정된 100ms 지연으로 단순화하였습니다.
  • Tests

    • index와 delayMs prop 관련 테스트를 삭제하였습니다.

@seongwon030 seongwon030 added 🔨 Refactor 코드 리팩토링 ✅ Test test 관련(storybook, jest...) 💻 FE Frontend labels Apr 29, 2025
@seongwon030 seongwon030 requested a review from oesnuj April 29, 2025 04:07
@seongwon030 seongwon030 self-assigned this Apr 29, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

"""

Walkthrough

이 변경 사항은 LazyImage 컴포넌트에서 이미지 로딩 지연을 위한 indexdelayMs props를 제거하고, 관련 테스트와 PhotoList 내 해당 props 사용을 삭제합니다. 이제 모든 이미지는 고정된 100ms 지연 후 동시에 로드됩니다. IntersectionObserver의 콜백과 useEffect 의존성도 단순화되었으며, 타임아웃 클리어링이 추가되었습니다. 컴포넌트의 나머지 로직과 렌더링 방식은 그대로 유지됩니다.

Changes

파일/경로 변경 요약
frontend/src/components/common/LazyImage/LazyImage.test.tsx indexdelayMs props 관련 이미지 지연 로딩 테스트 케이스 제거
frontend/src/components/common/LazyImage/LazyImage.tsx LazyImageProps에서 index, delayMs 제거, 고정 100ms 지연 적용, 관련 로직 및 useEffect 의존성 단순화, 타임아웃 클리어링 추가
frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx LazyImage 사용 시 index, delayMs props 전달 삭제

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PhotoList
    participant LazyImage
    participant IntersectionObserver

    User->>PhotoList: 페이지 진입
    PhotoList->>LazyImage: 여러 이미지 컴포넌트 렌더
    LazyImage->>IntersectionObserver: 뷰포트 진입 감지
    IntersectionObserver-->>LazyImage: 이미지가 뷰포트에 들어옴
    LazyImage->>LazyImage: 100ms 후 isVisible=true
    LazyImage->>User: 이미지 표시
Loading

Assessment against linked issues

Objective Addressed Explanation
활동 사진을 순차가 아닌 한 번에 가져오기 (FE-97)

Possibly related PRs

Suggested reviewers

  • oesnuj
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ca9c1a and 5b68034.

📒 Files selected for processing (1)
  • frontend/src/components/common/LazyImage/LazyImage.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/common/LazyImage/LazyImage.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link

netlify bot commented Apr 29, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 5b68034
🔍 Latest deploy log https://app.netlify.com/sites/moadong/deploys/68144d5fc52c8000082bd218
😎 Deploy Preview https://deploy-preview-354--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 33
Accessibility: 87
Best Practices: 92
SEO: 92
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@seongwon030 seongwon030 removed the ✅ Test test 관련(storybook, jest...) label Apr 29, 2025
@seongwon030 seongwon030 linked an issue Apr 29, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@oesnuj oesnuj left a comment

Choose a reason for hiding this comment

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

덕분에 새로운 걸 많이 알아갑니다 :)
이미지가 한 번에 로딩돼서 더 깔끔해 보이네요!
궁금한 점이 있어 몇 가지 코멘트 드렸습니다. 수고하셨습니다 👍👍

- timeout 변수를 useEffect 스코프에서 선언하도록 변경
- 컴포넌트 언마운트 시 clearTimeout 정상 동작 보장
@seongwon030 seongwon030 merged commit 548ac6b into develop-fe May 2, 2025
5 checks passed
@seongwon030 seongwon030 deleted the refactor/#353-load-images-at-once-FE-97 branch May 2, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] FE-97 활동 사진을 순차가 아닌 한 번에 가져오기

2 participants