Skip to content

fix: 작업 선호도 오픈 모달 기수 확인 로직 제거#2093

Merged
seong-hui merged 1 commit intodevelopfrom
fix/#2092
Dec 13, 2025
Merged

fix: 작업 선호도 오픈 모달 기수 확인 로직 제거#2093
seong-hui merged 1 commit intodevelopfrom
fix/#2092

Conversation

@seong-hui
Copy link
Member

🤫 쉿, 나한테만 말해줘요. 이슈넘버

🧐 어떤 것을 변경했어요~?

🤔 그렇다면, 어떻게 구현했어요~?

❤️‍🔥 당신이 생각하는 PR포인트, 내겐 매력포인트.

📸 스크린샷, 없으면 이것 참,, 섭섭한데요?

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

Summary by CodeRabbit

버그 수정

  • 업무 선호도 이벤트 모달의 표시 조건이 단순화되고 최적화되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

useMatchMemberEvent 훅에서 모달 열기 조건의 로직을 단순화했습니다. 기수 확인(isLastGeneration) 조건을 제거하고, QA 또는 특정 팝업 기간 및 작업 선호도 활성화 여부에만 기반한 조건으로 개선했습니다.

Changes

코호트 / 파일 변경 요약
모달 열기 로직 단순화
src/components/matchmember/hooks/useMatchMemberEvent.ts
isLastGeneration 조건 제거. canOpenModal 로직을 !!myData && !isClosedToday && (isQA || (isSpecialPopupPeriod && myData.enableWorkPreferenceEvent))로 단순화

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • 단일 파일 수정으로 범위가 제한적
  • 조건식 제거 및 단순화로 논리 흐름이 명확함
  • isLastGeneration 변수 제거 시 다른 사용처 확인 필요

Possibly related PRs

  • fix: qa 반영 (배너, 홈팝업) #2079: 동일 파일(useMatchMemberEvent.ts)의 canOpenModal 로직을 수정하며, 기수 기반 조건을 제거하고 myData.enableWorkPreferenceEvent 확인으로 전환하는 동일한 변경 사항 포함
  • fix: QA #2090: 같은 작업 선호도 게이팅 로직을 수정하며, 기수 기반 체크를 myData.enableWorkPreferenceEvent로 대체하는 동일한 기능 플래그 조건 변경

Suggested reviewers

  • imddoy
  • ljh0608

Poem

🐰 기수 조건을 쏙 빼내고,
모달 로직 반짝반짝해졌네!
선호도만 살짝 확인하면,
팝업이 알맞게 뜬단 말이야 ✨
단순함이 최고의 예술이라네! 🎨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 명확하게 요약합니다. 기수 확인 로직 제거라는 구체적인 변경사항을 설명합니다.
Description check ✅ Passed PR 설명이 #2092 이슈를 언급하여 변경사항과 연결되어 있습니다. 템플릿 기반 형식이지만 핵심 정보는 포함되어 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항(isLastGeneration 조건 제거, canOpenModal 로직 단순화)이 #2092의 명예기수 작업 선호도 모달 오픈 로직 수정 목표와 일치합니다.
Out of Scope Changes check ✅ Passed 변경사항은 useMatchMemberEvent.ts 파일의 canOpenModal 로직 수정으로 제한되며, 모두 linked issue #2092의 범위 내에 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/#2092

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 github-actions bot requested a review from imddoy December 13, 2025 08:07
Copy link
Contributor

@imddoy imddoy left a comment

Choose a reason for hiding this comment

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

감사합니다!!!

@github-actions
Copy link

✨✨ 스토리북으로 확인하기 ✨✨

Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/matchmember/hooks/useMatchMemberEvent.ts (2)

4-4: 사용하지 않는 import를 제거하세요.

LATEST_GENERATION 상수가 더 이상 사용되지 않으므로 import를 제거해야 합니다.

다음 diff를 적용하세요:

-import { LATEST_GENERATION } from '@/constants/generation';

18-20: 중복된 useEffect를 제거하세요.

