Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -455,33 +455,28 @@ fun WithdrawHoldBottomSheet(
.fillMaxWidth()
.wrapContentHeight()
) {
Column(
modifier = Modifier
.padding(bottom = 8.dp)
) {

Text(
text = stringResource(id = content.titleResId),
style = DayoTheme.typography.b1,
color = Dark,
)
Text(
text = stringResource(id = content.titleResId),
style = DayoTheme.typography.b1,
color = Dark,
)

val descriptionText = stringResource(id = content.descriptionResId)
if (descriptionText.isNotBlank()) {
Spacer(
modifier = Modifier.height(
if (isOtherReason) 2.dp else 4.dp
)
val descriptionText = stringResource(id = content.descriptionResId)
if (descriptionText.isNotBlank()) {
Spacer(
modifier = Modifier.height(
if (isOtherReason) 2.dp else 4.dp
)
Text(
text = descriptionText,
style = DayoTheme.typography.caption2.copy(
color = Gray2_767B83,
fontWeight = FontWeight.Medium
)
)
Text(
text = descriptionText,
style = DayoTheme.typography.caption2.copy(
color = Gray2_767B83,
fontWeight = FontWeight.Medium
)
}
)
}

Spacer(
modifier = Modifier.height(
if (isOtherReason || hasWithdrawReasonGuide) 8.dp
Expand Down Expand Up @@ -622,11 +617,11 @@ fun WithdrawConfirmScreen(
fontWeight = FontWeight.SemiBold
),
)
Spacer(modifier = Modifier.height(20.dp))
Spacer(modifier = Modifier.height(32.dp))
withdrawCheckLists.forEachIndexed { index, text ->
WithdrawConfirmCheckItems(checkText = text)
if (index != withdrawCheckLists.lastIndex) {
Spacer(modifier = Modifier.height(12.dp))
Spacer(modifier = Modifier.height(16.dp))
}
}
}
Expand Down Expand Up @@ -692,11 +687,13 @@ fun WithdrawConfirmCheckItems(
Row(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.wrapContentHeight(),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
painter = painterResource(id = R.drawable.ic_check),
contentDescription = null,
modifier = Modifier.size(20.dp),
tint = Primary_23C882,
)
Spacer(modifier = Modifier.width(4.dp))
Expand Down Expand Up @@ -832,9 +829,11 @@ private fun WithdrawGuideContentUI(
style = DayoTheme.typography.caption4,
)
if (index != guideStrings.lastIndex) {
Spacer(modifier = Modifier
.width(6.dp)
.align(Alignment.CenterVertically))
Spacer(
modifier = Modifier
.width(6.dp)
.align(Alignment.CenterVertically)
)
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_right),
contentDescription = null,
Expand All @@ -843,9 +842,11 @@ private fun WithdrawGuideContentUI(
.align(Alignment.CenterVertically),
tint = Gray3_9FA5AE,
)
Spacer(modifier = Modifier
.width(6.dp)
.align(Alignment.CenterVertically))
Spacer(
modifier = Modifier
.width(6.dp)
.align(Alignment.CenterVertically)
)
}
}
}
Expand Down Expand Up @@ -933,4 +934,4 @@ data class WithdrawRetentionSheetContent(
enum class WithdrawStep(val stepNum: Int) {
REASON_SELECT(0),
CONFIRM(1),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ import androidx.compose.ui.graphics.Color.Companion.White
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import daily.dayo.domain.model.Profile
Expand Down Expand Up @@ -273,14 +275,16 @@ private fun SettingProfile(
Text(
text = profile?.nickname ?: "",
color = Dark,
style = DayoTheme.typography.b2
textAlign = TextAlign.Center,
style = DayoTheme.typography.b1
)

// email
Text(
text = profile?.email ?: "",
color = Gray3_9FA5AE,
style = DayoTheme.typography.b6
textAlign = TextAlign.Center,
style = DayoTheme.typography.b6.copy(lineHeight = 21.sp)
)

Spacer(modifier = Modifier.height(16.dp))
Expand Down
14 changes: 12 additions & 2 deletions presentation/src/main/java/daily/dayo/presentation/view/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.TextAutoSize
import androidx.compose.material.IconButton
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
Expand All @@ -31,8 +32,10 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import daily.dayo.presentation.theme.Dark
import daily.dayo.presentation.theme.DayoTheme
import daily.dayo.presentation.theme.Gray2_767B83
Expand Down Expand Up @@ -116,7 +119,14 @@ fun FilledRoundedCornerButton(
text = label,
textAlign = TextAlign.Center,
style = textStyle,
modifier = contentModifier ?: Modifier.fillMaxWidth()
modifier = contentModifier ?: Modifier.fillMaxWidth(),
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Clip,
autoSize = TextAutoSize.StepBased(
minFontSize = 12.sp,
maxFontSize = textStyle.fontSize
)
Comment on lines +122 to +129
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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# FilledRoundedCornerButton 사용처와 해당 텍스트 스타일의 fontSize 명시 여부를 확인합니다.
rg -n -C 3 'FilledRoundedCornerButton\(' presentation/src/main/java
rg -n -C 3 'fontSize\s*=' presentation/src/main/java/daily/dayo/presentation/theme presentation/src/main/java/daily/dayo/presentation/screen

Repository: Daily-DAYO/DAYO_Android

Length of output: 1795


🏁 Script executed:

# Search for FilledRoundedCornerButton usage patterns and fontSize definitions
# Assume repo is available at root
find . -type f -name "*.kt" | head -20

Repository: Daily-DAYO/DAYO_Android

Length of output: 1584


🏁 Script executed:

# Search for FilledRoundedCornerButton usage and definition
rg -n "FilledRoundedCornerButton" presentation/src/main/java --type kt -C 3

Repository: Daily-DAYO/DAYO_Android

Length of output: 94


🏁 Script executed:

# Search for fontSize definitions in theme/style files
rg -n "fontSize\s*=" presentation/src/main/java/daily/dayo/presentation/theme --type kt -C 2

Repository: Daily-DAYO/DAYO_Android

Length of output: 94


🏁 Script executed:

# Locate and read the Button.kt file to understand the implementation
find presentation/src/main/java -name "Button.kt" -type f

Repository: Daily-DAYO/DAYO_Android

Length of output: 133


🏁 Script executed:

# Search for FilledRoundedCornerButton usage across the codebase
rg -n "FilledRoundedCornerButton" presentation/src/main/java -C 3

Repository: Daily-DAYO/DAYO_Android

Length of output: 23974


🏁 Script executed:

# Search for fontSize definitions in theme
rg -n "fontSize\s*=" presentation/src/main/java/daily/dayo/presentation/theme -C 2

Repository: Daily-DAYO/DAYO_Android

Length of output: 8521


🏁 Script executed:

# Read the Button.kt file
cat -n presentation/src/main/java/daily/dayo/presentation/view/Button.kt

Repository: Daily-DAYO/DAYO_Android

Length of output: 11449


🏁 Script executed:

# Check if any calls explicitly pass a textStyle that isn't from the theme
rg -n "textStyle\s*=" presentation/src/main/java/daily/dayo/presentation/screen --context 3 | head -50

Repository: Daily-DAYO/DAYO_Android

Length of output: 5830


🏁 Script executed:

# Search for any custom TextStyle creations that might be passed to FilledRoundedCornerButton
rg -n "TextStyle\(" presentation/src/main/java/daily/dayo/presentation/screen -C 2 | grep -A 2 -B 2 "fontSize"

Repository: Daily-DAYO/DAYO_Android

Length of output: 1151


TextAutoSize 구현의 안전성을 확보하되, 조용한 텍스트 절단 위험에 주의하세요.

현재 모든 FilledRoundedCornerButton 호출처는 테마에서 정의한 스타일(b3, b5 등)을 사용하고 있어 fontSize 제약은 만족하고 있습니다. 다만 TextOverflow.Clip + maxLines=1 + softWrap=false 조합은 긴 로캘 문자열(특히 한글)이 조용히 잘릴 수 있는 구조입니다.

안전성을 강화하기 위해:

  1. 공용 컴포넌트이므로 maxFontSize에 명시적 하한을 설정하거나, 함수 내에서 textStyle.fontSize가 12.sp 이상임을 보증하는 방어 로직을 추가할 것
  2. textStyle 파라미터 문서에 "명시적 fontSize를 가져야 함" 요구사항을 명기할 것
  3. 향후 호출처에서 텍스트 절단을 방지하기 위해, 필요시 버튼 너비 제약 또는 타원 부호(TextOverflow.Ellipsis)로 변경을 검토할 것
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@presentation/src/main/java/daily/dayo/presentation/view/Button.kt` around
lines 122 - 129, The FilledRoundedCornerButton's Text composable uses
TextAutoSize with maxFontSize = textStyle.fontSize which can be smaller than
safe limits and combined with maxLines=1, softWrap=false and TextOverflow.Clip
may silently cut long locale strings; add defensive logic in the button
(FilledRoundedCornerButton) to compute a safe maxFontSize =
max(textStyle.fontSize, 12.sp) or clamp textStyle.fontSize to a minimum of 12.sp
before passing to TextAutoSize, and fall back to TextOverflow.Ellipsis or relax
width constraints when autosizing cannot prevent truncation; also update the
KDoc for the textStyle parameter to state callers must provide an explicit
fontSize and note recommended minimum (12.sp) and mention the overflow
behaviour.

)
}
},
Expand Down Expand Up @@ -261,4 +271,4 @@ private fun PreviewDayoTextButton() {
Text(text = "입니다.", style = DayoTheme.typography.caption3.copy(Gray4_C5CAD2))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
Expand Down Expand Up @@ -152,7 +153,9 @@ fun BottomSheetDialog(
Icon(
imageVector = rightIcon,
contentDescription = "",
modifier = Modifier.align(Alignment.CenterVertically),
modifier = Modifier
.size(24.dp)
.align(Alignment.CenterVertically),
tint = Color.Unspecified
)
}
Expand Down
14 changes: 8 additions & 6 deletions presentation/src/main/res/drawable/ic_check.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="13dp"
android:viewportWidth="18"
android:viewportHeight="13">
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M4.58 9.61l3.83 4.64 7-8.5"
android:strokeWidth="1.5"
android:strokeColor="#FF23C882"
android:strokeWidth="2"
android:pathData="M1 6l5.33 5L17 1"/>
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
Loading