Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
17030b4
✨ Feat: 월별 통계 이동 가능 여부 확인 로직 추가
chanho0908 Feb 24, 2026
9d0f4d3
♻️ Refactor: 반복 주기(repeat type) 문자열 리소스 공용화
chanho0908 Feb 24, 2026
7a83673
✨ Feat: 통계 상세 요약 정보 컴포넌트 추가
chanho0908 Feb 24, 2026
228d59c
✨ Feat: 통계 상세 화면 구현
chanho0908 Feb 24, 2026
e5f24f5
✨ Feat: StatsRefreshBus 추가
chanho0908 Feb 24, 2026
f538cd5
♻️ Refactor: 통계 화면 목록 이벤트 버스 적용
chanho0908 Feb 24, 2026
5fb14c3
♻️ Refactor: 통계 상세 화면 데이터 호출 로직 안정성 강화
chanho0908 Feb 24, 2026
e0c2757
Merge branch 'feat/#88-stats-detail' into feat/#88-stats-detail-feature
chanho0908 Feb 24, 2026
2639951
✨ Feat: 통계 상세 화면 `StatsDetailSideEffect` 구독
chanho0908 Feb 24, 2026
a14cac7
♻️ Fix: 통계 상세 화면 골 삭제 API 함수 수정
chanho0908 Feb 24, 2026
6f4c735
♻️ Refactor: 월별 이동 로직 개선
chanho0908 Feb 24, 2026
fcf1e2f
Merge branch 'feat/#88-stats-detail' into feat/#88-stats-detail-feature
chanho0908 Feb 24, 2026
4e87e25
Merge branch 'feat/#88-stats-detail' into feat/#88-stats-detail-feature
chanho0908 Feb 25, 2026
6a04557
Merge branch 'feat/#88-stats-detail' into feat/#88-stats-detail-feature
chanho0908 Feb 25, 2026
769dde4
♻️ Refactor: `uiSate` 변수명을 `uiState`로 변경
chanho0908 Feb 25, 2026
9f42116
♻️ Refactor: StatsDetailViewModel 파라미터명 오타 수정
chanho0908 Feb 25, 2026
e87c2a6
♻️ Refactor: 스크롤 범위 수정으로 Topbar 고정
chanho0908 Feb 25, 2026
7371166
♻️ Refactor: `init` 블록 로직 `collectMonthChangeFlow` 메서드로 분리
chanho0908 Feb 25, 2026
c200a14
♻️ Refactor: 통계 상세 화면 디바운스 시간 단축
chanho0908 Feb 25, 2026
db67239
♻️ Refactor: 통계 상세 화면 캐시 키를 `LocalDate`에서 `YearMonth`로 변경
chanho0908 Feb 25, 2026
3b9d4c4
♻️ Refactor: 통계 상세 요약 UI 리팩토링
chanho0908 Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions core/design-system/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<string name="word_edit">편집</string>
<string name="word_start_date">시작일</string>
<string name="word_end_date">종료일</string>
<string name="word_repeat_type">반복 주기</string>
<string name="word_end_count">달성 횟수</string>
<string name="word_not_set">미설정</string>
<string name="word_cancel">취소</string>
<string name="word_delete">삭제</string>
Expand Down Expand Up @@ -57,7 +59,6 @@
<string name="goal_editor_title">목표 직접 만들기</string>
<string name="goal_editor_title_edit">목표 수정하기</string>
<string name="goal_editor_text_field_placeholder">목표를 입력해 보세요.</string>
<string name="header_repeat_type">반복 주기</string>
<string name="header_start_date">시작 날짜</string>
<string name="header_end_date">종료 날짜</string>
<string name="header_end_date_option">종료 날짜 설정</string>
Expand All @@ -81,8 +82,11 @@
<string name="stats_stamp_not_has_complete_goal">아직 끝낸 목표가 없어요!</string>
<string name="stats_stamp_total_end_count">총 목표 %d번</string>
<string name="stats_stamp_end_count">%d번 완료</string>
<string name="stats_stamp_in_progress_tap_title">진행중</string>
<string name="stats_stamp_end_tap_title">종료</string>
<string name="stats_stamp_in_progress_tab_title">진행중</string>
<string name="stats_stamp_end_tab_title">종료</string>

