Skip to content

[Feature] 온보딩 api, 회원탈퇴 연결 #208

Merged
kimjw2003 merged 2 commits into
developfrom
FLT-20-온보딩-콘텐츠-검색-api-수정-장르-다중
Jun 2, 2026

Hidden character warning

The head ref may contain hidden characters: "FLT-20-\uc628\ubcf4\ub529-\ucf58\ud150\uce20-\uac80\uc0c9-api-\uc218\uc815-\uc7a5\ub974-\ub2e4\uc911"
Merged

[Feature] 온보딩 api, 회원탈퇴 연결 #208
kimjw2003 merged 2 commits into
developfrom
FLT-20-온보딩-콘텐츠-검색-api-수정-장르-다중

Conversation

@ckals413
Copy link
Copy Markdown
Contributor

@ckals413 ckals413 commented Jun 2, 2026

📮 관련 이슈

  • closed #이슈번호
    FLT_20_온보딩 콘텐츠 검색 api연결

📌 작업 내용

  • 회원탈퇴 수정된 api 반영
  • 장르선택 되는 콘텐츠 검색 api연결

📸 스크린샷

스크린샷
image

😅 미구현

  • [ ]

🫛 To. 리뷰어

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 검색 결과에 무한 스크롤 기능 추가
    • 온보딩 화면에서 복수 장르 선택 지원 (기존 단일 선택에서 변경)
  • 개선사항

    • 계정 탈퇴 기능 개선
    • 검색 기능 최적화 및 페이지네이션 처리 강화

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: acc5881c-612e-438a-a508-03cc56c6cb03

📥 Commits

Reviewing files that changed from the base of the PR and between 0556fa2 and 7bf14e9.

📒 Files selected for processing (9)
  • app/src/main/java/com/flint/data/api/AuthApi.kt
  • app/src/main/java/com/flint/data/dto/auth/request/WithdrawRequestDto.kt
  • app/src/main/java/com/flint/domain/mapper/search/SearchContentMapper.kt
  • app/src/main/java/com/flint/domain/model/search/SearchContentItemModel.kt
  • app/src/main/java/com/flint/domain/repository/AuthRepository.kt
  • app/src/main/java/com/flint/domain/repository/SearchRepository.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingUiState.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt
✅ Files skipped from review due to trivial changes (1)
  • app/src/main/java/com/flint/data/dto/auth/request/WithdrawRequestDto.kt
🚧 Files skipped from review as they are similar to previous changes (5)
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingUiState.kt
  • app/src/main/java/com/flint/domain/mapper/search/SearchContentMapper.kt
  • app/src/main/java/com/flint/domain/repository/AuthRepository.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt

📝 Walkthrough

Walkthrough

온보딩 검색 기능에 다중 장르 선택과 커서 기반 페이지네이션을 추가하고, 계정 탈퇴 API를 POST 방식으로 개선합니다. 무한 스크롤로 더 많은 콘텐츠를 로드할 수 있습니다.

Changes

온보딩 검색 및 탈퇴 기능

