-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/#30 feat timetable name limit #45
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
Changes from all commits
b61f4b8
ea8a4db
dc117b5
afc993a
d649543
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,12 +43,14 @@ fun CchAppBarWithTitle( | |||||||||||||||||
| Row( | ||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||
| .wrapContentWidth() | ||||||||||||||||||
| .height(24.dp) | ||||||||||||||||||
| .clickable { onClickBackButton() }, | ||||||||||||||||||
| .height(24.dp), | ||||||||||||||||||
| verticalAlignment = Alignment.CenterVertically, | ||||||||||||||||||
| horizontalArrangement = Arrangement.spacedBy(2.dp) | ||||||||||||||||||
| ) { | ||||||||||||||||||
| Image( | ||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||
| .clip(CircleShape) | ||||||||||||||||||
| .cchClickable(onClick = onClickBackButton), | ||||||||||||||||||
|
Comment on lines
+51
to
+53
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. ๐ ๏ธ Refactor suggestion ํด๋ฆญ ์์ญ์ด ์์ด์ฝ ํฌ๊ธฐ์ ํ์ ๋จ โ 48dp ํฐ์น ์์ญ์ ๋ช ์์ ์ผ๋ก ๋ถ์ฌํ์ธ์ ํด๋ฆญ์ด Image์๋ง ๊ฑธ๋ฆฌ๋ฉด์ ์ค์ ํฐ์น ์์ญ์ด ์์ด์ฝ(์ถ์ 24dp) ํฌ๊ธฐ๋ก ์ถ์๋์์ต๋๋ค. ์ต์ 48dp์ ํฐ์น ์์ญ์ ๋ณด์ฅํ๋๋ก ์ ์ฉ ์ ์(diff): - modifier = Modifier
- .clip(CircleShape)
- .cchClickable(onClick = onClickBackButton),
+ modifier = Modifier
+ .size(48.dp)
+ .clip(CircleShape)
+ .cchClickable(onClick = onClickBackButton)
+ .padding(12.dp),๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||
| painter = painterResource(resource = Res.drawable.ic_appbar_arrow_left_chukchuk), | ||||||||||||||||||
| contentDescription = "", | ||||||||||||||||||
|
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. ๐ ๏ธ Refactor suggestion ์ ๊ทผ์ฑ: ๋น์ด์๋ contentDescription์ ์๋ฏธ ์๋ ๋ฌธ์์ด๋ก ๊ต์ฒดํ์ธ์ ์กฐ์ ๊ฐ๋ฅํ ๋ค๋ก๊ฐ๊ธฐ ๋ฒํผ์ธ๋ฐ ์ ์ฉ ์ ์(diff): - contentDescription = "",
+ contentDescription = stringResource(Res.string.appbar_navigate_up_content_description),์ถ๊ฐ:
๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,7 @@ import com.chukchukhaksa.mobile.common.designsystem.theme.CchTheme | |||||||||||||||||||||||||||||||||||||||||||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Gray200 | ||||||||||||||||||||||||||||||||||||||||||||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Gray400 | ||||||||||||||||||||||||||||||||||||||||||||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Purple600 | ||||||||||||||||||||||||||||||||||||||||||||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Red300 | ||||||||||||||||||||||||||||||||||||||||||||
| import com.chukchukhaksa.mobile.common.designsystem.theme.White100 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -32,13 +33,14 @@ fun CchRegularTextField( | |||||||||||||||||||||||||||||||||||||||||||
| value: String = "", | ||||||||||||||||||||||||||||||||||||||||||||
| placeholder: String = "", | ||||||||||||||||||||||||||||||||||||||||||||
| isActive: Boolean = false, | ||||||||||||||||||||||||||||||||||||||||||||
| isError: Boolean = false, | ||||||||||||||||||||||||||||||||||||||||||||
| onValueChanged: (String) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||
| onClickClearButton: () -> Unit = {} | ||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||
| val (borderColor, textColor, textStyle) = if(!isActive) { | ||||||||||||||||||||||||||||||||||||||||||||
| Triple(Gray200, Gray400, CchTheme.typography.bodyLg) | ||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||
| Triple(Purple600, Black100, CchTheme.typography.bodyLgStrong) | ||||||||||||||||||||||||||||||||||||||||||||
| Triple(if (isError) Red300 else Purple600, Black100, CchTheme.typography.bodyLgStrong) | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
40
to
44
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. ๐ ๏ธ Refactor suggestion ์๋ฌ ์ํ๊ฐ ๋นํ์ฑ(isActive=false)์ผ ๋ ๋นจ๊ฐ ๋ณด๋๊ฐ ํ์๋์ง ์์ โ ์๋ฌ ์ฐ์ ๋ก์ง์ผ๋ก ์ ์ ํ์ฌ๋ ์ ์ฉ ์์(diff): - val (borderColor, textColor, textStyle) = if(!isActive) {
- Triple(Gray200, Gray400, CchTheme.typography.bodyLg)
- } else {
- Triple(if (isError) Red300 else Purple600, Black100, CchTheme.typography.bodyLgStrong)
- }
+ val borderColor = when {
+ isError -> Red300
+ isActive -> Purple600
+ else -> Gray200
+ }
+ val textColor = if (isActive) Black100 else Gray400
+ val textStyle = if (isActive) CchTheme.typography.bodyLgStrong else CchTheme.typography.bodyLg๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| BasicTextField( | ||||||||||||||||||||||||||||||||||||||||||||
| value = value, | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||
| package com.chukchukhaksa.mobile.common.extension | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const val TIMETABLE_NAME_LIMIT = 20 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| fun checkOverTimetableNameLimit(name: String): Boolean { | ||||||||||||||||||||||||||||||||||
| return name.trim().length > TIMETABLE_NAME_LIMIT | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| fun checkTimetableNameRule(name: String): Boolean { | ||||||||||||||||||||||||||||||||||
| return name.isNotBlank() && name.trim().length <= TIMETABLE_NAME_LIMIT | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+11
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. ๐งน Nitpick (assertive) ๋ฌธ์ ๊ธธ์ด ๊ธฐ์ค(UTF-16 length vs. ์ฌ์ฉ์ ์ฒด๊ฐ ๊ธ์์) ํ์ธ ํ์ ํ์ฌ ๐งน Nitpick (assertive) ๋ถ๋ฆฌ์ธ ๊ท์น ํจ์ ๋ค์ด๋ฐ๊ณผ ์์น ์ผ๊ด์ฑ ๊ฐ์ ์ ์
์๋์ ๊ฐ์ด ๋ค์ด๋ฐ์ ์ ๋ฆฌํ๋ฉด ํธ์ถ๋ถ ๊ฐ๋ ์ฑ์ด ๊ฐ์ ๋ฉ๋๋ค. -const val TIMETABLE_NAME_LIMIT = 20
-
-fun checkOverTimetableNameLimit(name: String): Boolean {
- return name.trim().length > TIMETABLE_NAME_LIMIT
-}
-
-fun checkTimetableNameRule(name: String): Boolean {
- return name.isNotBlank() && name.trim().length <= TIMETABLE_NAME_LIMIT
-}
+const val TIMETABLE_NAME_LIMIT = 20
+
+fun isTimetableNameOverLimit(name: String): Boolean =
+ name.trim().length > TIMETABLE_NAME_LIMIT
+
+fun isTimetableNameValid(name: String): Boolean =
+ name.isNotBlank() && name.trim().length <= TIMETABLE_NAME_LIMITํธ์ถ๋ถ ๋ณ๊ฒฝ์ ๋ณธ PR์ ๋ Screen/๋ Contract์์๋ง ํ์ํด ์ํฅ ๋ฒ์๊ฐ ์์ต๋๋ค. ์ํ์๋ฉด ๊ด๋ จ ํธ์ถ๋ถ diff๋ ํจ๊ป ์ ์๋๋ฆฌ๊ฒ ์ต๋๋ค. ๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package com.chukchukhaksa.mobile.presentation.timetable.timetableeditor | |
| import com.chukchukhaksa.mobile.presentation.timetable.navigation.argument.TimetableEditorArgument | ||
| import com.chukchukhaksa.mobile.presentation.timetable.semesterselect.semesterList | ||
| import com.chukchukhaksa.mobile.presentation.timetable.semesterselect.Semester | ||
| import com.chukchukhaksa.mobile.common.extension.checkTimetableNameRule | ||
|
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. ๐งน Nitpick (assertive) ์๋ํฐ ๋ฒํผ ํ์ฑํ ๊ท์น ๊ณตํตํ ์ ์ฉ ๐
- val buttonEnabled = ((checkTimetableNameRule(name)) && (preName != name || preSelectedSemesterPosition != selectedSemesterPosition))
+ val buttonEnabled = checkTimetableNameRule(name) &&
+ (preName != name || preSelectedSemesterPosition != selectedSemesterPosition)Also applies to: 17-17 ๐ค Prompt for AI Agents |
||
|
|
||
|
|
||
| data class TimetableEditorState( | ||
|
|
@@ -13,7 +14,7 @@ data class TimetableEditorState( | |
| val selectedSemesterPosition: Int? = null, | ||
| ) { | ||
| val semester = selectedSemesterPosition?.let { semesterList.getOrNull(it) } | ||
| val buttonEnabled = (name.isNotEmpty() && preName != name || preSelectedSemesterPosition != selectedSemesterPosition) | ||
| val buttonEnabled = ((checkTimetableNameRule(name)) && (preName != name || preSelectedSemesterPosition != selectedSemesterPosition)) | ||
| } | ||
|
|
||
| internal fun TimetableEditorArgument.toState() = TimetableEditorState( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,15 @@ import androidx.compose.foundation.layout.Spacer | |
| import androidx.compose.foundation.layout.WindowInsets | ||
| import androidx.compose.foundation.layout.consumeWindowInsets | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.imePadding | ||
| import androidx.compose.foundation.layout.navigationBars | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.text.style.TextAlign | ||
| import androidx.compose.ui.unit.Dp | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.lifecycle.compose.collectAsStateWithLifecycle | ||
|
|
@@ -23,7 +26,10 @@ import com.chukchukhaksa.mobile.common.designsystem.component.bottomsheet.CchSel | |
| import com.chukchukhaksa.mobile.common.designsystem.component.button.CchBasicButton | ||
| import com.chukchukhaksa.mobile.common.designsystem.component.container.CchSelectionButton | ||
| import com.chukchukhaksa.mobile.common.designsystem.component.textfield.CchRegularTextField | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.CchTheme | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Red300 | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.White | ||
| import com.chukchukhaksa.mobile.common.extension.checkOverTimetableNameLimit | ||
| import com.chukchukhaksa.mobile.common.ui.collectWithLifecycle | ||
| import com.chukchukhaksa.mobile.presentation.timetable.semesterselect.semesterList | ||
| import kotlinx.collections.immutable.toPersistentList | ||
|
|
@@ -100,10 +106,23 @@ fun TimetableEditorScreen( | |
| value = uiState.name, | ||
| placeholder = stringResource(Res.string.create_timetable_screen_placeholder), | ||
| isActive = uiState.name.isNotEmpty() && uiState.name != uiState.preName, | ||
| isError = checkOverTimetableNameLimit(uiState.name), | ||
| onValueChanged = onValueChangeTimetableName, | ||
| onClickClearButton = onClickTextFieldClearButton, | ||
| ) | ||
|
Comment on lines
+109
to
112
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. ๐ ๏ธ Refactor suggestion ์๋ฌ ํ์ ์กฐ๊ฑด ๋ถ์ผ์น์ ํ๋์ฝ๋ฉ(20) ์ค๋ณต โ ์ ๋ ฅ ํ๋ฉด๊ณผ ๋์ผ ์ด์ ์
๋ ฅ ํ๋ฉด๊ณผ ๋์ผํ๊ฒ - isError = checkOverTimetableNameLimit(uiState.name),
+ isError = checkOverTimetableNameLimit(uiState.name),
...
- if (uiState.name.length > 20) {
+ if (checkOverTimetableNameLimit(uiState.name)) {
Text(
modifier = Modifier
.padding(top = 12.dp, start = 4.dp, end = 4.dp)
.fillMaxWidth(),
- text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ 20์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.",
+ text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ ${TIMETABLE_NAME_LIMIT}์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.",
textAlign = TextAlign.Start,
style = CchTheme.typography.bodyMd,
color = Red300,
)
}ํ์ํ import: import com.chukchukhaksa.mobile.common.extension.checkOverTimetableNameLimit
+import com.chukchukhaksa.mobile.common.extension.TIMETABLE_NAME_LIMITAlso applies to: 114-124 ๐ค Prompt for AI Agents |
||
|
|
||
| if (uiState.name.length > 20) { | ||
| Text( | ||
| modifier = Modifier | ||
| .padding(top = 12.dp, start = 4.dp, end = 4.dp) | ||
| .fillMaxWidth(), | ||
| text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ 20์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.", | ||
| textAlign = TextAlign.Start, | ||
| style = CchTheme.typography.bodyMd, | ||
| color = Red300, | ||
| ) | ||
| } | ||
|
Comment on lines
+114
to
+124
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. ๐งน Nitpick (assertive) ๋ฌธ๊ตฌ ํ๋์ฝ๋ฉ โ ๋ฆฌ์์คํ ๊ณ ๋ ค (๋์ผ ์ ์) ์
๋ ฅ ํ๋ฉด๊ณผ ๋์ผํ๊ฒ ๋ฌธ์์ด ๋ฆฌ์์ค ์ฌ์ฉ์ ๊ถ์ฅํฉ๋๋ค. ์๋ฆฌํ์์์ ๐ค Prompt for AI Agents |
||
|
|
||
| Spacer(modifier = Modifier.weight(1f)) | ||
|
|
||
| CchBasicButton( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -104,9 +104,9 @@ fun TimetableListScreen( | |||||||||||||||||||||||||
| if (uiState.timetableList.isEmpty()) { | ||||||||||||||||||||||||||
| Text( | ||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||
| .padding(top = 150.dp), | ||||||||||||||||||||||||||
| .padding(top = 324.dp), | ||||||||||||||||||||||||||
| textAlign = TextAlign.Center, | ||||||||||||||||||||||||||
| text = stringResource(Res.string.timetable_list_screen_empty_timetable), | ||||||||||||||||||||||||||
| text = "๋ฑ๋ก๋ ์๊ฐํ๊ฐ ์์ด์!", | ||||||||||||||||||||||||||
| style = CchTheme.typography.bodyMd, | ||||||||||||||||||||||||||
| color = Gray600, | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+109
to
112
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. ๐ก Verification agent ๐งฉ Analysis chain๋ฌธ์์ด ํ๋์ฝ๋ฉ์ผ๋ก i18n ๊นจ์ง โ stringResource ์ฌ์ฉ์ผ๋ก ๋ณต๊ตฌ ํ์ (R)
์ํ์๋ฉด ๋ฆฌ์์ค ํค/๋ฒ์ญ ์ถ๊ฐ PR ์ค์บํด๋ฉ๊น์ง ์ค๋นํด ๋๋ฆฝ๋๋ค. - text = "๋ฑ๋ก๋ ์๊ฐํ๊ฐ ์์ด์!",
+ text = stringResource(Res.string.timetable_list_screen_empty_timetable),์ถ๊ฐ ๊ฒ์ฆ์ ์ํด ์๋ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํด ์ฃผ์ธ์. ๐ Script executed: #!/bin/bash
# 1. ๋ฆฌ์์ค ํ์ผ ๊ฒ์
find . -type f -name strings.xml
# 2. ํค ์กด์ฌ ์ฌ๋ถ ํ์ธ
rg -n 'timetable_list_screen_empty_timetable' .
# 3. TimetableListScreen.kt์ import ๋ฐ stringResource ์ฌ์ฉ ์ฌ๋ถ ํ์ธ
sed -n '1,200p' composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/presentation/timetable/timetablelist/TimetableListScreen.kt
# 4. ํ๋ก์ ํธ ์ ๋ฐ์ stringResource ์ฌ์ฉ ํจํด ๊ฒ์
rg -n 'stringResource' -C2 composeAppLength of output: 45853 ํ๋์ฝ๋ฉ๋ ๋ฌธ์์ด ์ ๊ฑฐ ๋ฐ stringResource ์ ์ฉ ํ์ โข ๋์ ์์น
โข ํ์ธ ์ฌํญ
@@ composeApp/src/commonMain/kotlin/com/chukchukhaksa/mobile/presentation/timetable/timetablelist/TimetableListScreen.kt:109
- Text(
- modifier = Modifier
- .padding(top = 324.dp),
- textAlign = TextAlign.Center,
- text = "๋ฑ๋ก๋ ์๊ฐํ๊ฐ ์์ด์!",
- style = CchTheme.typography.bodyMd,
- color = Gray600,
- )
+ Text(
+ modifier = Modifier
+ .padding(top = 324.dp),
+ textAlign = TextAlign.Center,
+ text = stringResource(Res.string.timetable_list_screen_empty_timetable),
+ style = CchTheme.typography.bodyMd,
+ color = Gray600,
+ )โ ๋ฆฌ์์ค ๊ฐฑ์ ๋ฐ ์ฐธ์กฐ ์ ์ฉ์ ์ด๋ ค์์ด ์์ผ๋ฉด ์๋ ค์ฃผ์ธ์. PR ์ค์บํด๋ฉ ์ง์ ๊ฐ๋ฅํฉ๋๋ค. ๐ Committable suggestion
Suggested change
๐ค Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Spacer | |
| import androidx.compose.foundation.layout.WindowInsets | ||
| import androidx.compose.foundation.layout.consumeWindowInsets | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.imePadding | ||
| import androidx.compose.foundation.layout.navigationBars | ||
| import androidx.compose.foundation.layout.padding | ||
|
|
@@ -28,7 +29,9 @@ import com.chukchukhaksa.mobile.common.designsystem.component.button.CchBasicBut | |
| import com.chukchukhaksa.mobile.common.designsystem.component.textfield.CchRegularTextField | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Black100 | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.CchTheme | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.Red300 | ||
| import com.chukchukhaksa.mobile.common.designsystem.theme.White | ||
| import com.chukchukhaksa.mobile.common.extension.checkOverTimetableNameLimit | ||
| import com.chukchukhaksa.mobile.common.ui.collectWithLifecycle | ||
| import org.jetbrains.compose.resources.getString | ||
| import org.jetbrains.compose.resources.stringResource | ||
|
|
@@ -102,10 +105,23 @@ fun TimetableNameInputScreen( | |
| value = uiState.name, | ||
| placeholder = stringResource(Res.string.create_timetable_screen_placeholder), | ||
| isActive = uiState.name.isNotEmpty(), | ||
| isError = checkOverTimetableNameLimit(uiState.name), | ||
| onValueChanged = onValueChangeTimetableName, | ||
| onClickClearButton = onClickTextFieldClearButton, | ||
| ) | ||
|
Comment on lines
+108
to
111
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. ๐ ๏ธ Refactor suggestion ์๋ฌ ํ์ ์กฐ๊ฑด ๋ถ์ผ์น์ ํ๋์ฝ๋ฉ(20) ์ค๋ณต โ ๋จ์ผ ์์ค ์ฌ์ฉ์ผ๋ก ์ ํฉ์ฑ ๋ณด์ฅ ํ์
๋์ผํ ๊ฒ์ฆ ํจ์์ ๊ณตํต ์์๋ฅผ ์ฌ์ฉํ๋๋ก ์๋์ ๊ฐ์ด ์ ๋ฆฌํด์ฃผ์ธ์. - isError = checkOverTimetableNameLimit(uiState.name),
+ isError = checkOverTimetableNameLimit(uiState.name),
...
- if (uiState.name.length > 20) {
+ if (checkOverTimetableNameLimit(uiState.name)) {
Text(
modifier = Modifier
.padding(top = 12.dp, start = 4.dp, end = 4.dp)
.fillMaxWidth(),
- text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ 20์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.",
+ text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ ${TIMETABLE_NAME_LIMIT}์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.",
textAlign = TextAlign.Start,
style = CchTheme.typography.bodyMd,
color = Red300,
)
}ํ์ํ import ์ถ๊ฐ: import com.chukchukhaksa.mobile.common.extension.checkOverTimetableNameLimit
+import com.chukchukhaksa.mobile.common.extension.TIMETABLE_NAME_LIMITAlso applies to: 113-123 |
||
|
|
||
| if (uiState.name.length > 20) { | ||
| Text( | ||
| modifier = Modifier | ||
| .padding(top = 12.dp, start = 4.dp, end = 4.dp) | ||
| .fillMaxWidth(), | ||
| text = "์๊ฐํ ์ด๋ฆ์ ์ต๋ 20์๊น์ง ์ค์ ๊ฐ๋ฅํฉ๋๋ค.", | ||
| textAlign = TextAlign.Start, | ||
| style = CchTheme.typography.bodyMd, | ||
| color = Red300, | ||
| ) | ||
| } | ||
|
Comment on lines
+113
to
+123
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. ๐งน Nitpick (assertive) ๋ฌธ๊ตฌ ํ๋์ฝ๋ฉ โ ๋ฆฌ์์คํ ๊ณ ๋ ค ๊ตญ์ ํ/๋ณต์ ํ๋ซํผ ๋์์ ์ํด ์๋ฌ ๋ฉ์์ง๋ฅผ String ๋ฆฌ์์ค๋ก ์ด๋ํ๊ณ ์๋ฆฌํ์์์ ์์๋ฅผ ์ฃผ์ ํ๋ ๋ฐฉ์์ ๊ถ์ฅํฉ๋๋ค. ์)
ํ์ฌ PR ๋ฒ์๋ฅผ ์ต์ํํ๋ ค๋ฉด ์์ ์์ ๋ณด๊ฐ ๋ฒ์ ์ผ๋ก ๋ฐ์ํ๊ณ , ํ์ PR์์ ๋ฆฌ์์คํ๋ฅผ ์งํํด๋ ๋ฉ๋๋ค. ๐ค Prompt for AI Agents |
||
|
|
||
| Spacer(modifier = Modifier.weight(1f)) | ||
|
|
||
| CchBasicButton( | ||
|
|
||
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.
๐ ๏ธ Refactor suggestion
๋ค๋ก๊ฐ๊ธฐ ์์ญ ๋์ด 24dp โ ์ต์ 48dp๋ก ์ํฅ ํ์
Row ๋์ด๊ฐ 24dp๋ก ๊ณ ์ ๋์ด ์์ด ํญ ํ๊ฒ์ด ๊ถ์ฅ ์ต์(48dp)์ ๋ฏธ๋ฌํฉ๋๋ค. ํด๋ฆญ ์ฒ๋ฆฌ๋ฅผ Image๋ก ์ด๋ํ ๋งํผ, ์ปจํ ์ด๋(Row)๋ ์ต์ 48dp ์ด์์ ๋ณด์ฅํด์ผ ์ ๊ทผ์ฑ/์ฌ์ฉ์ฑ ์ ํ๊ฐ ์์ต๋๋ค.
์ ์ฉ ์ ์(diff):
์ถ๊ฐ:
heightIn์ฌ์ฉ์ ์ํดimport androidx.compose.foundation.layout.heightIn๊ฐ ํ์ํฉ๋๋ค.๐ค Prompt for AI Agents