-
Notifications
You must be signed in to change notification settings - Fork 4
[Feat] 내 정보 조회/수정 화면 기능 구현 #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough네비게이션 라우트 변경(ClubCodeInput에 파라미터 추가, UpdateMyInfo 제거), NavGraph 분기 로직 업데이트, 마이페이지 화면/뷰모델 전면 개편(조회/수정 로직 연동, 편집 모드), 클럽 컴포넌트 편집 모드 도입, EditMyInfo 화면 삭제, 내 정보 조회/수정용 DTO 및 원격/레포지토리 메서드 추가. Changes
Sequence Diagram(s)sequenceDiagram
actor U as User
participant S as MyPageScreen
participant VM as MyPageViewModel
participant R as MemberRepository
participant DS as RemoteMemberDataSource
participant API as HTTP_API
U->>S: 화면 진입
S->>VM: getMyInfo()
VM->>R: getMyInfo()
R->>DS: GET users/myPage
DS->>API: HTTP GET
API-->>DS: 200 + MyInfoResponseDto / Error
DS-->>R: ApiResult
R-->>VM: ApiResult
VM-->>S: uiState 업데이트 (nickname, clubs)
sequenceDiagram
actor U as User
participant S as MyPageScreen
participant VM as MyPageViewModel
participant R as MemberRepository
participant DS as RemoteMemberDataSource
participant API as HTTP_API
U->>S: 저장 버튼(편집 완료)
S->>VM: updateMyInfo(nickname, clubs)
VM->>R: updateMyInfo(...)
R->>DS: PATCH users/myPage/update
DS->>API: HTTP PATCH + UpdateMyInfoRequestDto
API-->>DS: 200 + UpdateMyInfoResponseDto / Error
DS-->>R: ApiResult
R-->>VM: ApiResult
alt 성공
VM->>VM: getMyInfo() 재호출 -> uiState 갱신
else 실패
VM-->>S: uiState.errorMessage 설정
end
sequenceDiagram
participant MP as MyPage
participant NAV as NavGraph
participant CC as ClubCodeInput
MP->>NAV: Route.ClubCodeInput(returnToMyPage=true)
NAV->>CC: 화면 진입
CC-->>NAV: 완료
NAV->>MP: navigateUp()
Note over NAV: 회원가입 흐름 (기본값 false)
MP->>NAV: Route.ClubCodeInput() (returnToMyPage=false)
NAV->>CC: 화면 진입
CC-->>NAV: 완료
NAV->>NAV: navigate(Home) + popUpTo(AuthGraph)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (1)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
composeApp/src/commonMain/kotlin/org/whosin/client/core/navigation/Route.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/core/navigation/WhosInNavGraph.kt(3 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/dto/request/UpdateMyInfoRequestDto.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/dto/response/MyInfoResponseDto.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/dto/response/UpdateMyInfoResponseDto.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/remote/RemoteMemberDataSource.kt(2 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/repository/MemberRepository.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/EditMyInfoScreen.kt(0 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/MyPageScreen.kt(4 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/MyPageViewModel.kt(1 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/component/MyClubComponent.kt(5 hunks)
💤 Files with no reviewable changes (1)
- composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/EditMyInfoScreen.kt
🧰 Additional context used
🧬 Code graph analysis (3)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/MyPageScreen.kt (2)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/component/MyPageTopAppBar.kt (1)
MyPageTopAppBar(19-29)composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/component/MyPageButton.kt (1)
MyPageButton(18-39)
composeApp/src/commonMain/kotlin/org/whosin/client/core/navigation/WhosInNavGraph.kt (1)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/auth/clubcode/ClubCodeInputScreen.kt (1)
ClubCodeInputScreen(51-298)
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/component/MyClubComponent.kt (1)
composeApp/src/commonMain/kotlin/ui/theme/Type.kt (1)
pretendardFontFamily(14-38)
🪛 detekt (1.23.8)
composeApp/src/commonMain/kotlin/org/whosin/client/data/remote/RemoteMemberDataSource.kt
[warning] 65-65: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
[warning] 103-103: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
⏰ 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: ios-build
- GitHub Check: android-build
🔇 Additional comments (1)
composeApp/src/commonMain/kotlin/org/whosin/client/core/navigation/WhosInNavGraph.kt (1)
119-126: 분기 처리 깔끔합니다. 신규 파라미터로 두 경로를 명확히 나눠서 플로우가 훨씬 선명해졌어요.
| onClick = { | ||
| if (uiState.isEditable) { | ||
| viewModel.updateMyInfo(uiState.nickname.trim(), uiState.clubs) | ||
| } | ||
| viewModel.toggleEditMode() | ||
| }, | ||
| text = stringResource( | ||
| if (uiState.isEditable) Res.string.complete_edit | ||
| else Res.string.edit_my_information | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
편집 완료 버튼이 실패해도 편집 모드를 종료합니다
지금 로직은 버튼을 누르면 API 성공 여부와 상관없이 toggleEditMode()가 실행되어 편집 모드가 바로 해제됩니다. 요청이 실패해도 사용자가 편집 상태를 잃어버려 수정 내용을 다시 입력해야 하는 문제가 생겨요. 아래처럼 성공 시에만 편집 모드를 종료하도록 분리해 주세요.
- onClick = {
- if (uiState.isEditable) {
- viewModel.updateMyInfo(uiState.nickname.trim(), uiState.clubs)
- }
- viewModel.toggleEditMode()
- },
+ onClick = {
+ if (uiState.isEditable) {
+ viewModel.updateMyInfo(uiState.nickname.trim(), uiState.clubs)
+ } else {
+ viewModel.toggleEditMode()
+ }
+ },위 수정과 함께 updateMyInfo 성공 분기에서 isEditable을 false로 내려주면 자연스러운 플로우가 완성됩니다.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onClick = { | |
| if (uiState.isEditable) { | |
| viewModel.updateMyInfo(uiState.nickname.trim(), uiState.clubs) | |
| } | |
| viewModel.toggleEditMode() | |
| }, | |
| text = stringResource( | |
| if (uiState.isEditable) Res.string.complete_edit | |
| else Res.string.edit_my_information | |
| ), | |
| onClick = { | |
| if (uiState.isEditable) { | |
| viewModel.updateMyInfo(uiState.nickname.trim(), uiState.clubs) | |
| } else { | |
| viewModel.toggleEditMode() | |
| } | |
| }, | |
| text = stringResource( | |
| if (uiState.isEditable) Res.string.complete_edit | |
| else Res.string.edit_my_information | |
| ), |
🤖 Prompt for AI Agents
In
composeApp/src/commonMain/kotlin/org/whosin/client/presentation/mypage/MyPageScreen.kt
around lines 130-139, the onClick currently calls viewModel.updateMyInfo(...)
then unconditionally viewModel.toggleEditMode(), which exits edit mode even if
the update fails; change the flow so toggleEditMode() is only invoked after a
successful update (remove the unconditional call), and instead handle edit-mode
state in the ViewModel by having updateMyInfo report success/failure (via
callback/State/Result) and set isEditable = false on success so the UI exits
edit mode only when the API call succeeds.
🚀 이슈번호
✏️ 변경사항
📷 스크린샷
Android
Screen_Recording_20251004_212026_WhosInClient.mp4
iOS
2025-10-04.21.21.22.mov
✍️ 사용법
🎸 기타
Summary by CodeRabbit
신기능
변경 사항