Layer / File(s) Summary
계정 탈퇴 API 및 저장소
app/src/main/java/com/flint/data/api/AuthApi.kt, app/src/main/java/com/flint/data/dto/auth/request/WithdrawRequestDto.kt, app/src/main/java/com/flint/domain/repository/AuthRepository.kt
AuthApiwithdraw 엔드포인트가 @DELETE에서 @POST로 변경되고, WithdrawRequestDto 요청 본문을 받도록 메서드 시그니처를 업데이트합니다. AuthRepository도 새로운 DTO를 생성하여 API에 전달하도록 변경됩니다.
검색 API 및 페이지네이션 데이터 모델
app/src/main/java/com/flint/domain/repository/SearchRepository.kt, app/src/main/java/com/flint/domain/model/search/SearchContentItemModel.kt, app/src/main/java/com/flint/domain/mapper/search/SearchContentMapper.kt
SearchRepository.getSearchContentList의 장르 파라미터가 genre: List<String>?으로 변경되고 빈 목록을 null로 변환합니다. SearchContentListModelnextCursor 필드를 추가하고, 매퍼가 응답의 커서를 모델에 매핑합니다.
온보딩 UI 상태 확장
app/src/main/java/com/flint/presentation/onboarding/OnboardingUiState.kt
OnboardingContentUiState에서 단일 장르 선택용 selectedGenre 필드를 제거하고, 다중 선택을 위한 selectedGenres: Set<String>, 페이지네이션을 위한 nextCursor: String?, 추가 로딩 상태인 isLoadingMore: Boolean 필드를 추가합니다.
온보딩 화면 무한 스크롤 구현
app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt
onLoadMore 콜백을 추가하고, 그리드 스크롤 상태를 감시하는 LaunchedEffect를 구현하여 스크롤이 끝에 도달하고 nextCursor가 존재하며 로딩 중이 아닐 때 콜백을 호출합니다. 장르 칩 선택 로직을 단일에서 다중 선택으로 변경합니다.
온보딩 ViewModel 다중 장르 및 페이지네이션 로직
app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt
초기 로드, 검색, 장르 토글을 다중 장르 Set 기반으로 업데이트합니다. 새로운 loadMoreContents() 메서드는 nextCursor를 기반으로 추가 검색을 수행하고 기존 결과와 신규 결과를 병합하여 페이지네이션을 구현합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • imflint/Flint-Android#207: AuthApi.withdraw 엔드포인트의 DELETE에서 POST로의 변경 및 WithdrawRequestDto 요청 본문 추가가 직접 겹칩니다.
  • imflint/Flint-Android#201: 온보딩 장르 선택을 단일에서 다중(selectedGenres)으로 변경하고 해당 콜백/상태 흐름을 확장하는 부분이 동일한 코드 경로를 건드립니다.
  • imflint/Flint-Android#206: SearchContentsResponseDto.meta.nextCursorSearchContentListModel.nextCursor로 매핑하는 검색 페이징 데이터 흐름을 공유합니다.

Suggested labels

🔖 API, Feat ✨

Suggested reviewers

  • kimjw2003
  • chanmi1125

🐰 페이지를 넘으며 콘텐츠 로드하고
다중 장르로 검색 폭을 넓혀
탈퇴도 POST로 깔끔하게
무한 스크롤의 즐거움이 펼쳐져
온보딩은 더욱 매끄러워졌네! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% 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 제목이 주요 변경사항을 명확히 반영합니다. 온보딩 API 연결과 회원탈퇴 API 연결이라는 핵심 기능을 간결하게 설명합니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 있으며, 관련 이슈, 작업 내용, 스크린샷이 포함되어 있습니다. 다만 일부 항목이 불완전합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch FLT-20-온보딩-콘텐츠-검색-api-수정-장르-다중

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.

Copy link
Copy Markdown
Contributor

@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

🧹 Nitpick comments (2)
app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt (1)

109-113: ⚡ Quick win

무한 스크롤 트리거 조건 개선 필요

현재 LaunchedEffect의 key가 gridState.canScrollForward만 사용되어, isLoadingMorefalse로 변경되어도 effect가 재실행되지 않습니다. 사용자가 이미 하단에 도달한 상태에서 추가 데이터 로드가 완료되면, 다음 페이지 로드를 위해 스크롤을 위로 올렸다가 다시 내려야 합니다.

isLoadingMorenextCursor 변화에도 반응하도록 key를 확장하는 것을 권장합니다.

