Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="6dp"
android:height="10dp"
android:viewportWidth="6"
android:viewportHeight="10">
<path
android:pathData="M0.994,0.994L4.969,4.969L0.994,8.945"
android:strokeLineJoin="round"
android:strokeWidth="0.993827"
android:fillColor="#00000000"
android:strokeColor="#313131"
android:strokeLineCap="round"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="16dp"
android:viewportWidth="14"
android:viewportHeight="16">
<path
android:pathData="M12.469,4.224C11.981,3.221 10.573,2.4 8.936,2.878C8.154,3.104 7.471,3.589 7,4.253C6.529,3.589 5.846,3.104 5.064,2.878C3.423,2.408 2.019,3.221 1.53,4.224C0.845,5.627 1.129,7.206 2.376,8.916C3.354,10.255 4.75,11.611 6.777,13.186C6.842,13.236 6.92,13.263 7.002,13.263C7.083,13.263 7.162,13.236 7.226,13.186C9.25,11.615 10.65,10.269 11.627,8.916C12.87,7.206 13.155,5.627 12.469,4.224Z"
android:fillColor="#8A8A8A"/>
</vector>
18 changes: 18 additions & 0 deletions composeApp/src/commonMain/composeResources/drawable/ic_warning.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="16dp"
android:viewportWidth="14"
android:viewportHeight="16">
<path
android:pathData="M7,13H7"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#8A8A8A"
android:strokeLineCap="round"/>
<path
android:pathData="M7,3V10"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#8A8A8A"
android:strokeLineCap="round"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.konkuk.medicarecall.domain.model.type

enum class HomeStatusType(val title: String) {
GOOD("양호"),
ATTENTION("관심"),
WARNING("주의"),
UNRECORDED("미기록")
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun NameBar(
Row(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 14.dp)
.padding(horizontal = 16.dp, vertical = 16.dp)
.background(Color.White),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
Expand All @@ -52,7 +52,7 @@ fun NameBar(
style = MediCareCallTheme.typography.SB_24,
color = MediCareCallTheme.colors.black,
)
Spacer(modifier = Modifier.width(4.dp))
Spacer(modifier = Modifier.width(12.dp))
Icon(
modifier = Modifier.size(18.dp),
painter = painterResource(Res.drawable.ic_arrow_down_big),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package com.konkuk.medicarecall.ui.feature.home.component

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.konkuk.medicarecall.domain.util.now
import com.konkuk.medicarecall.resources.Res
import com.konkuk.medicarecall.resources.ic_arrow_big_back
import com.konkuk.medicarecall.resources.ic_arrow_big_forward
import com.konkuk.medicarecall.ui.theme.MediCareCallTheme
import com.konkuk.medicarecall.ui.theme.White
import com.konkuk.medicarecall.ui.theme.gray6
import kotlinx.datetime.LocalDate
import kotlinx.datetime.number
import org.jetbrains.compose.resources.vectorResource

@Composable
fun DateBar(
day: LocalDate,
onBack: () -> Unit = {},
onNext: () -> Unit = {},
modifier: Modifier = Modifier,
) {
val todayString by remember { if (day == LocalDate.now()) mutableStateOf("(오늘)") else mutableStateOf("") }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

todayStringday 변경 시 업데이트되지 않는 버그

remember { mutableStateOf(...) }는 초기 컴포지션 시 한 번만 계산됩니다. day 파라미터가 변경되어도 todayString 값이 재계산되지 않아 날짜 네비게이션 시 "(오늘)" 표시가 정상 동작하지 않습니다.

🐛 수정 제안
-    val todayString by remember { if (day == LocalDate.now()) mutableStateOf("(오늘)") else mutableStateOf("") }
+    val todayString = remember(day) { if (day == LocalDate.now()) "(오늘)" else "" }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val todayString by remember { if (day == LocalDate.now()) mutableStateOf("(오늘)") else mutableStateOf("") }
val todayString = remember(day) { if (day == LocalDate.now()) "(오늘)" else "" }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/DateBar.kt`
at line 37, todayString in DateBar is remembered without depending on the day
parameter so it never updates when day changes; replace the current remember {
mutableStateOf(...) } usage with a state/computation that depends on day (e.g.,
use remember(day) or derivedStateOf keyed by day, or compute it directly without
mutableStateOf) so todayString recomputes whenever the day parameter changes.


Box(
Modifier
.background(White)
.border(0.5.dp, MediCareCallTheme.colors.gray1),
) {
Row(
Modifier
.fillMaxWidth()
.padding(
horizontal = 16.dp, vertical = 16.dp,
),
horizontalArrangement = Arrangement.SpaceBetween,
) {
Icon(
imageVector = vectorResource(Res.drawable.ic_arrow_big_back),
contentDescription = "하루 전으로",
tint = MediCareCallTheme.colors.gray6,
modifier = Modifier.clickable(onClick = onBack),
)
Text(
"${day.month.number}월 ${day.day}일 $todayString",
color = gray6,
style = MediCareCallTheme.typography.M_16,
)
Icon(
imageVector = vectorResource(Res.drawable.ic_arrow_big_forward),
contentDescription = "하루 뒤로",
tint = if (day == LocalDate.now()) MediCareCallTheme.colors.gray2 else MediCareCallTheme.colors.gray6,
modifier = Modifier.clickable(enabled = day != LocalDate.now(), onClick = onNext),
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.konkuk.medicarecall.ui.feature.home.component

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.konkuk.medicarecall.domain.model.type.HomeStatusType
import com.konkuk.medicarecall.resources.Res
import com.konkuk.medicarecall.resources.ic_heart_small
import com.konkuk.medicarecall.ui.theme.Black
import com.konkuk.medicarecall.ui.theme.MediCareCallTheme
import com.konkuk.medicarecall.ui.theme.White
import com.konkuk.medicarecall.ui.theme.gray1
import com.konkuk.medicarecall.ui.theme.gray4
import org.jetbrains.compose.resources.vectorResource

@Composable
fun HomeRemarksCard(
remarkStatus: HomeStatusType,
remarkTitle: String,
remarkDescription: String,
modifier: Modifier = Modifier,
) {
Box(
modifier.background(White, RoundedCornerShape(16.dp))
.border(1.dp, gray1, RoundedCornerShape(16.dp)),
) {
Column(Modifier.padding(16.dp)) {
Row(
horizontalArrangement = Arrangement.spacedBy(6.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Icon(imageVector = vectorResource(Res.drawable.ic_heart_small), contentDescription = "특이사항", tint = gray4)
Text("특이사항", color = gray4, style = MediCareCallTheme.typography.R_14)
}
Spacer(Modifier.height(15.dp))
HomeStatusChip(remarkStatus)
Spacer(Modifier.height(8.dp))
Text(remarkTitle, color = Black, style = MediCareCallTheme.typography.B_20)
Spacer(Modifier.height(6.dp))
Text(remarkDescription, color = gray4, style = MediCareCallTheme.typography.M_16.copy(fontSize = 12.sp))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.konkuk.medicarecall.ui.feature.home.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.konkuk.medicarecall.domain.model.type.HomeStatusType
import com.konkuk.medicarecall.ui.theme.G50
import com.konkuk.medicarecall.ui.theme.MediCareCallTheme
import com.konkuk.medicarecall.ui.theme.Negative
import com.konkuk.medicarecall.ui.theme.Warning2
import com.konkuk.medicarecall.ui.theme.gray3
import com.konkuk.medicarecall.ui.theme.main

@Composable
fun HomeStatusChip(
statusType: HomeStatusType,
modifier: Modifier = Modifier,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# HomeStatusChip에서 modifier가 실제 적용되는지 정적 확인
rg -nP --type=kt 'fun HomeStatusChip\(|Box\(Modifier\.background|Box\(modifier\.background' composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt
# 기대 결과:
# - 기존 코드: Box(Modifier.background...) 매치
# - 수정 후: Box(modifier.background...) 매치

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 101


🏁 Script executed:

# 파일 크기 확인
wc -l composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 178


🏁 Script executed:

# 파일 전체 내용 읽기
cat -n composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 2206


🏁 Script executed:

# modifier 관련 라인 검색 (Kotlin 파일이므로 kotlin 타입이 아니라 키워드로 검색)
rg -n 'modifier|Box\(' composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt

Repository: Medicare-Call/Medicare-Call-KMP

Length of output: 352


modifier 파라미터가 Box에 적용되지 않고 있습니다.

Line 23에서 modifier 파라미터를 받지만, Line 50에서 Box(Modifier.background(...))를 사용하고 있어서 호출부에서 전달한 modifier가 무시돼요. 이러면 크기, 패딩, 클릭 이벤트 등을 커스터마이징할 수 없어요.

🔧 제안 diff
-    Box(Modifier.background(containerColor, RoundedCornerShape(20.dp))) {
+    Box(modifier.background(containerColor, RoundedCornerShape(20.dp))) {
         Text(statusType.title, color = textColor, style = MediCareCallTheme.typography.SB_12, modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp))
     }

Also applies to: 50-51

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt`
at line 23, HomeStatusChip receives a modifier parameter but it isn't applied to
the Box (the Box uses a fresh Modifier with background), so callers'
size/padding/clicks are ignored; update the Box in HomeStatusChip to use the
incoming modifier (e.g., pass modifier then apply background/other modifiers via
modifier.background(...).padding/... or modifier.then(...).background(...))
instead of creating a new Modifier, ensuring the passed modifier composes with
the chip’s background and layout modifiers.

) {
val containerColor: Color
val textColor: Color

when (statusType) {
HomeStatusType.GOOD -> {
containerColor = G50
textColor = main
}

HomeStatusType.ATTENTION -> {
containerColor = Color(0xffFFA13d).copy(alpha = 0.1f)
textColor = Warning2
}

HomeStatusType.WARNING -> {
containerColor = Negative.copy(alpha = 0.1f)
textColor = Negative
}

HomeStatusType.UNRECORDED -> {
containerColor = Color(0xffF0F0F0)
textColor = gray3
}
}

Box(Modifier.background(containerColor, RoundedCornerShape(20.dp))) {
Text(statusType.title, color = textColor, style = MediCareCallTheme.typography.SB_12, modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp))
}
}
Loading
Loading