Skip to content

Migrate Setting Blocked Users View from XML to Compose #642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

DongJun-H
Copy link
Member

@DongJun-H DongJun-H commented Apr 30, 2025

작업사항

  • 차단 유저들을 보여주는 화면 Compose로 마이그레이션 및 레이아웃 변경사항 개발
  • 차단 유저들에 대한 로드 실패시에 대한 화면 추가 (임의로 그냥 추가..) 및 재시도 화면 추가
  • 다른사람 프로필에서 해당 유저에 대한 차단 메뉴 추가
    • 차단 후 성공하는 경우, 프로필 진입 이전화면으로 이동하는데, 이때 이동하더라도 차단 스낵바가 지속적으로 보일 수 있도록 외부 snackbarHostState를 주입받도록 parameter 추가

참고

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the blocked users view from an XML-based implementation to a Compose-based UI and refactors related viewmodel logic to use StateFlow.

  • Replaces LiveData with StateFlow in ProfileViewModel and ProfileSettingViewModel
  • Introduces new Compose screens and components (e.g. BlockedUsersScreen, updated DropdownMenu)
  • Removes legacy XML fragments and adapters related to block list functionality

Reviewed Changes

Copilot reviewed 16 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ProfileViewModel.kt Refactored block/unblock status from LiveData to StateFlow using Status states
ProfileSettingViewModel.kt Updated block list handling to use StateFlow with Resource wrappers
DropdownMenu.kt Updated dropdown menu composables to include new blocking functionality
SettingsScreen.kt & SettingsNavigation.kt Added onBlockUsersClick navigation and corresponding UI logic
BlockedUsersScreen.kt Added a new Compose screen for displaying blocked users and handling unblock actions
ProfileScreen.kt & ProfileNavigation.kt Integrated block user functionality in profile screens with dialogs and snackbar feedback
MypageNavigation.kt, MainScreen.kt, MainNavigator.kt Updated navigation to include the blocked users route
SettingBlockFragment.kt, BlockListAdapter.kt, ProfileOptionFragment.kt Removed legacy XML-based block components
Files not reviewed (5)
  • presentation/src/main/res/drawable/ic_blocked_users_empty.xml: Language not supported
  • presentation/src/main/res/drawable/ic_menu_block.xml: Language not supported
  • presentation/src/main/res/layout/fragment_setting_block.xml: Language not supported
  • presentation/src/main/res/layout/item_block.xml: Language not supported
  • presentation/src/main/res/navigation/nav_graph.xml: Language not supported
Comments suppressed due to low confidence (1)

presentation/src/main/java/daily/dayo/presentation/screen/profile/ProfileScreen.kt:98

  • [nitpick] Consider renaming the lambda parameter 'reason' to 'memberId' for clarity, as it represents the user's memberId for blocking.
val onClickUserBlock: (String) -> Unit = { reason ->

DongJun-H and others added 3 commits April 30, 2025 21:34
…mprove clarity, consider setting showBlockDialog to false explicitly instead of toggling its value
…us.LOADING) instead of setting .value directly in requestUnblockMember

Co-authored-by: Copilot <[email protected]>
…it represents the user's memberId for blocking.
@DongJun-H DongJun-H requested a review from Copilot April 30, 2025 12:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the blocked users view from an XML‐based implementation to a Compose-based implementation and updates profile and settings flows accordingly. Key changes include:

  • Converting LiveData-based state management to StateFlow for block/unblock operations in viewmodels.
  • Migrating UI components (e.g. dropdown menus, settings screens, and profile screens) to Compose layouts.
  • Removing legacy XML fragments and adapter classes for blocked users.

Reviewed Changes

Copilot reviewed 16 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ProfileViewModel.kt Replaces LiveData with StateFlow for block/unblock status updates.
ProfileSettingViewModel.kt Updates block list handling from LiveData to StateFlow.
DropdownMenu.kt Refactors dropdown menu functions to use a multi-line parameter format and rounded corners.
SettingsScreen.kt, SettingsNavigation.kt Adds new navigation and parameter handling for blocked users.
BlockedUsersScreen.kt Introduces a new Compose screen for viewing blocked users.
ProfileScreen.kt, ProfileNavigation.kt Integrates block user actions with confirmation dialogs and snackbar feedback.
MypageNavigation.kt, MainScreen.kt, MainNavigator.kt Adds navigation support for the new blocked users screen.
SettingBlockFragment.kt, BlockListAdapter.kt, ProfileOptionFragment.kt Removes XML-based components no longer needed after the migration.
Files not reviewed (5)
  • presentation/src/main/res/drawable/ic_blocked_users_empty.xml: Language not supported
  • presentation/src/main/res/drawable/ic_menu_block.xml: Language not supported
  • presentation/src/main/res/layout/fragment_setting_block.xml: Language not supported
  • presentation/src/main/res/layout/item_block.xml: Language not supported
  • presentation/src/main/res/navigation/nav_graph.xml: Language not supported

# Conflicts:
#	presentation/src/main/java/daily/dayo/presentation/view/DropdownMenu.kt
Copy link
Member

@yuni-ju yuni-ju left a comment

Choose a reason for hiding this comment

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

차단 관리 페이지에 들어갔을 떄 정상적으로 응답이 왔음에도 불구하고 로딩에 실패 했다는 화면이 뜹니다! 재시도를 계속 눌러도 동일한 문제가 발생합니다.

응답 코드 200이고, body가 {"data":[],"count":0}인 경우에 문제가 발생했습니다!
차단 유저가 있는 경우에는 정상적으로 뜨는 것을 보니 차단 유저가 0명인 경우에 발생하는 문제인 것 같습니다.

@DongJun-H DongJun-H requested a review from yuni-ju May 10, 2025 09:24
@DongJun-H
Copy link
Member Author

DongJun-H commented May 10, 2025

차단 관리 페이지에 들어갔을 떄 정상적으로 응답이 왔음에도 불구하고 로딩에 실패 했다는 화면이 뜹니다! 재시도를 계속 눌러도 동일한 문제가 발생합니다.

응답 코드 200이고, body가 {"data":[],"count":0}인 경우에 문제가 발생했습니다! 차단 유저가 있는 경우에는 정상적으로 뜨는 것을 보니 차단 유저가 0명인 경우에 발생하는 문제인 것 같습니다.

@yuni-ju 네트워크 재시도 코드 추가간 덮어씌워졌던 부분에 대한 원복을 통해 수정하였습니다

@github-project-automation github-project-automation bot moved this from Todo to In Progress in DAYO 2.0 May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants