Skip to content

Comments

[fix] PhotoList 리팩토링 및 잠재적 버그 대응 작업#392

Merged
oesnuj merged 3 commits intodevelop-fefrom
fix/#389-photolist-fix-FE-109
May 9, 2025
Merged

[fix] PhotoList 리팩토링 및 잠재적 버그 대응 작업#392
oesnuj merged 3 commits intodevelop-fefrom
fix/#389-photolist-fix-FE-109

Conversation

@oesnuj
Copy link
Member

@oesnuj oesnuj commented May 9, 2025

#️⃣연관된 이슈

#389

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지/동영상 첨부 가능)

1. debounce 함수 사용 오류 수정

  • () => () => {} 형태의 잘못된 함수 전달을 단일 콜백 함수로 수정
  • resize 이벤트 발생 시 레이아웃 계산(updateIsMobile, updateContainerWidth)이 정상 작동하도록 복구

2. PhotoList 컴포넌트의 containerRef 누락 문제 해결

  • PhotoListWrapperref={containerRef}를 연결
  • useResponsiveLayout 훅이 DOM 크기를 제대로 측정할 수 있도록 개선

3. ModalOverlay의 성능 최적화 및 점진적 향상 적용

  • backdrop-filter@supports로 감싸 브라우저 지원 여부에 따라 처리
  • 미지원 브라우저에서는 fallback 배경색만 적용되어 성능 저하 방지

🗂 변경된 파일

  • frontend/src/hooks/PhotoList/useResponsiveLayout.ts
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoModal/PhotoModal.styles.ts

Summary by CodeRabbit

  • 버그 수정
    • PhotoList 컴포넌트에서 ref 콜백 문법 오류를 수정하고, 컨테이너에 ref 속성을 추가하여 참조가 가능하도록 개선했습니다.
  • 스타일
    • PhotoModal의 오버레이 스타일이 브라우저의 backdrop-filter 지원 여부에 따라 동적으로 적용되도록 변경되었습니다. 지원 시 블러 효과와 투명도가 조정되고, 미지원 시 기존 배경색과 투명도가 유지됩니다.
  • 리팩터
    • 반응형 레이아웃 관련 resize 이벤트 핸들러의 디바운스 처리가 간결하게 개선되었습니다.

@oesnuj oesnuj requested a review from seongwon030 May 9, 2025 08:26
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 9, 2025

Walkthrough

이번 변경에서는 PhotoList 컴포넌트와 관련된 리팩토링이 이루어졌습니다. debounce 래퍼 함수가 간소화되었고, ref 콜백의 JSX 문법 오류가 수정되었습니다. 또한, PhotoModal 오버레이의 스타일이 브라우저 지원 여부에 따라 동적으로 적용되도록 변경되었습니다.

Changes

파일/경로 변경 요약
frontend/src/hooks/PhotoList/useResponsiveLayout.ts resize 이벤트 핸들러의 debounce 래퍼 함수 구조를 단순화하여 불필요한 함수 중첩을 제거함.
frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx JSX 내 ref 콜백 문법 오류 수정 및 PhotoListWrapper에 containerRef 추가.
frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoModal/PhotoModal.styles.ts ModalOverlay의 blur 및 배경 스타일을 @supports로 감싸 브라우저 지원 여부에 따라 동적으로 적용.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PhotoList
  participant useResponsiveLayout
  participant StyledComponents

  User->>PhotoList: 페이지 진입/렌더링
  PhotoList->>useResponsiveLayout: 레이아웃 관련 훅 호출
  useResponsiveLayout->>PhotoList: isMobile, containerWidth 등 반환
  PhotoList->>StyledComponents: ref, style props 전달
Loading

Assessment against linked issues

Objective Addressed Explanation
PhotoList 리팩토링 및 잠재적 버그 대응 작업 (FE-109)

Possibly related PRs

Suggested labels

🔨 Refactor, 💻 FE

Suggested reviewers

  • seongwon030

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 79195c5 and 2f029f3.

📒 Files selected for processing (3)
  • frontend/src/hooks/PhotoList/useResponsiveLayout.ts (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx (1 hunks)
  • frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoModal/PhotoModal.styles.ts (1 hunks)
🔇 Additional comments (4)
frontend/src/hooks/PhotoList/useResponsiveLayout.ts (1)

22-25: debounce 함수 호출 패턴 수정이 적절하게 이루어졌습니다.

이전 코드에서는 () => () => {} 형태로 불필요한 중첩 함수를 사용했었는데, 이번 수정으로 올바른 단일 콜백 함수 패턴으로 변경되었습니다. 이로 인해 resize 이벤트 발생 시 updateIsMobileupdateContainerWidth 함수가 200ms 지연 후 정상적으로 호출될 수 있게 되었습니다.

frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoList.tsx (2)

55-56: 올바른 JSX 중괄호 닫기가 적용되었습니다.

ref 콜백 함수의 구문이 올바르게 수정되었습니다. JSX 내에서 함수 블록을 정확하게 닫는 것은 중요합니다.


59-59: containerRef가 제대로 할당되었습니다.

Styled.PhotoListWrapperref={containerRef} 속성을 추가함으로써 DOM 요소에 대한 참조가 올바르게 이루어집니다. 이는 useResponsiveLayout 훅이 컨테이너의 크기를 정확하게 측정하는데 필수적이며, 이전에는 이 참조가 누락되어 있었습니다.

frontend/src/pages/ClubDetailPage/components/PhotoList/PhotoModal/PhotoModal.styles.ts (1)

15-18: 브라우저 호환성 및 성능 최적화가 적절하게 구현되었습니다.

@supports 규칙을 사용하여 backdrop-filter 속성을 지원하는 브라우저에서만 블러 효과를 적용하도록 변경했습니다. 지원하지 않는 브라우저에서는 기본 불투명도만 적용되어 성능 저하를 방지합니다. 이는 다양한 브라우저 환경에서의 사용자 경험을 최적화하는 좋은 접근법입니다.

또한 블러 효과가 적용될 때는 배경색의 불투명도를 0.7에서 0.6으로 미세하게 조정하여 시각적 일관성을 유지했습니다.

✨ 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 May 9, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit 2f029f3
🔍 Latest deploy log https://app.netlify.com/sites/moadong/deploys/681dbc484673130008bc469e
😎 Deploy Preview https://deploy-preview-392--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: 42
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.

@oesnuj oesnuj added 💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels May 9, 2025
Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 !

@oesnuj oesnuj merged commit 74b7c32 into develop-fe May 9, 2025
5 checks passed
@oesnuj oesnuj deleted the fix/#389-photolist-fix-FE-109 branch May 10, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants