fix: 파이 차트 내 온도 위치 수정, 오른쪽 캡슐 버튼 내 글자 크기 자동으로 변경#49
Conversation
Walkthrough이 변경 사항은 Changes
Sequence Diagram(s)(해당 변경은 UI 포매팅 및 경미한 레이아웃 조정에 한정되어 있어 시퀀스 다이어그램 생략) Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
frontend/ongi/lib/screens/home/home_donutCapsule.dart (3)
26-29:MediaQuery호출을 캐싱하여 성능 개선 가능
MediaQuery.of(context).size.width값을 한 빌드 사이클 안에서 여러 번 계산하고 있습니다(본 줄 포함 총 10여 회). 동일한 값을 반복적으로 조회하면 불필요한 트리거가 발생할 수 있으므로, 변수로 캐싱해두고 재사용하는 편이 좋습니다.예시 diff:
@@ @override Widget build(BuildContext context) { - return Expanded( + final screenWidth = MediaQuery.of(context).size.width; + final screenHeight = MediaQuery.of(context).size.height; + + return Expanded( @@ - width: MediaQuery.of(context).size.width * 0.95, - height: MediaQuery.of(context).size.width * 0.95, + width: screenWidth * 0.95, + height: screenWidth * 0.95, @@ - offset: Offset( - -MediaQuery.of(context).size.width * 0.35, + offset: Offset( + -screenWidth * 0.35,
150-163:FittedBox사용은 👍 하지만AutoSizeText고려
FittedBox로 텍스트 스케일링을 제어한 점은 유용합니다. 다만 긴 문구가 들어올 경우 줄바꿈 없이 축소만 진행돼 가독성이 떨어질 수 있습니다.auto_size_text패키지의AutoSizeText를 사용하면 최소/최대 폰트, 줄바꿈 등을 더 세밀하게 제어할 수 있습니다.
196-199: 람다식의 중첩 삼항 연산 가독성 개선 제안
onTap의 한 줄짜리 람다에서 삼항 연산을 바로 넣으면 읽기 어렵습니다. 별도 메서드(ex._toggleSelection(0))로 추출하거나 블록 람다로 가독성을 높여보세요.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
frontend/ongi/lib/screens/home/home_donutCapsule.dart(5 hunks)
🔇 Additional comments (2)
frontend/ongi/lib/screens/home/home_donutCapsule.dart (2)
47-49: 좌측 오프셋 수치 하드코딩 검토 필요
left값을screenWidth * 0.04로 고정하면 작은-화면(예: 320 px)에서 텍스트가 지나치게 밀려 시각적 왜곡이 생길 수 있습니다.LayoutBuilder나FittedBox를 활용해 동적으로 위치를 잡는 방법을 고려해 보세요.
113-115: 선택 상태에서 버튼 폭이 화면 90 % → 오버플로우 가능성세로형
Column+crossAxisAlignment.end구조에서 버튼 폭을0.9 * screenWidth로 확장하면, 패딩/마진이 없는 상황에서 우측이 화면을 초과해Overflow경고가 발생할 수 있습니다. 실제 기기에서 Edge-case(가로 360 px 이하) 테스트를 권장드립니다.
Summary by CodeRabbit
Padding과FittedBox로 감싸 레이아웃과 텍스트 스케일링을 개선했습니다.