Skip to content

fix: 통증 부위 선택 후 화면 전환 시 조회#206

Closed
taekoong wants to merge 6 commits intomainfrom
fe/fix/pain-record
Closed

fix: 통증 부위 선택 후 화면 전환 시 조회#206
taekoong wants to merge 6 commits intomainfrom
fe/fix/pain-record

Conversation

@taekoong
Copy link
Collaborator

@taekoong taekoong commented Aug 28, 2025

Important

Updates pain area handling and UI in health screens, modifies API calls, and adds debugging in health_home_screen.dart, health_status_input_screen.dart, and pain_service.dart.

  • Behavior:
    • Updates pain area mapping in _convertPainAreaToKorean() in health_home_screen.dart and health_status_input_screen.dart to use uppercase keys.
    • Modifies _buildPainText() and _buildTitleText() to handle painArea as a list or single value.
    • Changes addPainRecord() in pain_service.dart to accept a list of painAreas and removes painLevel.
    • Updates _getSelectedPainAreas() in health_status_input_screen.dart to map body parts to PainArea enum.
  • UI:
    • Adds debugging print statements in health_home_screen.dart and health_status_input_screen.dart for painArea values.
    • Updates UI in health_status_input_screen.dart to handle chest and back selections separately based on view.
    • Adjusts UI feedback for pain record saving in health_status_input_screen.dart.
  • Misc:
    • Fixes newline issue in AndroidManifest.xml.

This description was created by Ellipsis for 2ced409. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • 신규 기능
    • 통증 부위를 다중 선택해 한 번에 저장
    • 좌/우 어깨·팔·다리 등 세분화된 부위 선택 지원
    • 앞/뒤 보기에서 가슴·등 선택 상태 정확히 반영
    • 한국어 표시 정확도 개선
  • 개선
    • 기록 제출을 단일 요청으로 간소화
    • 선택 여부 판단에 가슴·등 포함하여 정확도 향상
    • 오류 메시지 가독성 향상
  • 기타
    • 내부 구성 정리 및 안정화
    • Android 설정 파일 포맷 정리(기능 영향 없음)

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이 PR은 통증 부위 처리 전반을 개편하고, 여러 부위를 한 번에 제출하는 API로 전환한다. UI에서는 앞/뒤 보기 동기화와 가슴/등의 별도 상태를 도입하고, 번역 키를 대문자/세분화된 영역으로 변경했다. 서비스 레이어는 PainLevel 제거, PainArea 세분화, addPainRecord 시그니처 변경을 포함한다. Android/HealthService는 실질 변동 없음.

Changes

Cohort / File(s) Summary of changes
Health UI (번역/선택/동기화)
frontend/ongi/lib/screens/health/health_home_screen.dart, frontend/ongi/lib/screens/health/health_status_input_screen.dart
- 통증 부위 맵을 대문자/세분화 키로 교체, 리스트/단일 값 모두 처리
- 중복 제거 및 표시 로직 정비, 다중 항목 번역/집계 지원
- 앞/뒤 보기 동기화 로직 추가, 가슴/등 상태 별도 관리
- 선택된 부위로부터 세분화된 PainArea 리스트 산출
- 디버깅 로그 다수 추가, 에러 메시지 문자열 정리
Services (API/모델 정합)
frontend/ongi/lib/services/pain_service.dart, frontend/ongi/lib/services/health_service.dart
- addPainRecord: 단일 부위+강도 → 복수 부위(List)로 변경, 페이로드 갱신
- PainLevel 제거, PainArea를 좌/우 및 상세 부위로 확장/재매핑
- 오류 로그 강화 및 재throw 처리
- HealthService는 포맷 변경 외 기능 동일
Android (Manifest)
frontend/ongi/android/app/src/main/AndroidManifest.xml
- 내용 변화 없음(개행/공백 형식 차이)

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant HS as HealthStatusInputScreen
  participant PS as PainService
  participant API as Backend API
  participant HH as HealthHomeScreen

  U->>HS: 신체 부위 선택(앞/뒤 보기 전환 포함)
  HS->>HS: 가슴/등 별도 상태 반영 및 표시 동기화
  HS->>HS: 선택 부위 → 세분화 PainArea 리스트 변환
  U->>HS: 저장 버튼 탭
  HS->>PS: addPainRecord(date, painAreas[])
  PS->>API: POST /pain-record { date, painAreas }
  API-->>PS: 200/201 응답 또는 오류
  PS-->>HS: 성공/실패 결과 반환
  alt 성공
    HS-->>HH: 목록 갱신 트리거(표시 시 번역/집계)
  else 실패
    HS-->>U: 오류 메시지 표시
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