♻️ 권장 수정안
-    LaunchedEffect(gridState.canScrollForward) {
+    LaunchedEffect(
+        gridState.canScrollForward,
+        contentUiState.isLoadingMore,
+        contentUiState.nextCursor,
+    ) {
         if (!gridState.canScrollForward && contentUiState.nextCursor != null && !contentUiState.isLoadingMore) {
             onLoadMore()
         }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt`
around lines 109 - 113, The LaunchedEffect currently only keys off
gridState.canScrollForward so it won't re-run when contentUiState.isLoadingMore
or contentUiState.nextCursor change; update the LaunchedEffect key to include
gridState.canScrollForward, contentUiState.isLoadingMore, and
contentUiState.nextCursor (use their primitive/value properties) and keep the
same body that calls onLoadMore() when !gridState.canScrollForward &&
contentUiState.nextCursor != null && !contentUiState.isLoadingMore so the effect
retriggers when loading finishes or nextCursor changes.
app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt (1)

196-228: 💤 Low value

페이지네이션 구현 확인 - 중복 콘텐츠 방지

병합 로직에서 중복 콘텐츠를 필터링하지 않고 있습니다. 커서 기반 페이지네이션에서 일반적으로 중복이 발생하지 않지만, 백엔드 데이터 변경이나 네트워크 재시도 시 동일 콘텐츠가 포함될 수 있습니다. 이 경우 LazyVerticalGrid에서 동일한 key가 발생해 경고가 출력됩니다.

현재 구현이 문제를 일으킬 가능성은 낮으나, 방어적으로 중복 제거를 추가하는 것을 고려해 주세요.

♻️ 선택적 수정안
 .onSuccess { result ->
-    val merged = (currentItems + result.contents).toImmutableList()
+    val existingIds = currentItems.map { it.id }.toSet()
+    val newItems = result.contents.filterNot { it.id in existingIds }
+    val merged = (currentItems + newItems).toImmutableList()
     _contentUiState.update { it.copy(
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt`
around lines 196 - 228, In loadMoreContents, the merge of currentItems +
result.contents can introduce duplicate items causing duplicate keys in
LazyVerticalGrid; update the merge before emitting to _contentUiState so
duplicates are removed (e.g., use distinctBy on the content identifier field
present in the items) — locate the merge in loadMoreContents where merged is
created and replace it with a de-duplicated list (retain original ordering or
prefer new items as needed), then emit UiState.Success with that deduplicated
collection and existing nextCursor/isLoadingMore updates; ensure you reference
the same item id property used across your UI keying logic and keep using
searchRepository.getSearchContentList and OnboardingContentUiState.GENRES as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/com/flint/domain/repository/AuthRepository.kt`:
- Around line 42-45: The withdraw function currently uses a hardcoded default
agreedTermsIds = listOf("10") which can send incorrect consent data; remove the
default so suspend fun withdraw(agreedTermsIds: List<String>): Result<Unit>
requires callers to pass the selected IDs, and construct the WithdrawRequestDto
with that parameter as before (WithdrawRequestDto(agreedTermsIds =
agreedTermsIds)) and update all call sites that relied on the default to supply
the actual selected list; keep the suspendRunCatching and api.withdraw(…) usage
intact.

---

Nitpick comments:
In
`@app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt`:
- Around line 109-113: The LaunchedEffect currently only keys off
gridState.canScrollForward so it won't re-run when contentUiState.isLoadingMore
or contentUiState.nextCursor change; update the LaunchedEffect key to include
gridState.canScrollForward, contentUiState.isLoadingMore, and
contentUiState.nextCursor (use their primitive/value properties) and keep the
same body that calls onLoadMore() when !gridState.canScrollForward &&
contentUiState.nextCursor != null && !contentUiState.isLoadingMore so the effect
retriggers when loading finishes or nextCursor changes.

In `@app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt`:
- Around line 196-228: In loadMoreContents, the merge of currentItems +
result.contents can introduce duplicate items causing duplicate keys in
LazyVerticalGrid; update the merge before emitting to _contentUiState so
duplicates are removed (e.g., use distinctBy on the content identifier field
present in the items) — locate the merge in loadMoreContents where merged is
created and replace it with a de-duplicated list (retain original ordering or
prefer new items as needed), then emit UiState.Success with that deduplicated
collection and existing nextCursor/isLoadingMore updates; ensure you reference
the same item id property used across your UI keying logic and keep using
searchRepository.getSearchContentList and OnboardingContentUiState.GENRES as-is.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e33d7206-2b78-4e9e-a483-389cafccd3bb

📥 Commits

Reviewing files that changed from the base of the PR and between e10c479 and 0556fa2.

📒 Files selected for processing (10)
  • app/src/main/java/com/flint/data/api/AuthApi.kt
  • app/src/main/java/com/flint/data/api/SearchApi.kt
  • app/src/main/java/com/flint/data/dto/auth/request/WithdrawRequestDto.kt
  • app/src/main/java/com/flint/domain/mapper/search/SearchContentMapper.kt
  • app/src/main/java/com/flint/domain/model/search/SearchContentItemModel.kt
  • app/src/main/java/com/flint/domain/repository/AuthRepository.kt
  • app/src/main/java/com/flint/domain/repository/SearchRepository.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingContentScreen.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingUiState.kt
  • app/src/main/java/com/flint/presentation/onboarding/OnboardingViewModel.kt

Comment on lines +42 to +45
// :TODO 일단 10으로 고정해둠 수정예정
suspend fun withdraw(agreedTermsIds: List<String> = listOf("10")): Result<Unit> =
suspendRunCatching {
api.withdraw()
api.withdraw(WithdrawRequestDto(agreedTermsIds = agreedTermsIds))
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jun 2, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

탈퇴 약관 ID 기본값을 저장소 API에 고정하지 마세요.

Line 43의 listOf("10") 때문에 호출부가 값을 빠뜨리면 항상 특정 약관 ID로 탈퇴 요청이 전송됩니다. 약관 ID가 서버 설정과 달라지는 순간 탈퇴가 실패하거나 잘못된 동의 이력이 남을 수 있어서, 여기서는 기본값을 두지 말고 현재 화면에서 선택된 값을 반드시 넘기도록 강제하는 편이 안전합니다.

변경 예시
-    // :TODO 일단 10으로 고정해둠 수정예정
-    suspend fun withdraw(agreedTermsIds: List<String> = listOf("10")): Result<Unit> =
+    suspend fun withdraw(agreedTermsIds: List<String>): Result<Unit> =
         suspendRunCatching {
             api.withdraw(WithdrawRequestDto(agreedTermsIds = agreedTermsIds))
             preferencesManager.clearAll()
         }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/flint/domain/repository/AuthRepository.kt` around lines
42 - 45, The withdraw function currently uses a hardcoded default agreedTermsIds
= listOf("10") which can send incorrect consent data; remove the default so
suspend fun withdraw(agreedTermsIds: List<String>): Result<Unit> requires
callers to pass the selected IDs, and construct the WithdrawRequestDto with that
parameter as before (WithdrawRequestDto(agreedTermsIds = agreedTermsIds)) and
update all call sites that relied on the default to supply the actual selected
list; keep the suspendRunCatching and api.withdraw(…) usage intact.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

위에 TODO로 남겨둠 수정예정입니다

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ckals413, TODO 주석으로 남겨두신 것 확인했습니다. 나중에 수정하실 때 잊지 않도록 GitHub 이슈로 트래킹해 드릴까요? 원하시면 말씀해 주세요.


🧠 Learnings used
Learnt from: nahy-512
Repo: imflint/Flint-Android PR: 135
File: app/src/main/java/com/flint/domain/repository/AuthRepository.kt:1-22
Timestamp: 2026-01-19T00:48:44.889Z
Learning: Architect the Android app following Google's recommended Android App Architecture for this repo: place the data layer innermost, the domain layer can depend on the data layer, and avoid circular dependencies with other layers. For Kotlin files under app/src/main/java, ensure accompanying architecture aligns with this guidance (e.g., domain interfaces depending on data layer implementations or abstractions, not the other way around).

Learnt from: giovannijunseokim
Repo: imflint/Flint-Android PR: 153
File: app/src/main/java/com/flint/presentation/collectiondetail/CollectionDetailViewModel.kt:98-105
Timestamp: 2026-01-21T08:37:42.767Z
Learning: Guideline: For APIs like toggleContentBookmark that do not return a bookmarkCount, perform optimistic updates by updating the isBookmarked state on the client and compute bookmarkCount locally if needed. Do not rely on the server for the count; ensure the server response only conveys the boolean bookmarked state and synchronize this state accordingly. This applies to Kotlin Android ViewModels and related UI state management across files that handle similar bookmark toggle endpoints.

@kimjw2003 kimjw2003 force-pushed the FLT-20-온보딩-콘텐츠-검색-api-수정-장르-다중 branch from 0556fa2 to 7bf14e9 Compare June 2, 2026 13:39
Copy link
Copy Markdown
Contributor

@kimjw2003 kimjw2003 left a comment

Choose a reason for hiding this comment

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

확인완료. conflict 해결완료

@kimjw2003 kimjw2003 merged commit 8d221be into develop Jun 2, 2026
2 checks passed
@kimjw2003 kimjw2003 deleted the FLT-20-온보딩-콘텐츠-검색-api-수정-장르-다중 branch June 2, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants