-
Notifications
You must be signed in to change notification settings - Fork 0
[FIX/#143] 2์ฐจ qa #148
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
[FIX/#143] 2์ฐจ qa #148
Changes from all commits
3552b7c
951713b
4b16d0b
1c38c27
5f8a10e
d3bba74
e34e47e
2987191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,22 +40,26 @@ class HomeViewModel @Inject constructor( | |
| _uiState.update { UiState.Loading } | ||
|
|
||
| homeRepository.getMainDashboard().onSuccess { response -> | ||
| val level = response.cherryLevel | ||
| val safeIndex = level.coerceIn( | ||
| 1, | ||
| CherrishGaugeType.entries.lastIndex | ||
| ) | ||
| _uiState.update { | ||
| UiState.Success( | ||
| HomeUiState( | ||
| currentStep = response.cherryLevel, | ||
| currentStep = level, | ||
| gauges = CherrishGaugeType.entries.toImmutableList(), | ||
| challengeRate = response.challengeRate, | ||
| challengeName = response.challengeName, | ||
| todayDate = response.toTodayDateString(), | ||
| plans = response.recentProcedures.toImmutableList(), | ||
| upcomingPlans = response.upcomingProcedures.toImmutableList(), | ||
| selectedIndex = (response.cherryLevel - 1) | ||
| .coerceIn(0, CherrishGaugeType.entries.size - 1) | ||
| selectedIndex = safeIndex | ||
| ) | ||
|
Comment on lines
+43
to
59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LEVEL0 ํฌํจ ์ ์ํ ๋ถ์ผ์น ๊ฐ๋ฅ์ฑ ์์ต๋๋ค. ํ์ฌ ๐ง ์ ์ ์์ - val level = response.cherryLevel
- val safeIndex = level.coerceIn(
- 1,
- CherrishGaugeType.entries.lastIndex
- )
+ val level = response.cherryLevel
+ val safeLevel = level.coerceIn(
+ 0,
+ CherrishGaugeType.entries.lastIndex
+ )
...
- currentStep = level,
+ currentStep = safeLevel,
...
- selectedIndex = safeIndex
+ selectedIndex = safeLevel๐ค Prompt for AI Agents |
||
| ) | ||
| } | ||
| }.onLogFailure {} | ||
| }.onLogFailure { } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,15 +40,17 @@ fun ChallengeSection( | |
| gauges: ImmutableList<CherrishGaugeType>, | ||
| modifier: Modifier = Modifier, | ||
| currentStep: Int = 0, | ||
| @DrawableRes imageRes: Int? = R.drawable.img_challenge_lv2, | ||
| @DrawableRes imageRes: Int? = R.drawable.img_challenge_lv1, | ||
| onChallengeStartClick: () -> Unit = {}, | ||
| challengeName: String? = "์ฐ๋์ค โข ๋ง์์ฑ๊น", | ||
| challengeRate: Int = 0 | ||
| ) { | ||
| val hasChallenge = !challengeName.isNullOrBlank() | ||
|
|
||
| Box( | ||
| modifier = modifier.fillMaxWidth() | ||
| ) { | ||
| if (currentStep != 0 && imageRes != null) { | ||
| if (hasChallenge && imageRes != null) { | ||
| Image( | ||
| painter = painterResource(id = imageRes), | ||
| contentDescription = null, | ||
|
|
@@ -71,9 +73,9 @@ fun ChallengeSection( | |
|
|
||
| Spacer(modifier = Modifier.height(10.dp)) | ||
|
|
||
| if (currentStep == 0) { | ||
| if (!hasChallenge) { | ||
| NoChallenge( | ||
| currentStep = currentStep, | ||
| currentStep = 0, | ||
| gauges = gauges, | ||
| onChallengeStartClick = onChallengeStartClick | ||
| ) | ||
|
|
@@ -97,8 +99,6 @@ private fun Challenge( | |
| challengeRate: Int, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| val safeStep = currentStep.coerceIn(1, gauges.size) | ||
|
|
||
| Column( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
|
|
@@ -139,7 +139,7 @@ private fun Challenge( | |
| Spacer(modifier = Modifier.height(16.dp)) | ||
|
|
||
| CherrishGaugeBar( | ||
| currentStep = safeStep, | ||
| currentStep = currentStep, | ||
| gauges = gauges | ||
| ) | ||
|
Comment on lines
141
to
144
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐งฉ Analysis chain๐ Script executed: # Find CherrishGaugeBar implementation
fd -e kt | xargs grep -l "fun CherrishGaugeBar" | head -5Repository: TEAM-Cherrish/Cherrish-Android Length of output: 169 ๐ Script executed: # Find ChallengeSection.kt and examine the context around lines 141-144
fd "ChallengeSection.kt" -e ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 160 ๐ Script executed: # Search for safeStep references to understand what was removed
rg "safeStep" -B 2 -A 2Repository: TEAM-Cherrish/Cherrish-Android Length of output: 2405 ๐ Script executed: # Examine CherrishGaugeBar implementation
cat -n app/src/main/java/com/cherrish/android/core/designsystem/component/gaugebar/CherrishGaugeBar.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 6359 ๐ Script executed: # Examine Challenge composable around lines 141-144 in ChallengeSection.kt
sed -n '120,155p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 1163 ๐ Script executed: # Search for Challenge composable function signature and currentStep initialization
sed -n '1,100p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 4374 ๐ Script executed: # Check CherrishGaugeType to understand step values
fd "CherrishGaugeType" -e kt | head -3Repository: TEAM-Cherrish/Cherrish-Android Length of output: 156 ๐ Script executed: # Look at ChallengeSection Challenge composable more thoroughly
sed -n '94,155p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 2119 ๐ Script executed: # Search for how currentStep is derived in the call hierarchy
rg "Challenge\(" -B 3 -A 3 app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 1018 ๐ Script executed: # Examine CherrishGaugeType enum
cat -n app/src/main/java/com/cherrish/android/presentation/home/type/CherrishGaugeType.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 662 ๐ Script executed: # Check ChallengeSection function signature and default values for currentStep
sed -n '38,50p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 551 ๐ Script executed: # Search for usages of ChallengeSection to see how currentStep is passed
rg "ChallengeSection\(" -B 2 -A 5 --type kt | head -50Repository: TEAM-Cherrish/Cherrish-Android Length of output: 100 ๐ Script executed: # Check how currentStep values are generated/passed from ViewModels
rg "currentStep" --type-add 'kt:*.kt' -B 2 -A 2 app/src/main/java/com/cherrish/android/presentation/home | head -80Repository: TEAM-Cherrish/Cherrish-Android Length of output: 7865 ๐ Script executed: # Look for usages of ChallengeSection in the codebase
fd -e kt | xargs grep -l "ChallengeSection" | head -5Repository: TEAM-Cherrish/Cherrish-Android Length of output: 231 ๐ Script executed: # Examine HomeViewModel to see how currentStep (level) is set
sed -n '1,80p' app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 3564 ๐ Script executed: # Check the complete flow - HomeScreen usage of currentStep
sed -n '1,120p' app/src/main/java/com/cherrish/android/presentation/home/HomeScreen.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 5062 ๐ Script executed: # Check the git history or PR context - look for recent changes around safeStep
rg "safeStep" -B 5 -A 5 app/src/main/java/com/cherrish/android/core/designsystem/component/gaugebar/CherrishGaugeBar.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 56 ๐ Script executed: # Verify what values currentStep can actually receive at runtime
# Check HomeViewModel more carefully - does response.cherryLevel have validation?
cat -n app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt | grep -A 15 "loadHomeData"Repository: TEAM-Cherrish/Cherrish-Android Length of output: 921 ๐ Script executed: # Check if there's any validation at the data layer for cherryLevel
fd -e kt | xargs grep -l "cherryLevel\|cherryLevel" | head -5Repository: TEAM-Cherrish/Cherrish-Android Length of output: 536 ๐ Script executed: # Check the HomeResponseModel and HomeResponseDto for cherryLevel definition/validation
cat -n app/src/main/java/com/cherrish/android/data/model/HomeResponseModel.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 2592 ๐ Script executed: # Also check the DTO
cat -n app/src/main/java/com/cherrish/android/data/remote/dto/response/HomeResponseDto.ktRepository: TEAM-Cherrish/Cherrish-Android Length of output: 1466 ๐ Script executed: # Final verification: Check if there's any validation in Challenge composable for currentStep
sed -n '94,110p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -nRepository: TEAM-Cherrish/Cherrish-Android Length of output: 653
๐ค Prompt for AI Agents |
||
| } | ||
|
|
||
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.
๊ฒ์ด์ง ๋จ๊ณ์ ์ฒด๋ฆฌ ํ์ ๊ณ์ฐ์ด ์๋ก ๋ถ์ผ์นํ ์ ์์ต๋๋ค.
gaugeStep๋ ํด๋จํ๋์ง๋งstepForCherry๋ ์๋ณธcherryLevel์ ์ฌ์ฉํฉ๋๋ค. ๋ฒ์๋ฅผ ๋ฒ์ด๋ ๊ฐ์ด ์ค๋ฉด ๊ฒ์ด์ง๋ ์ต๋์ธ๋ฐ ์ฒด๋ฆฌ ํ์ ์ ๊ธฐ๋ณธ๊ฐ(MONGRONG)์ผ๋ก ๋จ์ด์ ธ UI๊ฐ ์๊ฐ๋ฆด ์ ์์ด์. ๋์ผํ ๊ธฐ์ค(ํด๋จํ๋ ๊ฐ)์ผ๋ก ์ ๋ ฌํ๋ ํธ์ด ์์ ํฉ๋๋ค.๐ ๏ธ ์ ์ ์์
๐ค Prompt for AI Agents