Skip to content

feat: 마이페이지 화면 구현 완료#55

Merged
taekoong merged 18 commits intomainfrom
fe/home-graph
Jul 22, 2025
Merged

feat: 마이페이지 화면 구현 완료#55
taekoong merged 18 commits intomainfrom
fe/home-graph

Conversation

@taekoong
Copy link
Collaborator

@taekoong taekoong commented Jul 22, 2025

가족코드 복사 / 로그아웃 구현 완료

Summary by CodeRabbit

  • 신규 기능

    • 마이페이지에서 사용자 정보를 비동기로 불러와 표시하는 새로운 프로필 화면 및 정보 위젯이 추가되었습니다.
    • 가족 코드 복사 및 로그아웃 기능이 개선된 마이페이지 메뉴가 도입되었습니다.
  • 버그 수정

    • 하단 네비게이션바에서 일부 시각 효과(그라데이션, 그림자 등)와 아이콘 선택 시 스타일이 개선되었습니다.
  • 리팩터링

    • 기존 마이페이지 화면이 새로운 구조로 대체되어, 사용자 경험이 향상되었습니다.
  • 기타

    • 사용자 정보 관련 데이터 접근 방식이 개선되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Jul 22, 2025

Walkthrough

이번 변경에서는 마이페이지(Profile) 화면의 구조가 대폭 개편되었습니다. 기존의 mypage_screen.dart 파일이 삭제되고, 새로운 경로(screens/mypage/)에 마이페이지 관련 위젯들이 분리되어 추가되었습니다. 사용자 정보 조회를 위한 PrefsManager.getUserInfo() 메서드가 도입되었으며, 하단 네비게이션 및 홈 화면 일부 UI 코드가 정리되었습니다.

Changes

파일/경로 변경 요약
frontend/ongi/lib/screens/bottom_nav.dart 마이페이지 import 경로 수정, dart:ui import 추가, add 버튼 box shadow 제거, 선택 시 아이콘 컨테이너화 조건부 적용 등 UI 소폭 수정
frontend/ongi/lib/screens/home/home_screen.dart 불필요한 import 및 _buildBackButton() 삭제, 해당 버튼 UI 제거
frontend/ongi/lib/screens/mypage/mypage_myinfo.dart 사용자 정보 표시용 Myinfo 위젯 신규 추가, 비동기 정보 조회 및 UI 렌더링 구현
frontend/ongi/lib/screens/mypage/mypage_screen.dart ProfileScreen 위젯 신규 구현, 커스텀 배경과 메뉴 리스트, 로그아웃 처리 등 전체 마이페이지 UI 재구성
frontend/ongi/lib/screens/mypage_screen.dart 기존 마이페이지 화면(및 로그아웃 처리 등) 전체 삭제
frontend/ongi/lib/utils/prefs_manager.dart 사용자 정보 일괄 조회용 static 메서드 및 관련 키 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ProfileScreen
    participant Myinfo
    participant PrefsManager
    participant SharedPreferences
    participant StartScreen

    User->>ProfileScreen: 화면 진입
    ProfileScreen->>Myinfo: 사용자 정보 위젯 렌더링
    Myinfo->>PrefsManager: getUserInfo() 호출
    PrefsManager->>SharedPreferences: 여러 값 조회
    SharedPreferences-->>PrefsManager: 사용자 정보 반환
    PrefsManager-->>Myinfo: 정보 Map 반환
    Myinfo-->>ProfileScreen: 사용자 정보 표시

    User->>ProfileScreen: 로그아웃 메뉴 선택
    ProfileScreen->>PrefsManager: logout() 호출
    PrefsManager-->>ProfileScreen: 로그아웃 완료
    ProfileScreen->>User: 스낵바로 로그아웃 안내
    ProfileScreen->>StartScreen: 네비게이션 스택 초기화 후 이동
Loading

Estimated code review effort

3 (~40분)

Possibly related PRs

  • feat: bottom nav modify  #25: 하단 네비게이션 바의 아이콘, 라벨 변경 및 마이페이지 import 경로 수정 등 본 PR과 직접적으로 연관된 UI/경로 구조 개편 PR입니다.

Poem

🐰
마이페이지 새단장, 토끼도 깡충 뛰네!
사용자 정보 쏙쏙, 한눈에 다 보여주고,
로그아웃도 깔끔하게,
네비게이션도 반짝반짝,
오늘도 온기 가득,
코드를 타고 흐르는
행복한 변화의 바람!


🪧 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.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @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

Documentation and Community

  • 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 merged commit 6db6211 into main Jul 22, 2025
2 of 4 checks passed
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
frontend/ongi/lib/utils/prefs_manager.dart (1)

48-52: 로그아웃 시 새로 추가된 사용자 정보가 정리되지 않습니다.

새로 추가된 사용자 정보 키들(_userFamilyCodeKey, _userFamilyNameKey, _isParent, _userProfileImageKey)이 로그아웃 시 제거되지 않아 사용자 데이터가 남아있을 수 있습니다.

다음과 같이 수정하여 모든 사용자 데이터를 정리하세요:

 static Future<void> logout() async {
   final prefs = await _prefs;
   await prefs.remove(_accessTokenKey);
   await prefs.remove(_userNameKey);
+  await prefs.remove(_userFamilyCodeKey);
+  await prefs.remove(_userFamilyNameKey);
+  await prefs.remove(_isParent);
+  await prefs.remove(_userProfileImageKey);
 }
🧹 Nitpick comments (5)
frontend/ongi/lib/screens/bottom_nav.dart (1)

135-139: 불필요한 Container 래핑을 제거하세요.

선택된 아이템에만 빈 Container로 래핑하는 것은 불필요합니다. 이는 성능상 오버헤드만 추가할 뿐 시각적 효과는 없습니다.

다음과 같이 단순화하세요:

-            isSelected
-                ? Container(
-                    child: iconWidget,
-                  )
-                : iconWidget,
+            iconWidget,
frontend/ongi/lib/screens/mypage/mypage_myinfo.dart (2)

23-26: 디폴트 값들을 상수로 분리하는 것을 고려하세요.

하드코딩된 디폴트 값들('33HYF6', '가족이름', 'assets/images/users/elderly_woman.png')을 클래스 상수나 별도 설정 파일로 분리하면 유지보수가 더 쉬워집니다.

class Myinfo extends StatelessWidget {
  static const String _defaultFamilyCode = '33HYF6';
  static const String _defaultFamilyName = '가족이름';
  static const String _defaultProfileImage = 'assets/images/users/elderly_woman.png';
  static const String _defaultUserName = '사용자님';
  
  // 사용 시
  final familycode = userInfo['familycode'] ?? _defaultFamilyCode;
  final familyName = userInfo['familyName'] ?? _defaultFamilyName;
  // ...
}

150-172: 프로필 수정 버튼의 기능을 구현하세요.

프로필 수정 버튼의 onPressed가 비어있습니다. 사용자가 탭해도 아무 동작을 하지 않아 혼란을 줄 수 있습니다.

프로필 수정 화면 네비게이션 또는 임시 스낵바라도 추가하는 것이 좋겠습니다. 구현을 도와드릴까요?

onPressed: () {
  // 임시 구현
  ScaffoldMessenger.of(context).showSnackBar(
    const SnackBar(content: Text('프로필 수정 기능은 준비 중입니다.')),
  );
  // 또는 실제 프로필 수정 화면으로 네비게이션
},
frontend/ongi/lib/screens/mypage/mypage_screen.dart (2)

11-18: 대부분의 메뉴 아이템이 기능이 구현되지 않았습니다.

'개인정보 보호', '시스템 알림', '공지사항', '정보', '문의하기' 메뉴들이 실제 기능 없이 표시만 되고 있습니다. 사용자가 탭해도 아무 반응이 없어 혼란을 줄 수 있습니다.