<!-- 통계 상세 화면 -->
<string name="stats_complete_count">%1$s %2$d/%3$d</string>

<!-- 토스트 메시지 -->
<string name="toast_end_date_before_start_date">종료 날짜가 시작 날짜보다 이전입니다.</string>
Expand Down
21 changes: 21 additions & 0 deletions core/util/src/main/java/com/twix/util/bus/StatsRefreshBus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.twix.util.bus

import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow

class StatsRefreshBus {
enum class Publisher {
InProgress,
End,
}

private val _events =
MutableSharedFlow<Publisher>(
replay = 0,
extraBufferCapacity = 1,
)

val events: SharedFlow<Publisher> = _events

fun notifyChanged(publisher: Publisher) = _events.tryEmit(publisher)
}
2 changes: 2 additions & 0 deletions core/util/src/main/java/com/twix/util/di/UtilModule.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.twix.util.di

import com.twix.util.bus.GoalRefreshBus
import com.twix.util.bus.StatsRefreshBus
import com.twix.util.bus.TaskCertificationRefreshBus
import org.koin.dsl.module

val utilModule =
module {
single { GoalRefreshBus() }
single { TaskCertificationRefreshBus() }
single { StatsRefreshBus() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private fun RepeatTypeSettings(
Modifier
.padding(16.dp),
) {
HeaderText(stringResource(R.string.header_repeat_type))
HeaderText(stringResource(R.string.word_repeat_type))

Spacer(Modifier.height(12.dp))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private fun GoalSummaryItem(
?: stringResource(R.string.word_not_set)

GoalSummaryInfo(
label = stringResource(R.string.header_repeat_type),
label = stringResource(R.string.word_repeat_type),
value = item.repeatCycle.label(),
)
GoalSummaryInfo(
Expand Down
16 changes: 16 additions & 0 deletions feature/main/src/main/java/com/twix/stats/StatsViewModel.kt
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
package com.twix.stats

import androidx.lifecycle.viewModelScope
import com.twix.designsystem.R
import com.twix.designsystem.components.toast.model.ToastType
import com.twix.domain.repository.StatsRepository
import com.twix.stats.contract.StatsIntent
import com.twix.stats.contract.StatsSideEffect
import com.twix.stats.contract.StatsUiState
import com.twix.ui.base.BaseViewModel
import com.twix.util.bus.StatsRefreshBus
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import java.time.LocalDate

class StatsViewModel(
private val statsRepository: StatsRepository,
private val eventBus: StatsRefreshBus,
) : BaseViewModel<StatsUiState, StatsIntent, StatsSideEffect>(StatsUiState()) {
private var inProgressStatsJob: Job? = null

init {
fetchInProgressStats(LocalDate.now())
fetchEndStats()
collectEventBus()
}

override suspend fun handleIntent(intent: StatsIntent) {
Expand Down Expand Up @@ -57,6 +62,17 @@ class StatsViewModel(
)
}

private fun collectEventBus() {
viewModelScope.launch {
eventBus.events.collect { publisher ->
when (publisher) {
StatsRefreshBus.Publisher.InProgress -> fetchInProgressStats(currentState.currentDate)
StatsRefreshBus.Publisher.End -> fetchEndStats()
}
}
}
}

private suspend fun showToast(
message: Int,
type: ToastType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ enum class StatsTabDestination(
@field:StringRes
val label: Int,
) {
IN_PROGRESS(R.string.stats_stamp_in_progress_tap_title),
END(R.string.stats_stamp_end_tap_title),
IN_PROGRESS(R.string.stats_stamp_in_progress_tab_title),
END(R.string.stats_stamp_end_tab_title),
}

This file was deleted.

Loading