Skip to content

Commit 7068e6f

Browse files
Adronclaude
andcommitted
fix(profile): don't nest verticalScroll in the Account hub
ProfileContent owned a verticalScroll while the Account hub also wrapped it in a scrolling Column, throwing IllegalStateException (infinite-height measure) at render. ProfileContent is now a plain content block; the hub scrolls header+menu together, and UserProfileScreen supplies its own scroll. Verified live on emulator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent da1e1c5 commit 7068e6f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

feature/profile/src/main/kotlin/com/interlinedlist/android/feature/profile/ui/profile/ProfileContent.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ fun ProfileContent(
7070
isFollowActionInProgress: Boolean = false,
7171
onToggleFollow: () -> Unit = {},
7272
) {
73+
// A content block, not a scroll container: the caller owns scrolling so the
74+
// Account hub can scroll this header together with its menu rows (nesting
75+
// two verticalScroll containers throws an infinite-height measure error).
7376
Column(
7477
modifier = modifier
7578
.fillMaxWidth()
76-
.verticalScroll(rememberScrollState())
7779
.padding(horizontal = 24.dp, vertical = 24.dp),
7880
horizontalAlignment = Alignment.CenterHorizontally,
7981
verticalArrangement = Arrangement.Top,

feature/profile/src/main/kotlin/com/interlinedlist/android/feature/profile/ui/profile/UserProfileScreen.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import androidx.compose.foundation.layout.Box
44
import androidx.compose.foundation.layout.Column
55
import androidx.compose.foundation.layout.Spacer
66
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.compose.foundation.rememberScrollState
8+
import androidx.compose.foundation.verticalScroll
79
import androidx.compose.foundation.layout.height
810
import androidx.compose.foundation.layout.padding
911
import androidx.compose.material.icons.Icons
@@ -89,7 +91,10 @@ fun UserProfileScreen(
8991
when {
9092
state.user != null -> ProfileContent(
9193
user = state.user,
92-
modifier = Modifier.fillMaxSize().padding(padding),
94+
modifier = Modifier
95+
.fillMaxSize()
96+
.padding(padding)
97+
.verticalScroll(rememberScrollState()),
9398
counts = state.followCounts,
9499
onOpenFollowers = onOpenFollowers,
95100
onOpenFollowing = onOpenFollowing,

0 commit comments

Comments
 (0)