미구현 메뉴 아이템들에 대한 임시 처리나 실제 화면 구현을 도와드릴까요? 최소한 "준비 중" 메시지라도 보여주는 것이 좋겠습니다.

GestureDetector(
  onTap: () {
    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(content: Text('$item 기능은 준비 중입니다.')),
    );
  },
  child: Text(item, style: const TextStyle(fontSize: 24)),
)

23-23: 매직넘버를 상수로 정의하는 것을 고려하세요.

오른쪽 마진 값 screenWidth * 0.3이 하드코딩되어 있습니다. 디자인 상수로 분리하면 유지보수가 더 쉬워집니다.

class ProfileScreen extends StatelessWidget {
  static const double _menuRightMarginRatio = 0.3;
  
  // 사용 시
  margin: EdgeInsets.only(left: 0, right: screenWidth * _menuRightMarginRatio),
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea0e29c and d85e155.

📒 Files selected for processing (6)
  • frontend/ongi/lib/screens/bottom_nav.dart (3 hunks)
  • frontend/ongi/lib/screens/home/home_screen.dart (0 hunks)
  • frontend/ongi/lib/screens/mypage/mypage_myinfo.dart (1 hunks)
  • frontend/ongi/lib/screens/mypage/mypage_screen.dart (1 hunks)
  • frontend/ongi/lib/screens/mypage_screen.dart (0 hunks)
  • frontend/ongi/lib/utils/prefs_manager.dart (2 hunks)
💤 Files with no reviewable changes (2)
  • frontend/ongi/lib/screens/home/home_screen.dart
  • frontend/ongi/lib/screens/mypage_screen.dart
🔇 Additional comments (8)
frontend/ongi/lib/utils/prefs_manager.dart (2)

6-9: 새로운 사용자 정보 키들이 잘 정의되었습니다.

마이페이지 구현에 필요한 가족 코드, 가족 이름, 부모 여부, 프로필 이미지 키들이 적절히 추가되었습니다.


54-63: getUserInfo 메서드가 잘 구현되었습니다.

여러 사용자 정보를 한 번에 가져오는 편리한 메서드입니다. 불리언 값을 문자열로 변환하는 로직도 적절합니다.

frontend/ongi/lib/screens/bottom_nav.dart (2)

7-7: 마이페이지 import 경로가 올바르게 업데이트되었습니다.

새로운 마이페이지 구조에 맞게 import 경로가 적절히 변경되었습니다.


88-88: 그라디언트 색상 배열 정리가 좋습니다.

불필요한 공백이 제거되어 코드가 더 깔끔해졌습니다.

frontend/ongi/lib/screens/mypage/mypage_myinfo.dart (2)

13-28: FutureBuilder와 에러 처리가 잘 구현되었습니다.

비동기 데이터 로딩과 에러 상황에 대한 처리가 적절히 구현되어 있습니다. 사용자 경험을 위한 로딩 인디케이터도 좋습니다.


115-146: 가족코드 복사 기능이 잘 구현되었습니다.

클립보드 복사와 스낵바 피드백이 적절히 구현되어 있습니다. Builder 위젯을 사용해 올바른 컨텍스트를 전달한 것도 좋습니다.

frontend/ongi/lib/screens/mypage/mypage_screen.dart (2)

29-41: 로그아웃 기능이 잘 구현되었습니다.

로그아웃 처리 흐름이 적절합니다. PrefsManager.logout() 호출, 사용자 피드백, 딜레이 후 네비게이션 스택 정리까지 모든 단계가 잘 구현되어 있습니다.


64-86: 창의적인 배경 디자인이 잘 구현되었습니다.

OverflowBox와 커스텀 보더 반경을 사용한 배경 디자인이 독창적이고 시각적으로 매력적입니다. 반응형 크기 계산도 적절합니다.

import 'package:ongi/screens/mypage_screen.dart';
import 'package:ongi/screens/mypage/mypage_screen.dart';
import 'package:ongi/core/app_colors.dart';
import 'dart:ui';
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

사용되지 않는 import를 확인하세요.

dart:ui 패키지가 추가되었지만 코드에서 사용되는 곳을 찾을 수 없습니다. 필요없다면 제거하는 것이 좋겠습니다.


🏁 Script executed:

#!/bin/bash
# Description: dart:ui 패키지의 사용여부 확인

# Test: bottom_nav.dart에서 dart:ui 패키지 사용 확인
rg "ui\." frontend/ongi/lib/screens/bottom_nav.dart || echo "dart:ui 패키지 사용 안 됨"

Length of output: 100


dart:ui 불필요한 import 제거 요청

frontend/ongi/lib/screens/bottom_nav.dart 파일에서 dart:ui를 참조하는 구문이 발견되지 않아, 해당 import는 제거하는 것이 적절합니다.

