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 @@ -107,7 +107,7 @@ private fun FolderCreateScreen(
.background(DayoTheme.colorScheme.background)
.fillMaxSize()
.padding(contentPadding)
.padding(horizontal = 18.dp, vertical = 16.dp),
.padding(horizontal = 20.dp, vertical = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
DayoTextField(
Expand Down Expand Up @@ -143,7 +143,10 @@ private fun FolderCreateScreen(
ToggleButtonWithLabel(
label = stringResource(R.string.write_post_folder_new_folder_privacy_title),
isToggled = privacy.value == Privacy.ONLY_ME,
onToggleChanged = { privacy.value = if (it) Privacy.ONLY_ME else Privacy.ALL }
onToggleChanged = { privacy.value = if (it) Privacy.ONLY_ME else Privacy.ALL },
modifier = Modifier
.fillMaxWidth()
.align(Alignment.End),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ package daily.dayo.presentation.view
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.Text
import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchDefaults
Expand All @@ -24,15 +21,13 @@ import daily.dayo.presentation.theme.White_FFFFFF
fun ToggleButtonWithLabel(
label: String,
isToggled: Boolean,
onToggleChanged: (Boolean) -> Unit
onToggleChanged: (Boolean) -> Unit,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.End,
modifier = Modifier
.padding(18.dp)
.fillMaxWidth()
.wrapContentHeight()
modifier = modifier
Comment on lines 27 to +30
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore full-width defaults in shared toggle component

By changing ToggleButtonWithLabel to use a plain modifier default, the component no longer applies its previous fillMaxWidth/padding behavior for existing call sites that don’t pass a modifier (for example, FolderEditScreen). In those screens, Arrangement.End stops working as intended because the row now wraps content and is centered by the parent column, causing an unintended layout regression outside the QA-targeted screen.

Useful? React with 👍 / 👎.

Comment on lines +24 to +30
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

기존 호출부의 토글 레이아웃이 깨질 수 있습니다.

modifier 기본값이 빈 Modifier가 되면서 FolderEditScreen.kt:158-166처럼 modifier를 넘기지 않는 호출부는 기존의 padding(18.dp), fillMaxWidth(), wrapContentHeight() 동작을 잃습니다. 새 화면만 조정하려면 기본값은 기존 레이아웃을 유지하거나, modifier 없는 호출부를 함께 업데이트해 주세요.

🛠️ 기존 기본 레이아웃을 보존하는 수정안
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.wrapContentHeight
 fun ToggleButtonWithLabel(
     label: String,
     isToggled: Boolean,
     onToggleChanged: (Boolean) -> Unit,
-    modifier: Modifier = Modifier
+    modifier: Modifier = Modifier
+        .padding(18.dp)
+        .fillMaxWidth()
+        .wrapContentHeight()
 ) {
📝 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
onToggleChanged: (Boolean) -> Unit,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.End,
modifier = Modifier
.padding(18.dp)
.fillMaxWidth()
.wrapContentHeight()
modifier = modifier
onToggleChanged: (Boolean) -> Unit,
modifier: Modifier = Modifier
.padding(18.dp)
.fillMaxWidth()
.wrapContentHeight()
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.End,
modifier = modifier
🤖 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/Switch.kt` around
lines 24 - 30, The Switch composable's default Modifier is an empty Modifier
which breaks existing callers that rely on the original layout (e.g.,
FolderEditScreen); update the default parameter in the Switch function (the
modifier parameter in Switch) to preserve the previous layout by setting it to
the combination of padding(18.dp), fillMaxWidth() and wrapContentHeight(), or
alternatively keep default empty but update all call sites (like
FolderEditScreen) to pass the original Modifier; change the default in Switch to
the original layout modifiers so callers that don't pass a modifier maintain the
prior appearance.

) {
Text(
text = label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import daily.dayo.presentation.common.TextLimitUtil
import daily.dayo.presentation.theme.Dark
import daily.dayo.presentation.theme.DayoTheme
import daily.dayo.presentation.theme.Gray2_767B83
import daily.dayo.presentation.theme.Gray3_9FA5AE
import daily.dayo.presentation.theme.Gray4_C5CAD2
import daily.dayo.presentation.theme.Gray5_E8EAEE
import daily.dayo.presentation.theme.Gray6_F0F1F3
Expand Down Expand Up @@ -90,7 +91,7 @@ fun DayoTextField(
Text(
text = label,
style = DayoTheme.typography.caption3.copy(
color = Gray4_C5CAD2,
color = Gray3_9FA5AE,
fontWeight = FontWeight.SemiBold
)
)
Expand Down Expand Up @@ -143,7 +144,7 @@ fun DayoTextField(
errorContainerColor = Color.Transparent,
focusedContainerColor = Color.Transparent,
unfocusedLabelColor = Color.Transparent, // 라벨
focusedLabelColor = Gray4_C5CAD2,
focusedLabelColor = Gray3_9FA5AE,
errorLabelColor = Red_FF4545,
focusedPlaceholderColor = Gray5_E8EAEE, // 힌트
unfocusedPlaceholderColor = Gray5_E8EAEE,
Expand Down Expand Up @@ -224,7 +225,7 @@ fun DayoPasswordTextField(
Text(
text = label,
style = DayoTheme.typography.caption3.copy(
color = Gray4_C5CAD2,
color = Gray3_9FA5AE,
fontWeight = FontWeight.SemiBold
)
)
Expand Down Expand Up @@ -278,7 +279,7 @@ fun DayoPasswordTextField(
errorContainerColor = Color.Transparent,
focusedContainerColor = Color.Transparent,
unfocusedLabelColor = Color.Transparent, // 라벨
focusedLabelColor = Gray4_C5CAD2,
focusedLabelColor = Gray3_9FA5AE,
errorLabelColor = Red_FF4545,
focusedPlaceholderColor = Gray5_E8EAEE, // 힌트
unfocusedPlaceholderColor = Gray5_E8EAEE,
Expand Down Expand Up @@ -355,7 +356,7 @@ fun DayoTimerTextField(
isError: Boolean = false,
errorMessage: String = "",
timeOutErrorMessage: String = stringResource(id = R.string.email_address_certificate_alert_message_time_fail),
labelColor: Color = Gray4_C5CAD2,
labelColor: Color = Gray3_9FA5AE,
onTimeOut: (() -> Unit) = { },
textAlign: TextAlign = TextAlign.Left,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
Expand Down Expand Up @@ -437,7 +438,7 @@ fun DayoTimerTextField(
errorContainerColor = Color.Transparent,
focusedContainerColor = Color.Transparent,
unfocusedLabelColor = Color.Transparent, // 라벨
focusedLabelColor = Gray4_C5CAD2,
focusedLabelColor = Gray3_9FA5AE,
errorLabelColor = Red_FF4545,
focusedPlaceholderColor = Gray5_E8EAEE, // 힌트
unfocusedPlaceholderColor = Gray5_E8EAEE,
Expand Down
Loading