-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] 내 제휴, 닉네임 최초 값이 UI에 보이는 문제 해결 #395
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
Summary of ChangesHello @PeraSite, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 UI에서 데이터 로딩 전에 잘못된 초기값이 표시되는 두 가지 문제를 해결합니다. "내 제휴" 지도 클릭 시 학과 정보가 로딩되기 전 "내 제휴"가 보이는 현상과, 마이 페이지 진입 시 닉네임이 로딩되기 전 "닉네임"이 보이는 현상을 개선했습니다. 이는 로컬에 저장된 사용자 데이터를 초기값으로 활용하여 사용자 경험을 향상시킵니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
이 PR은 제휴 지도와 마이페이지에서 데이터가 로딩되기 전에 초기값이 잠시 보이는 문제를 해결합니다. SharedPreferences를 fallback으로 사용하여 로딩 중에도 이전에 저장된 값을 보여주도록 변경한 점이 좋습니다. 전반적으로 올바른 수정 방향이라고 생각합니다. 다만, MyPageViewModel에서 닉네임을 초기화하는 로직에 작은 개선점을 제안합니다.
| nickname = MySharedPreferences.getUserName(context).takeIf { | ||
| it.isNotBlank() | ||
| } |
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.
ViewModel이 초기화될 때 SharedPreferences에서 닉네임을 가져와 초기 상태를 설정하는 로직이 추가되었네요. 좋은 접근입니다.
다만, 현재 로직은 isNotBlank만 확인하고 있습니다. fetchMyInfo 메소드나 MyPageState의 hasNickname 로직을 보면, user-로 시작하는 닉네임은 유효하지 않은 것으로 처리하고 있습니다.
일관성을 유지하고, 'user-xxxx'와 같은 닉네임이 잠시 보였다가 사라지는 UI 깜빡임 현상을 방지하기 위해, 초기화 시점에도 startsWith("user-") 체크를 추가하는 것이 좋겠습니다.
| nickname = MySharedPreferences.getUserName(context).takeIf { | |
| it.isNotBlank() | |
| } | |
| nickname = MySharedPreferences.getUserName(context).takeIf { | |
| it.isNotBlank() && !it.startsWith("user-") | |
| } |
HI-JIN2
left a 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.
이거 PR 본문에 수정 전, 후를 나누어서 기재해주시면 좀 더 이해하기 수월할 것 같습니다~!
스크린샷이나 동영상 첨부도 같이 해도 좋구염
수고하셨습니다!
|
|
||
| // MainState | ||
| // MainState - 로컬 SharedPreferences를 fallback으로 사용 | ||
| val localDepartmentName = remember { MySharedPreferences.getUserDepartmentName(context) } |
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.
P1
요거 뷰모델로 옮기는게 좋을 것 같아욤
제가 로깅 때문에 뷰에서 바로 SharedPreferences 호출한 적이 있는 것 같은데, 이것두 같이 바꿔줄 수 있을까욤?
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.
그러네용 수정하겠습니다!
| val departmentId: Long = MySharedPreferences.getUserDepartmentId(context).toLong() | ||
| val collegeId: Long = MySharedPreferences.getUserCollegeId(context).toLong() | ||
|
|
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.
getUserCollegeDepartmentUseCase 이 usecase가 존재해서 MySharedPreferences값을 직접 가져오는 것보다 usecase를 활용하면 어떨까요!!
val departmentId: Long = getUserCollegeDepartmentUseCase().userDepartment.departmentId.toLong()
val collegeId: Long = getUserCollegeDepartmentUseCase().userCollege.collegeId.toLong()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.
헉 잊고 있었네요 수정하겠습니다!
kangyuri1114
left a 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.
👍 💯
# Conflicts: # app/src/main/java/com/eatssu/android/presentation/MainViewModel.kt # app/src/main/java/com/eatssu/android/presentation/map/MapViewModel.kt # app/src/main/java/com/eatssu/android/presentation/mypage/MyPageViewModel.kt
Summary
제휴 지도를 클릭했을 때 학과 정보가 로딩되기 전 "내 제휴" 라고 보이는 부분 수정
마이 페이지를 클릭했을 때 닉네임이 로딩되기 전 "닉네임" 이라고 보이는 부분 수정
Describe your changes
Issue
To reviewers