  • 파일: frontend/ongi/lib/screens/bottom_nav.dart
    삭제할 라인: 9

제안하는 변경:

- import 'dart:ui';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import 'dart:ui';
- import 'dart:ui';
🤖 Prompt for AI Agents
In frontend/ongi/lib/screens/bottom_nav.dart at line 9, the import statement for
'dart:ui' is unnecessary as there are no references to it in the file. Remove
the line importing 'dart:ui' to clean up unused imports.

Comment on lines +39 to +46
ClipOval(
child: Image.asset(
profileImage,
width: screenWidth * 0.3, // 112/375
height: screenWidth * 0.4, // 160/375
fit: BoxFit.contain,
),
),
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

프로필 이미지의 가로세로 비율이 일치하지 않습니다.

ClipOval을 사용하면서 width와 height가 다른 비율(0.3 vs 0.4)로 설정되어 있어 이미지가 왜곡될 수 있습니다.

정사각형으로 수정하세요:

 ClipOval(
   child: Image.asset(
     profileImage,
-    width: screenWidth * 0.3, // 112/375
-    height: screenWidth * 0.4, // 160/375
+    width: screenWidth * 0.3, // 112/375
+    height: screenWidth * 0.3, // 112/375 (정사각형)
     fit: BoxFit.contain,
   ),
 ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ClipOval(
child: Image.asset(
profileImage,
width: screenWidth * 0.3, // 112/375
height: screenWidth * 0.4, // 160/375
fit: BoxFit.contain,
),
),
ClipOval(
child: Image.asset(
profileImage,
width: screenWidth * 0.3, // 112/375
height: screenWidth * 0.3, // 112/375 (정사각형)
fit: BoxFit.contain,
),
),
🤖 Prompt for AI Agents
In frontend/ongi/lib/screens/mypage/mypage_myinfo.dart around lines 39 to 46,
the profile image inside ClipOval has mismatched width and height ratios (0.3 vs
0.4), causing distortion. Fix this by setting both width and height to the same
value to maintain a square aspect ratio, ensuring the image is not distorted
within the ClipOval.

@taekoong taekoong deleted the fe/home-graph branch July 22, 2025 12:57
Neibce pushed a commit to 2025-PNU-SW-Hackathon/PNUSW-2025-OnGi-10 that referenced this pull request Aug 25, 2025
* feat: 온도그래프 화면으로 전환

* feat: 온도그래프 화면으로 전환

* feat: 온도그래프 화면으로 전환

* feat: 온도그래프 화면으로 전환

* feat: 온도그래프 화면으로 전환

* feat: 온도그래프 화면 구현

* feat: 온도그래프 화면 구현

* feat: 온도그래프 화면 구현

* feat: 마이페이지 화면 구현 processing...

* feat: 마이페이지 화면 구현 processing...

* feat: 마이페이지 화면 구현 processing...

* feat: 마이페이지 화면 구현 processing...

* feat: 마이페이지 화면 구현 processing...

* feat: 마이페이지 화면 구현

* feat: 마이페이지 화면 구현

* feat: 마이페이지 화면 구현

* feat: 마이페이지 화면 구현
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