Lines 18-20의 useEffect는 lines 33-45의 useEffect와 동일한 isQA 설정 로직을 중복으로 포함하고 있습니다. 두 번째 useEffect가 더 완전한 로직을 수행하므로 첫 번째 useEffect는 불필요합니다.

다음 diff를 적용하여 중복을 제거하세요:

-  useEffect(() => {
-    setIsQA(typeof window !== 'undefined' && localStorage.getItem('BALANCEGAME_OPEN') === 'true');
-  }, []);
-
🧹 Nitpick comments (1)
src/components/matchmember/hooks/useMatchMemberEvent.ts (1)

23-23: 하드코딩된 true 값을 확인하세요.

isSpecialPopupPeriod가 현재 true로 하드코딩되어 있습니다. 이것이 의도적인 것인지 확인하고, 향후 이벤트 기간이 종료되면 이 값을 변경하거나 시간 기반 로직으로 전환해야 할 수 있습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e68012 and 3a61b0c.

📒 Files selected for processing (1)
  • src/components/matchmember/hooks/useMatchMemberEvent.ts (1 hunks)
⏰ 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). (2)
  • GitHub Check: build-app / build
  • GitHub Check: chromatic-deploy

Comment on lines 47 to +48
const canOpenModal =
!!myData &&
!isClosedToday &&
(isQA || (isSpecialPopupPeriod && isLastGeneration && myData.enableWorkPreferenceEvent));
!!myData && !isClosedToday && (isQA || (isSpecialPopupPeriod && myData.enableWorkPreferenceEvent));
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for enableWorkPreferenceEvent usage
rg -n -C3 'enableWorkPreferenceEvent'

Repository: sopt-makers/sopt-playground-frontend

Length of output: 2395


🏁 Script executed:

#!/bin/bash
# Examine the file to understand the full context
cat -n src/components/matchmember/hooks/useMatchMemberEvent.ts | head -80

Repository: sopt-makers/sopt-playground-frontend

Length of output: 2197


🏁 Script executed:

#!/bin/bash
# Search for isLastGeneration or LATEST_GENERATION references to understand what was removed
rg -n 'isLastGeneration|LATEST_GENERATION' --type ts --type tsx

Repository: sopt-makers/sopt-playground-frontend

Length of output: 107


🏁 Script executed:

#!/bin/bash
# Search for any reference to LATEST_GENERATION in the ts/tsx files
rg 'LATEST_GENERATION' -t ts

Repository: sopt-makers/sopt-playground-frontend

Length of output: 3460


🏁 Script executed:

#!/bin/bash
# Check git log for recent changes to this file
git log --oneline -20 src/components/matchmember/hooks/useMatchMemberEvent.ts

Repository: sopt-makers/sopt-playground-frontend

Length of output: 118


미사용 import를 제거하세요.

기수 확인 로직이 제거되어 이제 myData.enableWorkPreferenceEventtrue인 모든 기수의 사용자가 모달을 열 수 있습니다. 이 변경에 따라 더 이상 사용되지 않는 LATEST_GENERATION import를 제거해야 합니다. 또한 명예기수를 포함한 모든 대상 사용자에 대해 백엔드에서 enableWorkPreferenceEvent 플래그가 올바르게 설정되는지 확인하세요.

🤖 Prompt for AI Agents
In src/components/matchmember/hooks/useMatchMemberEvent.ts around lines 47-48,
remove the now-unused LATEST_GENERATION import and any references to it (cleanup
unused imports), then run the linter/build to ensure no leftover references;
additionally, coordinate with backend to confirm the enableWorkPreferenceEvent
flag is set for all target users (including honorary generations) so the
frontend condition (!!myData && !isClosedToday && (isQA || (isSpecialPopupPeriod
&& myData.enableWorkPreferenceEvent))) works correctly.

@github-actions
Copy link

🚀 프리뷰 배포 확인하기 🚀

https://539c9393.sopt-internal-dev.pages.dev

@seong-hui seong-hui merged commit bfa27c5 into develop Dec 13, 2025
7 checks passed
@seong-hui seong-hui deleted the fix/#2092 branch December 13, 2025 08:10
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.

fix: 명예기수 작업 선호도 모달 오픈 로직 수정

2 participants