Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d9b3c22
[ui]: 유저의 구독리스트 구독자 없는 경우(#74)
JJUYAAA Aug 8, 2025
46302b6
[ui]: 내피드 - 작성된 글 없는 경우(#74)
JJUYAAA Aug 8, 2025
604afd3
[ui]: 내피드 - 작성된 글 없는 경우 프리뷰 분리(#74)
JJUYAAA Aug 8, 2025
2a1ab49
[ui]: 내피드 - 작성된 글 없는 경우 멘트 수정(#74)
JJUYAAA Aug 8, 2025
6b23c85
[ui]: 피드 - 내가 구독하는 유저가 없는 경우(#74)
JJUYAAA Aug 8, 2025
d73b6a3
[ui]: 마이페이지-저장피드-> 데이터 없는 경우 추가(#74)
JJUYAAA Aug 8, 2025
66dc72e
[ui]: 마이페이지-책피드-> 데이터 없는 경우 추가(#74)
JJUYAAA Aug 8, 2025
f1d9636
[ui]: 사용자 찾기 페이지에 쓰이는 컴포넌트 추가(#74)
JJUYAAA Aug 8, 2025
e294248
[ui]: 사용자 찾기 페이지 구현(#74)
JJUYAAA Aug 8, 2025
aa32dec
[ui]: 사용자 찾기 페이지 텍스트 수정(#74)
JJUYAAA Aug 8, 2025
a53c0bb
[ui]: 사용자 찾기 패딩값 수정 등 자잘한 수정(#74)
JJUYAAA Aug 9, 2025
360a4e2
[ui]: 다른 사람 피드 조회 페이지 추가(#74)
JJUYAAA Aug 9, 2025
5d0cdb6
[ui]: 반응화면 - 데이터 없는 경우(#74)
JJUYAAA Aug 9, 2025
c30f3d3
[refactor]: 불필요한 분기 제거(#74)
JJUYAAA Aug 9, 2025
3d18451
[refactor]: 하드코딩 제거, take(5)로직 재사용(#74)
JJUYAAA Aug 9, 2025
d2e07f2
[refactor]: 하드코딩 제거, take(5)로직 재사용(#74)
JJUYAAA Aug 9, 2025
4670a92
[refactor]: 오타수정(#74)
JJUYAAA Aug 9, 2025
cb8534d
[refactor]: EmptySavedBookViewModel 수정(#74)
JJUYAAA Aug 9, 2025
37e2fc8
[refactor]: feedOthersScreen 수정(#74)
JJUYAAA Aug 9, 2025
1d608c3
[refactor]: feedOthersScreen 수정(#74)
JJUYAAA Aug 9, 2025
5b508b1
[refactor]: 패딩값, text 수정(#74)
JJUYAAA Aug 9, 2025
19374f1
[fix]: 충돌 해결(#74)
JJUYAAA Aug 12, 2025
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
55 changes: 30 additions & 25 deletions app/src/main/java/com/texthip/thip/ui/common/header/AuthorHeader.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.texthip.thip.ui.common.header

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -41,7 +42,8 @@ fun AuthorHeader(
showThipNum: Boolean = false,
thipNum: Int? = null,
profileImageSize: Dp = 54.dp,
onButtonClick: () -> Unit = {}
onButtonClick: () -> Unit = {},
onThipNumClick: () -> Unit = {}
) {
Row(
modifier = modifier
Expand Down Expand Up @@ -84,31 +86,31 @@ fun AuthorHeader(
}
if (showButton) {
OutlinedButton(
modifier = Modifier
.then(
if (buttonWidth != null)
Modifier
.width(buttonWidth)
.height(33.dp)
else Modifier
),
text = buttonText,
textStyle = typography.view_m500_s14,
onClick = onButtonClick
modifier = Modifier
.width(buttonWidth)
.height(33.dp),
text = buttonText,
textStyle = typography.view_m500_s14,
onClick = onButtonClick
)
}
if(showThipNum && thipNum!=null){
Text(
text = stringResource(R.string.thip_num,thipNum),
style = typography.view_r400_s11_h20,
color = colors.White
)
Spacer(modifier = Modifier.width(18.dp))
Icon(
painter = painterResource(R.drawable.ic_chevron),
contentDescription = null,
tint = colors.White,
)
if (showThipNum && thipNum != null) {
Row(
modifier = Modifier.clickable(onClick = onThipNumClick),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.thip_num, thipNum)+ stringResource(R.string.thip_ing),
style = typography.view_r400_s11_h20,
color = colors.White
)
Spacer(modifier = Modifier.width(18.dp))
Icon(
painter = painterResource(R.drawable.ic_chevron),
contentDescription = null,
tint = colors.White,
)
}
}
}
}
Expand All @@ -131,7 +133,10 @@ fun PreviewAuthorHeader() {
badgeText = "칭호칭호칭호",
showButton = false,
showThipNum = true,
thipNum = 10
thipNum = 10,
onThipNumClick = {

}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
Expand Down Expand Up @@ -57,14 +58,13 @@ fun FeedSubscribeBarlist(
color = colors.White
)
) {
append("${followerProfileImageUrls.size}명")
}
append(stringResource(R.string.thip_num, followerProfileImageUrls.size)) }
withStyle(
style = SpanStyle(
color = colors.Grey
)
) {
append("이 띱 하는중")
append(stringResource(R.string.thip_ing))
}
},
style = typography.info_r400_s12,
Expand All @@ -74,25 +74,28 @@ fun FeedSubscribeBarlist(
Row(
verticalAlignment = Alignment.CenterVertically
) {
followerProfileImageUrls.take(5).reversed().forEachIndexed { index, imageUrl ->
AsyncImage(
model = imageUrl,
if (followerProfileImageUrls.isNotEmpty()) {
val previewList = followerProfileImageUrls.take(5)
previewList.reversed().forEachIndexed { index, imageUrl ->
AsyncImage(
model = imageUrl,
contentDescription = null,
modifier = Modifier
.size(24.dp)
.clip(CircleShape)
.background(Color.LightGray)
)

val isLast = index == previewList.lastIndex
Spacer(modifier = Modifier.width(if (isLast) 15.dp else 4.dp))
}

Icon(
painter = painterResource(id = R.drawable.ic_chevron),
contentDescription = null,
modifier = Modifier
.size(24.dp)
.clip(CircleShape)
.background(Color.LightGray)
tint = colors.Grey
)

val isLast = index == followerProfileImageUrls.take(5).lastIndex
Spacer(modifier = Modifier.width(if (isLast) 15.dp else 4.dp))
}

Icon(
painter = painterResource(id = R.drawable.ic_chevron),
contentDescription = null,
tint = colors.Grey
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.texthip.thip.ui.feed.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.ui.common.header.AuthorHeader
import com.texthip.thip.ui.feed.mock.MySubscriptionData
import com.texthip.thip.ui.theme.ThipTheme
import com.texthip.thip.ui.theme.ThipTheme.colors

@Composable
fun SearchPeopleResult(
modifier: Modifier = Modifier,
peopleList: List<MySubscriptionData>,
onThipNumClick: (MySubscriptionData) -> Unit = {}
) {
LazyColumn (modifier = modifier){
itemsIndexed(peopleList) { index, user ->
AuthorHeader(
profileImage = user.profileImageUrl,
nickname = user.nickname,
badgeText = user.role,
profileImageSize = 36.dp,
showButton = false,
showThipNum = true,
thipNum = user.subscriberCount,
onThipNumClick = { onThipNumClick(user) }
)
Comment on lines +28 to +38
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

LazyColumn 아이템에 안정적 key를 지정해 재구성 비용과 스크롤 깜빡임을 줄여주세요.

현재 itemsIndexed(peopleList)에 key가 없어 Diff 계산 시 불필요한 재구성이 발생할 수 있습니다. 고유 식별자가 있다면 그 값을 key로 사용하세요. (닉네임이 유일하지 않을 수 있으므로 가능하면 id 사용 권장)

다음과 같이 적용을 제안드립니다(예: 임시로 nickname 사용):

-        itemsIndexed(peopleList) { index, user ->
+        itemsIndexed(peopleList, key = { _, user -> user.nickname }) { index, user ->

닉네임이 유일하지 않다면 MySubscriptionDataid를 추가한 뒤 해당 id를 key로 사용해주세요.

📝 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
itemsIndexed(peopleList) { index, user ->
AuthorHeader(
profileImage = user.profileImageUrl,
nickname = user.nickname,
badgeText = user.role,
profileImageSize = 36.dp,
showButton = false,
showThipNum = true,
thipNum = user.subscriberCount,
onThipNumClick = { onThipNumClick(user) }
)
itemsIndexed(peopleList, key = { _, user -> user.nickname }) { index, user ->
AuthorHeader(
profileImage = user.profileImageUrl,
nickname = user.nickname,
badgeText = user.role,
profileImageSize = 36.dp,
showButton = false,
showThipNum = true,
thipNum = user.subscriberCount,
onThipNumClick = { onThipNumClick(user) }
)
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/ui/feed/component/LiveSearchPeopleResult.kt
around lines 28 to 38, the LazyColumn's itemsIndexed call lacks a stable key,
causing unnecessary recompositions and scroll flickering. Fix this by adding a
key parameter to itemsIndexed using a unique identifier for each user,
preferably an id if available; if not, temporarily use the nickname as the key.
If the data model does not have an id, add one to ensure stable keys.

if (index < peopleList.size - 1) {
Spacer(
modifier = Modifier
.padding(vertical = 12.dp, horizontal = 20.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)
}
}
}
}

@Preview(showBackground = true)
@Composable
fun SearchPeopleResultPreview() {
ThipTheme {
Box(
modifier = Modifier
.fillMaxSize()
) {
SearchPeopleResult(
peopleList = listOf(
MySubscriptionData(
profileImageUrl = null,
nickname = "Thiper_Official",
role = "공식 인플루언서",
roleColor = colors.NeonGreen,
subscriberCount = 50,
isSubscribed = false
),
MySubscriptionData(
profileImageUrl = null,
nickname = "Thiper_Writer",
role = "작가",
roleColor = colors.Yellow,
subscriberCount = 120,
isSubscribed = true
),
MySubscriptionData(
profileImageUrl = null,
nickname = "Thiper_Newbie",
role = "칭호칭호",
roleColor = colors.White,
subscriberCount = 0,
isSubscribed = false
)
)
)
}
}
}
Loading