Skip to content

[REFACTOR/#298] userID -> profileId 미반영된 부분 수정#300

Merged
seungjunGong merged 4 commits into
developfrom
refactor/#298-change_userId_to_profileId
Mar 31, 2026
Merged

[REFACTOR/#298] userID -> profileId 미반영된 부분 수정#300
seungjunGong merged 4 commits into
developfrom
refactor/#298-change_userId_to_profileId

Conversation

@seungjunGong

@seungjunGong seungjunGong commented Mar 30, 2026

Copy link
Copy Markdown
Member

Related issue 🛠

Work Description ✏️

  • userID -> profileId 미반영된 부분 수정
  • 필요없는 파일 및 코드 제거

Screenshot 📸

N/A

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

거의 다 왔네요 고생하셨습니다 ~

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 사용자 식별자 처리 방식을 개선하여 API 일관성성을 강화했습니다.
    • 불필요한 중복 데이터 구조를 제거하고 내부 코드 구조를 최적화했습니다.
    • 사용자 인터페이스 컴포넌트의 매개변수를 정리하여 유지보수성을 향상시켰습니다.

- `reportedUserId`를 `reportedUserProfileId`로 변경 (reportNavigation.kt, ReportPage, ReportViewModel.kt)
- `Ranker` 컴포넌트의 `myUserId` 파라미터를 `userProfileId`로 변경 및 관련 로직 수정
- `SearchInputScreen`에서 불필요한 람다 표현식 정리 및 `navigateToUserProfile` 직접 전달하도록 수정
@seungjunGong seungjunGong added the ♻️ REFACTOR 전면 수정, 리팩토링 label Mar 30, 2026
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 597cf9f5-b5cc-4edd-af7d-f447922cd587

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

이 PR은 애플리케이션에서 userIdmyProfileId 관련 식별자를 userProfileId로 통일하는 리팩토링을 수행합니다. UserSummaryUserSummaryDto 클래스를 제거하고, UI 컴포넌트와 네비게이션 계층 전반에서 파라미터명을 일관되게 변경합니다.

Changes

Cohort / File(s) Summary
데이터 모델 및 DTO 제거
app/src/main/java/com/smashing/app/data/model/event/UserSummary.kt, app/src/main/java/com/smashing/app/data/remote/dto/event/common/UserSummaryDto.kt
UserSummary 데이터 클래스와 UserSummaryDto 직렬화 클래스 완전 제거
홈 화면 UI 컴포넌트 업데이트
app/src/main/java/com/smashing/app/presentation/home/HomeScreen.kt, app/src/main/java/com/smashing/app/presentation/home/component/CloseMatching.kt
CloseMatching 컴포넌트에서 myProfileId 파라미터 제거, MatchedUserItem에서 userId 인자 제거 및 시그니처 단순화
랭킹 화면 식별자 파라미터명 변경
app/src/main/java/com/smashing/app/presentation/ranking/RankingScreen.kt, app/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.kt
myUserIduserProfileId로 파라미터명 변경, 클릭 핸들러 로직 업데이트로 자신의 프로필 여부에 따라 경로 분기
신고 네비게이션 및 ViewModel 업데이트
app/src/main/java/com/smashing/app/presentation/report/ReportViewModel.kt, app/src/main/java/com/smashing/app/presentation/report/navigation/reportNavigation.kt
reportedUserIdreportedUserProfileId로 네비게이션 함수, 라우트 데이터 클래스, ViewModel 로직 일관되게 변경
검색 입력 화면 간소화
app/src/main/java/com/smashing/app/presentation/search/input/SearchInputScreen.kt
제안 항목 클릭 핸들러 람다식을 직접 함수 참조로 변경

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ShinHyeongcheol
  • vahkjsdf
  • oilbeaneda
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 설명합니다. 'userID -> profileId 미반영된 부분 수정'이라는 제목은 리팩토링의 핵심 변경 사항을 직접적으로 반영합니다.
Description check ✅ Passed PR 설명이 템플릿의 필수 섹션(Related issue, Work Description, Screenshot, Uncompleted Tasks, To Reviewers)을 모두 포함하고 있으며, 작업 내용을 명확히 기술하고 있습니다.
Linked Issues check ✅ Passed 코드 변경이 #298 이슈의 목표(userID를 profileId로 일관되게 변경)를 충족합니다. 변수명, 파라미터명 통일과 불필요한 코드 제거가 완료되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #298 이슈의 범위 내에 있으며, userID -> profileId 리팩토링 및 불필요한 파일/코드 제거와 관련된 것입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#298-change_userId_to_profileId

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.kt`:
- Around line 80-85: The lambda onProfileClick currently shadows the outer
userProfileId so the comparison always succeeds and navigateToMyProfile() is
always called; rename the lambda parameter (e.g., targetProfileId) or explicitly
reference the outer property to compare the clicked profile id with the current
user's id, then call navigateToProfile(targetProfileId) when they differ and
navigateToMyProfile() when they are equal; update the onProfileClick declaration
and its uses accordingly to eliminate the shadowing bug.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d309e600-a4f6-47a1-b3dc-04699f6a2be3

📥 Commits

Reviewing files that changed from the base of the PR and between a191e93 and d3744a8.

📒 Files selected for processing (9)
  • app/src/main/java/com/smashing/app/data/model/event/UserSummary.kt
  • app/src/main/java/com/smashing/app/data/remote/dto/event/common/UserSummaryDto.kt
  • app/src/main/java/com/smashing/app/presentation/home/HomeScreen.kt
  • app/src/main/java/com/smashing/app/presentation/home/component/CloseMatching.kt
  • app/src/main/java/com/smashing/app/presentation/ranking/RankingScreen.kt
  • app/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.kt
  • app/src/main/java/com/smashing/app/presentation/report/ReportViewModel.kt
  • app/src/main/java/com/smashing/app/presentation/report/navigation/reportNavigation.kt
  • app/src/main/java/com/smashing/app/presentation/search/input/SearchInputScreen.kt
💤 Files with no reviewable changes (3)
  • app/src/main/java/com/smashing/app/data/model/event/UserSummary.kt
  • app/src/main/java/com/smashing/app/presentation/home/HomeScreen.kt
  • app/src/main/java/com/smashing/app/data/remote/dto/event/common/UserSummaryDto.kt

Comment on lines +80 to 85
val onProfileClick: (String) -> Unit = { userProfileId ->
if (userProfileId != userProfileId) {
navigateToProfile(userProfileId)
} else {
navigateToMyProfile()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

onProfileClick가 항상 내 프로필로 이동합니다.

람다 파라미터 userProfileId가 바깥의 userProfileId를 가려서, Line 81 비교가 항상 자기 자신과의 비교가 됩니다. 현재 상태로는 상위 랭커를 눌러도 navigateToMyProfile()만 호출됩니다.

수정 예시
-        val onProfileClick: (String) -> Unit = { userProfileId ->
-            if (userProfileId != userProfileId) {
-                navigateToProfile(userProfileId)
+        val onProfileClick: (String) -> Unit = { clickedUserProfileId ->
+            if (clickedUserProfileId != userProfileId) {
+                navigateToProfile(clickedUserProfileId)
             } else {
                 navigateToMyProfile()
             }
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/smashing/app/presentation/ranking/component/RankerItem.kt`
around lines 80 - 85, The lambda onProfileClick currently shadows the outer
userProfileId so the comparison always succeeds and navigateToMyProfile() is
always called; rename the lambda parameter (e.g., targetProfileId) or explicitly
reference the outer property to compare the clicked profile id with the current
user's id, then call navigateToProfile(targetProfileId) when they differ and
navigateToMyProfile() when they are equal; update the onProfileClick declaration
and its uses accordingly to eliminate the shadowing bug.

@oilbeaneda oilbeaneda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

최고 짱

@ShinHyeongcheol ShinHyeongcheol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

생각보다 많은 부분에서 빼먹었었네요...
수정 감사합니다!!

- RankingContract/ViewModel 내 `userInfo`를 `myRankInfo`로 변경
- Ranker 컴포저블의 `userProfileId` 파라미터를 `myProfileId`로 변경
- Ranker 내에서 본인 여부를 판단하는 비교 로직 오류 수정 (`userProfileId != userProfileId` -> `userProfileId != myProfileId`)

@vahkjsdf vahkjsdf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

짱짱 수고하셨씁니당

@seungjunGong seungjunGong merged commit 0068267 into develop Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ REFACTOR 전면 수정, 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] userID -> profileId 미반영된 부분 수정

4 participants