Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e01be0a
♻️ Refactor: PhotologCard 기본 색상 파라미터 추가
chanho0908 Feb 13, 2026
cbdeb6a
♻️ Refactor: 인증 상세 화면 TopBar 구조 개선
chanho0908 Feb 13, 2026
4838aa8
✨ Refactor: AppRoundButton 파라미터 순서 변경
chanho0908 Feb 13, 2026
19415a3
✨ Feat: 인증샷 수정 화면 추가 및 재촬영 기능 추가
chanho0908 Feb 13, 2026
4819feb
♻️ Refactor: 파트너 인증 화면에서는 수정 버튼 숨기기
chanho0908 Feb 13, 2026
975d45d
♻️ Refactor: 인증 상세 화면 수정 버튼 노출 로직 변경
chanho0908 Feb 13, 2026
2ef044c
✨ Feat: kotlinx.serialization.json 라이브러리 추가
chanho0908 Feb 13, 2026
2d394b4
✨ Feat: 인증 수정 화면 이동 시 인증 정보 전달
chanho0908 Feb 13, 2026
e6f37ac
✨ Feat: 인증샷 편집 화면 추가
chanho0908 Feb 13, 2026
638b2ac
✨ Feat: Serialization 플러그인 추가
chanho0908 Feb 13, 2026
a4ac5f6
♻️ Refactor: 미사용 파라미터 제거
chanho0908 Feb 14, 2026
c2382fe
♻️ Refactor: CommentBox의 bottom padding을 24dp로 수정
chanho0908 Feb 14, 2026
f5ff586
♻️ Refactor: `ic_close_c100` 리소스 파일을 design-system 모듈로 이동
chanho0908 Feb 14, 2026
5ae6ff1
♻️ Refactor: 인증 상세 화면 TopBar 구조 개선
chanho0908 Feb 13, 2026
8311a9d
Merge branch 'feat/#84-certification-modify' into feat/#85-task-certi…
chanho0908 Feb 14, 2026
475e5a4
✨ Feat: `CommentAnchorFrame` 컴포저블 추가
chanho0908 Feb 14, 2026
7d7f8d6
♻️ Refactor: 인증샷 관련 컴포저블을 design-system으로 이동
chanho0908 Feb 14, 2026
958c40e
✨ Feat: 작성자만 인증을 수정할 수 있도록 버튼 노출 로직 추가
chanho0908 Feb 14, 2026
205a8e0
✨ Feat: 인증샷 수정 화면 댓글 수정 추가
chanho0908 Feb 14, 2026
6be3fcc
✨ Feat: 인증샷 수정 화면 저장 버튼 기능 추가
chanho0908 Feb 14, 2026
66e438a
♻️ Refactor: 잘못 커밋한 코드 수정
chanho0908 Feb 14, 2026
2e5a9c8
✨ Feat: 댓글 화면 키보드 활성화 시 커서 마지막으로 이동
chanho0908 Feb 14, 2026
bb1273f
Merge branch 'feat/#85-task-certification-update' into feat/#85-task-…
chanho0908 Feb 14, 2026
cc22e06
✨ Feat: 인증샷 수정 api 추가
chanho0908 Feb 14, 2026
93a3e61
♻️ Refactor: CommentUiModel의 `comment` 속성을 `value`로 변경
chanho0908 Feb 14, 2026
b0a2d04
✨ Feat: UI 인증샷 코멘트 수정 기능 추가
chanho0908 Feb 14, 2026
bf5c926
♻️ Refactor: 함수명 카멜케이스 수정
chanho0908 Feb 14, 2026
0e0501c
♻️ Refactor: 토스트 사이드 이펙트 함수 분리
chanho0908 Feb 14, 2026
5b91161
♻️ Refactor: 토스트 출력 사이드 이펙트 통일
chanho0908 Feb 14, 2026
b168f86
♻️ Refactor: 미사용 `TaskCertificationRefreshBus` 삭제
chanho0908 Feb 14, 2026
d5bbf4f
✨ Feat: 인증 화면 라우팅 시 photologId, comment 추가
chanho0908 Feb 14, 2026
82414d8
✨ Feat: 인증 상세 화면 refresh를 위한 event bus 추가
chanho0908 Feb 14, 2026
b2c715b
✨ Feat: 인증 화면 이동 시 goalId 추가
chanho0908 Feb 14, 2026
5c4209a
♻️ Refactor: 이름 변경에 따른 클래스명 수정
chanho0908 Feb 14, 2026
10e7563
✨ Feat: UI 인증샷 수정 기능 추가
chanho0908 Feb 14, 2026
e3cf77c
✨ Feat: 인증샷 조회 API 파라미터 타입 변경 (String -> LocalDate)
chanho0908 Feb 15, 2026
38a8f44
♻️ Refactor: 인증 새로고침 이벤트 버스 구조 변경
chanho0908 Feb 15, 2026
ef18244
✨ Feat: 인증 화면 이동 시 날짜 정보 추가
chanho0908 Feb 15, 2026
95f4390
✨ Feat: 인증 화면 이동 시 Serializer를 통해 데이터 전달
chanho0908 Feb 15, 2026
8e3c1f6
Merge branch 'feat/#85-task-certification-update-api' into feat/#85-t…
chanho0908 Feb 15, 2026
d8f3cc1
♻️ Refactor: '찌르기' 문자열 리소스 공용화
chanho0908 Feb 15, 2026
a953a72
♻️ Refactor: 인증 상세 화면에서 왔을 때 불필요한 이벤트 제거
chanho0908 Feb 15, 2026
5bc0c6a
♻️ Refactor: serializer 접근 제어자 변경
chanho0908 Feb 15, 2026
81068cd
♻️ Refactor: 잘못 수정한 코드 수정
chanho0908 Feb 15, 2026
38cb60e
✨ Feat: 댓글 강제 업데이트 로직 추가
chanho0908 Feb 15, 2026
9c55fc5
♻️ Refactor: 불필요한 코드 제거
chanho0908 Feb 15, 2026
28b678d
Merge branch 'feat/#84-certification-modify' into feat/#85-task-certi…
chanho0908 Feb 18, 2026
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 @@ -26,9 +26,9 @@ import com.twix.domain.model.enums.AppTextStyle
fun AppRoundButton(
text: String,
textColor: Color,
backgroundColor: Color,
modifier: Modifier = Modifier,
textStyle: AppTextStyle = AppTextStyle.T2,
backgroundColor: Color,
borderColor: Color = GrayColor.C500,
hasBorder: Boolean = true,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package com.twix.designsystem.components.comment

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.ime
import androidx.compose.foundation.layout.offset
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
import com.twix.designsystem.components.comment.model.CommentUiModel
import com.twix.designsystem.theme.DimmedColor
import com.twix.ui.extension.noRippleClickable

/**
* 특정 UI 요소(Anchor) 하단에 [CommentBox]를 배치하고, 키보드 활성화 상태에 따라 위치를 동적으로 조정하는 프레임 컴포저블
*
* 이 컴포저블은 평상시에는 [anchorBottom] 좌표를 기준으로 배치
* 키보드가 올라와 코맨트창이 가려질 경우 키보드 바로 위로 위치를 자동으로 이동
*
* @param uiModel 댓글창의 상태(텍스트, 포커스 상태)를 담고 있는 데이터 모델
* @param anchorBottom 댓글창 배치의 기준이 되는 상위 요소의 바닥(Bottom) Y 좌표 (px 단위)
* @param onCommentChanged 댓글 내용이 변경될 때 호출되는 콜백
* @param onFocusChanged 댓글창의 포커스 상태가 변경될 때 호출되는 콜백 (포커스 시 배경 딤 처리 등에 사용)
* @param modifier 레이아웃 수정을 위한 [Modifier]
*/
@Composable
fun CommentAnchorFrame(
uiModel: CommentUiModel,
anchorBottom: Float,
onCommentChanged: (String) -> Unit,
onFocusChanged: (Boolean) -> Unit,
modifier: Modifier = Modifier,
) {
if (anchorBottom == 0f) return

val density = LocalDensity.current
val focusManager = LocalFocusManager.current
val imeBottom = WindowInsets.ime.getBottom(density)
val paddingBottom = with(density) { 24.dp.toPx() }

var commentBoxHeight by remember { mutableFloatStateOf(0f) }
val defaultY = anchorBottom - commentBoxHeight - paddingBottom

BoxWithConstraints(modifier = modifier.fillMaxSize()) {
val screenHeight = constraints.maxHeight.toFloat()
val keyboardTop = screenHeight - imeBottom

AnimatedVisibility(
visible = uiModel.isFocused,
enter = fadeIn(),
exit = fadeOut(),
) {
Box(
modifier =
Modifier
.fillMaxSize()
.background(DimmedColor.D070)
.noRippleClickable { focusManager.clearFocus() },
)
}
CommentBox(
uiModel = uiModel,
onCommentChanged = onCommentChanged,
onFocusChanged = onFocusChanged,
onHeightMeasured = { height ->
if (commentBoxHeight != height) commentBoxHeight = height
},
modifier =
Modifier
.fillMaxWidth()
.offset {
/**
* 키보드가 활성화되었고, 댓글창이 키보드 위치보다 아래에 있어 가려지는 경우
* */
val targetY =
if (imeBottom > 0 && (defaultY + commentBoxHeight) > keyboardTop) {
/**
* 화면 전체 높이 - 키보드 높이 - 코멘트 높이
* */
(screenHeight - imeBottom - commentBoxHeight).toInt()
} else {
/**
* 키보드가 없거나, 댓글창이 키보드에 가려지지 않는 경우
* */
defaultY.toInt()
}
IntOffset(x = 0, y = targetY)
},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package com.twix.designsystem.components.comment
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.twix.designsystem.R
Expand All @@ -20,11 +20,15 @@ fun CommentBox(
uiModel: CommentUiModel,
onCommentChanged: (String) -> Unit,
onFocusChanged: (Boolean) -> Unit,
onHeightMeasured: (Float) -> Unit,
modifier: Modifier = Modifier,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = modifier,
modifier =
modifier.onSizeChanged { size ->
onHeightMeasured(size.height.toFloat())
},
) {
AppText(
text = if (uiModel.isFocused) stringResource(R.string.comment_condition_guide) else "",
Expand All @@ -33,13 +37,11 @@ fun CommentBox(
)

Spacer(modifier = Modifier.height(8.dp))

CommentTextField(
uiModel = uiModel,
onCommitComment = onCommentChanged,
onFocusChanged = onFocusChanged,
modifier =
Modifier
.padding(bottom = 20.dp),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.layout.boundsInRoot
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
Expand All @@ -50,13 +49,30 @@ fun CommentTextField(
enabled: Boolean = true,
onCommitComment: (String) -> Unit = {},
onFocusChanged: (Boolean) -> Unit = {},
onPositioned: (Rect) -> Unit = {},
) {
val focusManager = LocalFocusManager.current
val focusRequester = remember { FocusRequester() }
val keyboardState by keyboardAsState()

var internalValue by rememberSaveable(uiModel.comment) { mutableStateOf(uiModel.comment) }
var internalValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(
TextFieldValue(
text = uiModel.value,
selection = TextRange(uiModel.value.length),
),
)
}

LaunchedEffect(uiModel.value) {
if (uiModel.value != internalValue.text) {
internalValue =
TextFieldValue(
text = uiModel.value,
selection = TextRange(uiModel.value.length),
)
}
}

var isInitialized by remember { mutableStateOf(false) }

LaunchedEffect(keyboardState) {
Expand All @@ -66,31 +82,36 @@ fun CommentTextField(
when (keyboardState) {
Keyboard.Opened -> Unit
Keyboard.Closed -> {
onCommitComment(internalValue.trim())
onCommitComment(internalValue.text.trim())
focusManager.clearFocus()
}
}
}
}

LaunchedEffect(uiModel.isFocused) {
/**
* 외부에서 포커스 상태를 제어하는 경우
* e.g 사진 촬영 & 사진 선택
* */
if (uiModel.isFocused) focusRequester.requestFocus()
}

Box(
modifier =
modifier
.onGloballyPositioned { coordinates ->
onPositioned(coordinates.boundsInRoot())
}.noRippleClickable {
.noRippleClickable {
focusRequester.requestFocus()
},
) {
TextField(
value = internalValue,
onValueChange = { newValue ->
if (newValue.length <= CommentUiModel.COMMENT_COUNT) {
internalValue = newValue
if (newValue.text.length <= CommentUiModel.COMMENT_COUNT) {
internalValue =
newValue.copy(
selection = TextRange(newValue.text.length),
)
}
},
enabled = enabled,
Expand Down Expand Up @@ -130,16 +151,16 @@ fun CommentTextField(
) {
repeat(CommentUiModel.COMMENT_COUNT) { index ->
val char =
if (uiModel.isFocused || internalValue.isNotEmpty()) {
internalValue.getOrNull(index)?.toString()
if (uiModel.isFocused || internalValue.text.isNotEmpty()) {
internalValue.text.getOrNull(index)?.toString()
} else {
stringResource(R.string.comment_text_field_placeholder)[index].toString()
}.orEmpty()

CommentCircle(
text = char,
showPlaceholder = !uiModel.isFocused && internalValue.isEmpty(),
showCursor = uiModel.isFocused && index == internalValue.length,
showPlaceholder = !uiModel.isFocused && internalValue.text.isEmpty(),
showCursor = uiModel.isFocused && index == internalValue.text.length,
modifier =
Modifier.noRippleClickable {
focusRequester.requestFocus()
Expand All @@ -159,7 +180,6 @@ private fun CommentTextFieldPreview() {
CommentTextField(
uiModel = CommentUiModel(text, isFocused),
onFocusChanged = { isFocused = it },
onPositioned = {},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import androidx.compose.runtime.Immutable

@Immutable
data class CommentUiModel(
val comment: String = "",
val value: String = "",
val isFocused: Boolean = false,
) {
val hasMaxCommentLength: Boolean
get() = comment.length == COMMENT_COUNT
get() = value.length == COMMENT_COUNT

val canUpload: Boolean
get() =
comment.isEmpty() ||
comment.isNotEmpty() &&
value.isEmpty() ||
value.isNotEmpty() &&
hasMaxCommentLength

fun updateComment(newComment: String): CommentUiModel = copy(comment = newComment)
fun updateComment(newComment: String): CommentUiModel = copy(value = newComment)

fun updateFocus(isFocused: Boolean) = copy(isFocused = isFocused)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.twix.task_certification.detail.component
package com.twix.designsystem.components.photolog

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -16,15 +16,14 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.twix.designsystem.R
import com.twix.designsystem.components.button.AppRoundButton
import com.twix.designsystem.components.text.AppText
import com.twix.designsystem.theme.CommonColor
import com.twix.designsystem.theme.GrayColor
import com.twix.designsystem.theme.TwixTheme
import com.twix.domain.model.enums.AppTextStyle
import com.twix.task_certification.R
import com.twix.ui.extension.noRippleClickable
import com.twix.designsystem.R as DesR

@Composable
fun BackgroundCard(
Expand Down Expand Up @@ -69,7 +68,7 @@ fun BackgroundCard(
}

Image(
imageVector = ImageVector.vectorResource(DesR.drawable.ic_keepi_sting),
imageVector = ImageVector.vectorResource(R.drawable.ic_keepi_sting),
contentDescription = null,
modifier =
Modifier
Expand All @@ -86,7 +85,7 @@ fun BackgroundCard(
fun PreviewBackgroundCard() {
TwixTheme {
BackgroundCard(
buttonTitle = stringResource(R.string.task_certification_detail_partner_sting),
buttonTitle = stringResource(R.string.word_sting),
uploadedAt = "2023.10.31 23:59",
onClick = {},
isCertificated = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.twix.task_certification.detail.component
package com.twix.designsystem.components.photolog

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -18,7 +18,7 @@ import com.twix.designsystem.components.comment.model.CommentUiModel
import com.twix.designsystem.theme.TwixTheme

@Composable
internal fun CertificatedCard(
fun CertificatedCard(
imageUrl: String?,
comment: String?,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.twix.task_certification.detail.component
package com.twix.designsystem.components.photolog

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import com.twix.designsystem.R
import com.twix.designsystem.components.text.AppText
import com.twix.designsystem.theme.CommonColor
import com.twix.designsystem.theme.GrayColor
import com.twix.designsystem.theme.TwixTheme
import com.twix.domain.model.enums.AppTextStyle
import com.twix.domain.model.enums.BetweenUs
import com.twix.task_certification.R
import com.twix.designsystem.R as DesR

@Composable
internal fun ForegroundCard(
fun ForegroundCard(
isCertificated: Boolean,
nickName: String,
imageUrl: String?,
Expand All @@ -32,9 +31,11 @@ internal fun ForegroundCard(
AppText(
text =
when (currentShow) {
BetweenUs.ME -> stringResource(DesR.string.keep_it_up)
BetweenUs.ME -> stringResource(R.string.keep_it_up)
BetweenUs.PARTNER ->
stringResource(R.string.task_certification_detail_partner_not_task_certification).format(nickName)
stringResource(R.string.partner_not_task_certification).format(
nickName,
)
},
style = AppTextStyle.H2,
color = GrayColor.C500,
Expand Down
Loading