Feat/ai review translate - #530
Conversation
caption2, 26dp
28 -> 36
여백은 컴포즈 자체 함수로 부여 부자연스러운 줄바꿈 해결
There was a problem hiding this comment.
Code Review
This pull request introduces a review translation feature to the EAT-SSU Android application, adding remote DTOs, domain models, use cases, and UI integration across the review list and my reviews screens. It also updates localizations (including a new Vietnamese translation) and adjusts various layout components. The review feedback highlights several improvement opportunities: resolving corrupted Korean characters (mojibake) in the test suite, caching fetched translations in the view models to prevent redundant network requests, disabling translation actions when the target language is Korean to avoid UI clutter, and replacing match_parent with 0dp in a ConstraintLayout within the sign-out activity layout.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| `when`("repository媛 由щ럭 踰덉뿭 寃곌낵瑜?諛섑솚?섎㈃") { | ||
| coEvery { reviewRepository.getReviewTranslation(1L, "EN") } returns translation | ||
|
|
||
| then("?숈씪 寃곌낵瑜?諛섑솚?쒕떎") { |
There was a problem hiding this comment.
| if (currentState?.isTranslated == true) { | ||
| _translationStates.value = _translationStates.value + ( | ||
| review.reviewId to currentState.copy(isTranslated = false) | ||
| ) | ||
| return | ||
| } |
There was a problem hiding this comment.
When toggling the translation back on, the view model launches a coroutine to fetch the translation from the network again, even if it was already fetched and stored in _translationStates. Checking if translatedContent is already cached allows toggling the translation state locally without making redundant network calls, saving user data and reducing server load.
| if (currentState?.isTranslated == true) { | |
| _translationStates.value = _translationStates.value + ( | |
| review.reviewId to currentState.copy(isTranslated = false) | |
| ) | |
| return | |
| } | |
| if (currentState?.translatedContent != null) { | |
| _translationStates.value = _translationStates.value + ( | |
| review.reviewId to currentState.copy(isTranslated = !currentState.isTranslated) | |
| ) | |
| return | |
| } |
| if (currentState?.isTranslated == true) { | ||
| _translationStates.value = _translationStates.value + ( | ||
| review.reviewId to currentState.copy(isTranslated = false) | ||
| ) | ||
| return | ||
| } |
There was a problem hiding this comment.
When toggling the translation back on, the view model launches a coroutine to fetch the translation from the network again, even if it was already fetched and stored in _translationStates. Checking if translatedContent is already cached allows toggling the translation state locally without making redundant network calls, saving user data and reducing server load.
| if (currentState?.isTranslated == true) { | |
| _translationStates.value = _translationStates.value + ( | |
| review.reviewId to currentState.copy(isTranslated = false) | |
| ) | |
| return | |
| } | |
| if (currentState?.translatedContent != null) { | |
| _translationStates.value = _translationStates.value + ( | |
| review.reviewId to currentState.copy(isTranslated = !currentState.isTranslated) | |
| ) | |
| return | |
| } |
| } | ||
| } | ||
|
|
||
| fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("KO", "EN", "JA", "VI") |
There was a problem hiding this comment.
Since EAT-SSU is primarily used by Soongsil University students, the vast majority of reviews are written in Korean. If targetLanguage is "KO", showing the 'Show translation' button on every review will create significant UI clutter for Korean users, who do not need translation for Korean reviews. Consider disabling the translation action when the target language is "KO", or only enabling it for foreign languages ("EN", "JA", "VI").
| fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("KO", "EN", "JA", "VI") | |
| fun shouldShowReviewTranslationAction(targetLanguage: String): Boolean = targetLanguage in setOf("EN", "JA", "VI") |
| android:id="@+id/tv_sign_out_description" | ||
| style="@style/Caption2" | ||
| android:layout_width="wrap_content" | ||
| android:layout_width="match_parent" |
There was a problem hiding this comment.
Using match_parent for android:layout_width inside a ConstraintLayout is an anti-pattern and can cause constraints (like layout_marginStart) or margins to be ignored or behave unexpectedly. Use 0dp (match_constraint) instead to let the view fill the available width while respecting constraints and margins.
| android:layout_width="match_parent" | |
| android:layout_width="0dp" |
- 오탈자 수정 - 인스타그램 추적 추가 - 베트남어 변경 추적 추가
8069fb1 to
da49a87
Compare
Fix/posthog qa
# Conflicts: # app/src/main/java/com/eatssu/android/data/remote/dto/response/ReviewTranslationResponse.kt # app/src/main/java/com/eatssu/android/data/remote/service/ReviewService.kt # app/src/main/java/com/eatssu/android/domain/model/ReviewTranslation.kt # app/src/main/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListScreen.kt # app/src/main/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListViewModel.kt # app/src/main/java/com/eatssu/android/presentation/cafeteria/review/translation/ReviewTranslationLanguage.kt # app/src/main/java/com/eatssu/android/presentation/cafeteria/review/translation/ReviewTranslationUiState.kt # app/src/main/java/com/eatssu/android/presentation/mypage/myreview/MyReviewListScreen.kt # app/src/main/java/com/eatssu/android/presentation/mypage/myreview/MyReviewViewModel.kt # app/src/test/java/com/eatssu/android/data/remote/repository/ReviewRepositoryImplBehaviorSpec.kt # app/src/test/java/com/eatssu/android/domain/usecase/review/ReviewDelegatingUseCasesBehaviorSpec.kt # app/src/test/java/com/eatssu/android/presentation/cafeteria/review/list/ReviewListViewModelBehaviorSpec.kt # app/src/test/java/com/eatssu/android/presentation/mypage/myreview/MyReviewViewModelBehaviorSpec.kt
Feat/review translation design
…eat/ai-review-translate # Conflicts: # app/src/main/res/values-vi/strings.xml
Summary
AI 리뷰 번역 기능 추가
Describe your changes
ReviewService,ReviewRepository에 리뷰 번역 API 호출 추가ReviewItem에 번역 보기/원문 보기 UI 추가Issue
To reviewers
서버 API 미배포 상태라 현재 dev 서버에서는 번역 버튼 클릭 시 404 발생
리뷰 시에는 번역 상태 관리, locale별 targetLanguage 처리, 리뷰 목록/내 리뷰 화면에서의 UI 연결 부분을 중점적으로 요먕.