귀 쫑긋 토끼가 콩콩 떠다니며
왼·오른 어깨까지 꼼꼼히 세며 🐇
통증 지도 조각조각 모아
한 번에 퐁! 서버에 전해주네
앞면 뒷면 살포시 맞추며
오늘의 기록, 바르게 놓았도다 🌙

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 19a856f and 2ced409.

📒 Files selected for processing (5)
  • frontend/ongi/android/app/src/main/AndroidManifest.xml (1 hunks)
  • frontend/ongi/lib/screens/health/health_home_screen.dart (2 hunks)
  • frontend/ongi/lib/screens/health/health_status_input_screen.dart (11 hunks)
  • frontend/ongi/lib/services/health_service.dart (1 hunks)
  • frontend/ongi/lib/services/pain_service.dart (2 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fe/fix/pain-record

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@taekoong taekoong closed this Aug 28, 2025
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 2ced409 in 2 minutes and 11 seconds. Click for details.
  • Reviewed 624 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/ongi/android/app/src/main/AndroidManifest.xml:54
  • Draft comment:
    Minor: File missing newline at end. Consider adding one for POSIX compliance.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. frontend/ongi/lib/screens/health/health_home_screen.dart:318
  • Draft comment:
    The _convertPainAreaToKorean now uses the key directly without normalization. Ensure that input strings are always in uppercase, or consider applying .toUpperCase() to avoid potential mismatches.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment identifies a potential issue - if input strings aren't uppercase, they won't match the map keys. However, looking at the code, there's no evidence that this is actually a problem. We don't see the source of the painArea strings, so we can't verify if normalization is needed. The code may be receiving standardized uppercase values from elsewhere. I don't have visibility into where the painArea strings come from. They could already be standardized upstream. Without seeing the source of the painArea values, this comment is speculative. It's suggesting a fix for a problem we can't verify exists. The comment should be deleted as it makes assumptions about input validation without evidence that there's actually a problem.
3. frontend/ongi/lib/screens/health/health_status_input_screen.dart:221
  • Draft comment:
    In _updateBodyPartsFromRecords, painArea values are converted to lowercase, while the _convertPainAreaToKorean function expects uppercase keys. Consider unifying the casing consistently.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. frontend/ongi/lib/screens/health/health_status_input_screen.dart:507
  • Draft comment:
    Mapping in _getSelectedPainAreas appears inverted: e.g., if 'leftShoulder' is true, it adds PainArea.rightShoulder. Verify if this mirroring is intended.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The mirroring appears to be an intentional design choice, not a bug. The pattern is consistent throughout the code - all body parts are mirrored this way. This is likely because the body part selector needs to show the body as if looking in a mirror. The comment is asking for verification of intended behavior rather than pointing out a clear issue. The mirroring could be confusing and worth documenting, but the comment is phrased as a question rather than making a clear recommendation. The consistent pattern across all body parts and the careful implementation strongly suggests this is intentional design, not a mistake that needs verification. Delete the comment. It asks for verification of intended behavior rather than identifying a clear issue, and the mirroring pattern is consistently implemented throughout the code.
5. frontend/ongi/lib/services/pain_service.dart:27
  • Draft comment:
    API error handling prints detailed responses, which is useful for debugging but consider secure logging practices for production deployments.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_xm23kOpBz1wfqm8k

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

}

if (_todayPainRecords.isNotEmpty) {
// 디버깅: 실제 painArea 값들 출력
Copy link

Choose a reason for hiding this comment

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

Debug print statements remain in production code. Remove or disable these logging statements before release.

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.

1 participant