-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/6 2 repeat day routine UI #20
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
base: master
Are you sure you want to change the base?
Conversation
- `AddRoutineViewModel`: - `selectedDays` (선택된 요일 목록) StateFlow 추가 - `excludeHolidays` (공휴일 제외 여부) StateFlow 추가 - 요일 선택 및 공휴일 제외 옵션 변경 함수 추가 - 루틴 저장 시 요일 반복 유형 및 공휴일 제외 설정 로직 추가 - `AddRoutineScreen.kt`: - `SpecificDaysContent` Composable 함수 추가: - 요일 선택 FilterChip 및 공휴일 제외 Switch 구현 - 공휴일 제외 시 안내 문구 표시 - 탭에 따라 "요일 반복" 또는 "특정 날짜" 콘텐츠 표시 로직 수정
- 요일 반복 탭에서 선택된 요일이 없을 경우 에러 콜백 호출 검증 테스트 추가 - 요일 반복 탭에서 유효한 요일 선택 시 루틴 저장 및 성공 콜백 호출 검증 테스트 추가
There was a problem hiding this 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 implements a UI feature for routines that repeat on specific weekdays with an option to exclude holidays.
- Updates the AddRoutineScreen composable to include a SpecificDaysContent section for day selection and a holiday exclusion toggle.
- Enhances the AddRoutineViewModel with state management and validation logic for selected days and holiday exclusion.
- Adds or updates unit tests in AddRoutineViewModelTest for error handling and successful routine saving.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
app/src/test/java/com/example/myroutine/AddRoutineViewModelTest.kt | Added unit tests verifying error callbacks when no day is selected and proper routine saving when valid days are chosen. |
app/src/main/java/com/example/myroutine/features/add/AddRoutineViewModel.kt | Added state flows and functions for managing the selected days and holiday exclusion; updated the saveRoutine logic for weekly routines. |
app/src/main/java/com/example/myroutine/features/add/AddRoutineScreen.kt | Introduced the SpecificDaysContent composable to render weekday filter chips and holiday exclusion options. |
@@ -106,6 +122,20 @@ class AddRoutineViewModel @Inject constructor( | |||
startDate = null | |||
} | |||
|
|||
1 -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider defining a constant for the tab index (currently the literal value '1') to improve code clarity and maintainability.
1 -> { | |
TAB_INDEX_WEEKLY -> { |
Copilot uses AI. Check for mistakes.
@@ -106,6 +122,20 @@ class AddRoutineViewModel @Inject constructor( | |||
startDate = null | |||
} | |||
|
|||
1 -> { | |||
repeatDays = _selectedDays.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider sorting the selected days list before assigning it to repeatDays to ensure consistent ordering and prevent potential issues when users select days in varying orders.
Copilot uses AI. Check for mistakes.
|
[#6-2] 요일 반복 루틴 UI 구현 #17
이 PR은 특정 요일에 반복되는 루틴 기능과 공휴일 제외 옵션을 지원하기 위한 기능을 추가합니다.
UI, ViewModel, 단위 테스트가 함께 업데이트되어 해당 기능을 완성합니다.
기능 추가: 특정 요일 선택 및 공휴일 제외 옵션
AddRoutineScreen
에SpecificDaysContent
컴포저블을 추가하여 요일 선택과 공휴일 제외 토글 기능을 구현FilterChip
를 활용한 요일 선택 UISwitch
를 통한 공휴일 제외 옵션 UIAddRoutineScreen
에 상태 변수selectedDays
,excludeHolidays
를 추가하고, 이를 UI에 반영ViewModel 개선
AddRoutineViewModel
에selectedDays
,excludeHolidays
상태 및 상태 변경 함수(onSelectedDaysChange
,onExcludeHolidayToggle
) 추가saveRoutine
함수에서 요일 선택 검증과 공휴일 제외 옵션 반영 로직 추가RepeatType
과HolidayType
을 적절히 설정단위 테스트 추가
close #6-2