fix(dashboard): 회원 홈 AI 문장 현지화·데모 요약 경로 단일화·미사용 요약 필드 정리 - #2654
Merged
Merged
Conversation
- 홈 나트륨 경고에 음식 이름이 붙는 경우도 문장 키(sodium_over_sources)와 음식 이름 인자(ai_advice_params.foods)로 싣고, 앱은 ko/en ARB 문장으로 그린다. 서버 문장도 Accept-Language 를 따른다. - 하루 식단 코치 문장: 지난 날짜는 "그날"을 되짚는 문장으로, 나트륨 기준은 회원 목표(daily_sodium_mg)로 판정. 데모 인터셉터도 같은 규칙·요청 언어를 따르고, 시드의 한국어 큐레이션 문장은 한국어 화면에서만 쓴다. - 앱 가이드 예시 식단·운동 조언을 기존 조언 ARB 키로 교체. - 백엔드·인터셉터·표시 층별 테스트 추가. Refs #2644
- dashboardRepositoryProvider 의 목업 갈래 제거. 데모도 실서버와 같은 DioDashboardRepository 를 타고, dioProvider 의 LocalApiInterceptor 가 응답한다. - MockDashboardRepository 삭제. 위젯 테스트용 대역은 test/helpers 의 FakeDashboardRepository 로 이동. - 로컬 인터셉터: 식단·운동 기록을 추가·수정·삭제하면 시드 큐레이션 통합 조언과 그 날짜의 큐레이션 하루 코치 문장을 거두고, 이후로는 지금 기록으로 만든 조언을 낸다. 끼니를 모두 지운 데모 홈이 빈 상태와 실제 기록 기반 조언을 보여 준다. - 저장소 모드 테스트·데모 홈 위젯 테스트·인터셉터 테스트 갱신, API 카탈로그 사용처 수정. Refs #2645
- 백엔드 /dashboard/summary 에서 week_score·week_score_delta·nutrition_week_prev· exercise_calories·exercise_count·exercise_burn_goal 제거. 주간 점수 계산용 지난주 식단·운동 추가 조회와 _score_for·_avg_sodium_of_logged 도 함께 제거. 세 지표와 주간 추이의 일별 나트륨·당류는 같은 조회에서 나오므로 유지. - 모듈 docstring 의 기준치 설명을 회원 건강 목표·일일 권장 기준치 기준으로 수정. - 앱 DashboardSummary 에서 같은 필드와 sodiumIndicator·sugarIndicator getter, NutritionDay 의 sodiumMg·sugarG 제거. 로컬 인터셉터 응답·앱 가이드 예시에서도 같은 필드 제거. - 쓰이지 않던 MockPlaceRepository 삭제, 테스트는 placeRepositoryProvider 가 DioPlaceRepository 를 내는지 확인하도록 교체. - API_CONTRACT.md·API_CATALOG.md 대시보드 절 갱신, 필드 제거 확인 테스트 추가. Refs #2646
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: CSE-Sudo/on-care/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID:
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 |
10 tasks
10 tasks
6 tasks
…cleanup # Conflicts: # backend/app/api/v1/dashboard.py # frontend/flutter/lib/core/network/interceptors/local_api_interceptor.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Accept-Language를 따르게 함daily_sodium_mg)를 따름DioDashboardRepository→ 로컬 인터셉터 경로로 단일화. 끼니를 지우면 빈 상태와 실제 기록 기반 조언이 나옴MockPlaceRepository정리Changes
✨ Features
sodium_over_sources와ai_advice_params.foods(나트륨 상위 급원 음식 이름, 최대 두 개) 추가 — 앱은homeAdviceSodiumOverSources·homeAdviceFoodPairARB 문장 틀에 음식 이름을 끼워 그림🔧 Improvements
dashboardRepositoryProvider의 목업 갈래 제거,MockDashboardRepository삭제(위젯 테스트 대역은test/helpers/fake_dashboard_repository.dart로 이동)/dashboard/summary:week_score·week_score_delta·nutrition_week_prev·exercise_calories·exercise_count·exercise_burn_goal제거, 주간 점수용 지난주 식단·운동 추가 조회 제거(세 지표와 주간 추이 일별 나트륨·당류는 유지)DashboardSummary·NutritionDay에서 같은 필드와 쓰이지 않던 getter 제거MockPlaceRepository삭제(헬스장 지도·위치 로직은 그대로)🎨 UI/UX
ExerciseSessions)의 시드 기록 합계로 표시됨📝 Docs
backend/API_CONTRACT.md대시보드 절: 응답 필드,ai_advice_key값 목록,ai_advice_params, 제거한 필드 명시frontend/flutter/docs/API_CATALOG.md대시보드 사용처·예시 payload 갱신backend/app/api/v1/dashboard.py모듈 설명의 기준치 문구를 회원 건강 목표·일일 권장 기준치 기준으로 수정🐛 Fixes
Accept-Language를 무시하던 문제Commits
da92f6316fix(l10n): 홈 나트륨 경고·지난 날짜 식단 피드백·가이드 조언 현지화aaffb4f21refactor(dashboard): 데모 홈 요약 경로의 로컬 인터셉터 단일화f04c314edchore(dashboard): 홈이 읽지 않는 요약 필드와 쓰이지 않는 목업 코드 정리Notes
데모 운동 화면은 아직
MockExerciseRepository메모리에 기록하므로, 데모에서 운동을 추가해도 홈 운동 분은 시드 합계에 머문다. 운동 기록을 인터셉터·drift 로 옮기는 일은 feat(demo): 회원 앱 데모 운동 기록 새로고침 유지와 칼로리 종목 매칭 #2662 에서 다룬다(refactor(dashboard): 데모 홈 요약 경로의 로컬 인터셉터 단일화 #2645 댓글 참고).응답에서 필드를 뺀 변경이라 앱
DashboardSummary.fromJson은 뺀 필드가 있든 없든 파싱되게 두었습니다(배포 순서 무관). 트레이너 웹은/dashboard/summary를 쓰지 않습니다.데모 큐레이션 문장(시드의 "짬뽕 …" 하루 문장·통합 조언)은 한국어 화면에서, 회원이 기록을 바꾸기 전까지만 나옵니다. 영어 화면은 처음부터 수치 기반 문장입니다.
파일 겹침
lib/l10n/app_en.arb·app_ko.arb·lib/gen/l10n/*,backend/API_CONTRACT.md,test/features/exercise/exercise_health_goals_test.dart가 겹침. ARB 는 새 키 두 개 추가뿐이고, 테스트는 제거한 필드 인자만 뺐습니다.backend/API_CONTRACT.md, fix(member): 알림함 첫 로딩·프로필 이메일 중복·포인트 내역 더 보기 오류 안내 #2650 과local_api_interceptor.dart가 겹침. 병합 순서에 따라 gen 파일은flutter gen-l10n으로 다시 생성하면 됩니다.헬스장 지도·위치 기능 로직(신촌 기준)과 식단 기간 화면 재시도 정리는 이 PR 범위가 아닙니다.
Screenshots (Optional)
Test Plan
Manual Test Steps
Related Issues
Closes #2644
Closes #2645
Closes #2646
Checklist