Skip to content

Conversation

@l2hyunwoo
Copy link
Member

What is this issue?

  • XML -> Compose 마이그레이션
  • 코드 리팩토링: StateHolder 적용

프리뷰

스크린샷 2025-08-02 오전 1 36 30

@l2hyunwoo l2hyunwoo self-assigned this Aug 1, 2025
@l2hyunwoo l2hyunwoo requested a review from a team as a code owner August 1, 2025 16:37
@height
Copy link

height bot commented Aug 1, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@angryPodo
Copy link
Member

와우...

@l2hyunwoo l2hyunwoo force-pushed the feature/attendance-migration branch 2 times, most recently from 5453d29 to a2a62ff Compare August 1, 2025 22:52
implementation(projects.domain.attendance)
implementation(projects.core.common)
implementation(projects.core.designsystem)
implementation("androidx.compose.runtime:runtime-livedata:1.5.4")
Copy link
Member Author

Choose a reason for hiding this comment

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

?

fun NavGraphBuilder.attendanceScreen(
onBackClick: () -> Unit
) {
composable(route = AttendanceRoute) {
Copy link
Member Author

Choose a reason for hiding this comment

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

type-safe

@angryPodo
Copy link
Member

이거 #990 작업이랑은 별개인건가요?? 완전 새로 작업한건가?

@l2hyunwoo
Copy link
Member Author

@angryPodo 얍얍....이거 완전히 새롭게 코드 판 짠거

Copy link
Contributor

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

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

리뷰가 너무 늦어져서 죄송합니다😭😭 이렇게 또 하나의 xml 뷰가 사라졌네요!! 정말 감사합니다😊😊

)
} else {
AttendanceCodeResponse.ERROR
DomainAttendanceCodeResponse(UNKNOWN_ERROR_CODE)
Copy link
Contributor

Choose a reason for hiding this comment

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

기존에 AttendanceodeReponse.ERROR를 사용하던 방식에서 지금과 같이 repositoryImpl 내부에서 UNKNOWN_ERROR_CODE 사용하는 방식으로 수정하신 이유가 궁금해요!
제 생각에는 서버 응답에 따라 subLectureId를 넣어주는 것은 repository의 역할이기 때문에 지금 구조가 더 명확하게 책임이 분리되어 있다고 생각했는데 이 의도로 수정하신게 맞을까요..??

Comment on lines +73 to +77
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Black)
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

이 Box는 없애도 될 것 같은데 한 번 확인 부탁드려요..!!

*/
@Stable
private class CodeInputState(
private val keyboardController: androidx.compose.ui.platform.SoftwareKeyboardController?
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 import 위로 올려주면 좋을 것 같아요!

Comment on lines +123 to +128
Card(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(16.dp)),
colors = CardDefaults.cardColors(containerColor = Gray800)
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Card 사용 없이 구현 가능해보이는데 사용하신 이유가 있으실까요?

}
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = androidx.compose.ui.graphics.Color.Black
Copy link
Contributor

Choose a reason for hiding this comment

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

여기도 import 위로 올려주시면 감사하겠습니다..!!

Comment on lines +65 to +69
return try {
attendanceRepository.fetchAttendanceRound(eventId).getOrNull()
} catch (error: Throwable) {
null // AttendanceRound 실패는 전체 프로세스에 영향 주지 않음
}
Copy link
Contributor

Choose a reason for hiding this comment

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

이미 getOrNull 하고 있는데 catch가 실행될 일이 있나요??

modifier: Modifier = Modifier
) {
Box(modifier = modifier) {
LazyColumn(
Copy link
Contributor

Choose a reason for hiding this comment

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

내부에 item밖에 없는데 LazyColumn 사용하신 이유가 궁금해요!

Comment on lines +63 to +65
init {
loadAttendanceData()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

    LaunchedEffect(Unit) {
        viewModel.loadAttendanceData()
    }

스크린쪽에서 이렇게 로드해주고 있는데 init에서도 로드하면 처음 진입했을 때 loadAttendanceData()가 두 번 호출되지 않나요??

*/
fun loadAttendanceData() {
viewModelScope.launch {
_uiState.value = AttendanceUiState.Initial
Copy link
Contributor

Choose a reason for hiding this comment

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

혹시 .update를 사용하지 않으신 이유가 있으신가요??

Comment on lines +94 to +99
return suspendRunCatching {
attendanceRepository.fetchAttendanceRound(eventId)
}.mapCatching { result ->
result.getOrThrow()
}.getOrNull()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

suspendRunCatching을 repository에서 적용해서 한 곳에서만 에러 처리를 하는 것이 더 좋다고 생각했는데 이 부분 뷰모델에서 적용하신 이유가 있으신가요??

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return suspendRunCatching {
attendanceRepository.fetchAttendanceRound(eventId)
}.mapCatching { result ->
result.getOrThrow()
}.getOrNull()
}
return suspendRunCatching {
attendanceRepository.fetchAttendanceRound(eventId).getOrThrow()
}.getOrNull()
}

이렇게 해도 좋을 것 같아요!

@l2hyunwoo
Copy link
Member Author

@Hyobeen-Park 감사합니당! 이거 리뷰 반영해서 수정할게요

@l2hyunwoo l2hyunwoo force-pushed the feature/attendance-migration branch 2 times, most recently from 2101021 to 80aa1da Compare September 21, 2025 10:35
- domain/attendance: 도메인 레이어 모듈 생성
- data/attendance: 데이터 레이어 모듈 생성
- feature/attendance: 프레젠테이션 레이어 모듈 생성
- 각 모듈 gradle 설정 및 의존성 구성
- Entity 클래스들을 domain 모듈로 이동
- Repository 인터페이스를 domain 모듈로 이동
- 패키지 구조 정리 (org.sopt.official.domain.attendance)
- AttendanceService, MockAttendanceService 이동
- AttendanceRepositoryImpl 이동
- Response/Request 모델 클래스들 이동
- DI 모듈을 AttendanceDataModule로 리팩토링
- AttendanceActivity를 Compose 기반으로 재작성
- AttendanceScreen 및 컴포넌트 구현
- XML 레이아웃 제거 및 Compose UI로 대체
- AttendanceViewModel 초기 이동
- AttendanceRepositoryImpl에서 DomainAttendanceCodeResponse 별칭 사용
- UNKNOWN_ERROR_CODE 상수 추가로 매직 넘버 제거
- AttendanceHistoryResponse의 와일드카드 import를 명시적 import로 변경
- try-catch를 suspendRunCatching으로 리팩토링
- AttendanceViewModelRefactored 제거 및 코드 정리
- AttendanceCodeDialog 컴포넌트 분리 및 가독성 개선
  - CodeInputState 클래스로 상태 관리 로직 분리
  - 각 UI 영역별로 함수 분리 (Header, Title, InputFields 등)
  - 역할과 책임이 명확한 구조로 개선
- deprecated 메소드 제거
@l2hyunwoo l2hyunwoo force-pushed the feature/attendance-migration branch from 80aa1da to ac3c0a0 Compare September 23, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants