design: fix bottom modal element border#47
Conversation
📝 WalkthroughWalkthroughThis PR refactors the profile character bottom sheet component by extracting its UI into a new composable, redesigning the profile selection item with press-state interaction feedback and circular layout, and updating previews to match the new structure. ChangesProfileCharacterBottomSheet UI Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/main/java/com/lyrics/feelin/core/designsystem/component/FeelinProfileCharacterBottomSheet.kt (1)
68-111: ⚡ Quick winUse the extracted content composable inside
ProfileCharacterBottomSheetto avoid divergence.The same layout/state block now exists in two places. Wire
ModalBottomSheetto renderProfileCharacterBottomSheetContent(...)so future UI/state edits stay single-source.♻️ Proposed refactor
`@OptIn`(ExperimentalMaterial3Api::class) `@Composable` fun ProfileCharacterBottomSheet( onDismiss: () -> Unit, onSelectProfile: (ProfileCharacter) -> Unit, modifier: Modifier = Modifier, selectedProfile: ProfileCharacter? = null ) { val colors = LocalFeelinColors.current - val isDarkMode = LocalDarkTheme.current - var internalSelectedProfile by remember { mutableStateOf(selectedProfile) } ModalBottomSheet( onDismissRequest = onDismiss, containerColor = colors.modal, shape = RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp), dragHandle = null, modifier = modifier ) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(top = 24.dp), - horizontalAlignment = Alignment.CenterHorizontally - ) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 20.dp), - verticalArrangement = Arrangement.spacedBy(24.dp) - ) { - ProfileBottomSheetHeader( - onDismiss = onDismiss, - titleColor = colors.gray09, - iconColor = colors.gray09 - ) - - ProfileCharacterList( - selectedProfile = internalSelectedProfile, - onProfileClick = { profile -> internalSelectedProfile = profile }, - isDarkMode = isDarkMode - ) - } - - Spacer(modifier = Modifier.height(32.dp)) - - ProfileSelectButton( - onClick = { internalSelectedProfile?.let { onSelectProfile(it) } }, - enabled = internalSelectedProfile != null, - backgroundColor = colors.systemActivate, - textColor = LightGray00 - ) - - Spacer(modifier = Modifier.height(23.dp)) - } + ProfileCharacterBottomSheetContent( + onDismiss = onDismiss, + onSelectProfile = onSelectProfile, + selectedProfile = selectedProfile + ) } }Also applies to: 114-161
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/lyrics/feelin/core/designsystem/component/FeelinProfileCharacterBottomSheet.kt` around lines 68 - 111, The ModalBottomSheet block in ProfileCharacterBottomSheet duplicates the UI/state that should live in ProfileCharacterBottomSheetContent; replace the inline Column/children (ProfileBottomSheetHeader, ProfileCharacterList, ProfileSelectButton and related Spacers) with a single call to ProfileCharacterBottomSheetContent(...) and forward the necessary props/state (onDismiss, internalSelectedProfile and its onProfileClick updater, onSelectProfile, isDarkMode, colors and modifier) so internalSelectedProfile is still mutated locally and the enabled/selected behavior is preserved; ensure you remove the duplicated layout and import/use ProfileCharacterBottomSheetContent from its existing declaration so future UI changes remain single-source.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@app/src/main/java/com/lyrics/feelin/core/designsystem/component/FeelinProfileCharacterBottomSheet.kt`:
- Around line 68-111: The ModalBottomSheet block in ProfileCharacterBottomSheet
duplicates the UI/state that should live in ProfileCharacterBottomSheetContent;
replace the inline Column/children (ProfileBottomSheetHeader,
ProfileCharacterList, ProfileSelectButton and related Spacers) with a single
call to ProfileCharacterBottomSheetContent(...) and forward the necessary
props/state (onDismiss, internalSelectedProfile and its onProfileClick updater,
onSelectProfile, isDarkMode, colors and modifier) so internalSelectedProfile is
still mutated locally and the enabled/selected behavior is preserved; ensure you
remove the duplicated layout and import/use ProfileCharacterBottomSheetContent
from its existing declaration so future UI changes remain single-source.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a0195099-0df0-4ea4-8c0b-00afee0daa27
📒 Files selected for processing (1)
app/src/main/java/com/lyrics/feelin/core/designsystem/component/FeelinProfileCharacterBottomSheet.kt
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
퇴근하고 코드 확인해보고, 문제 없으면 바로 병합할게요 |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
What is the current behavior?
The profile character selection items in
ProfileCharacterBottomSheetuse a fixed size (84.dp), which causes layout issues on narrow screens.
Items appear too small inside their circle bounds and don't distribute
evenly across different device widths.
Also,
@Previewdoes not render becauseModalBottomSheetis notsupported in the Compose Preview environment.
What is the new behavior (if this is a feature change)?
.size(84.dp)with.aspectRatio(1f)so itemsproperly use the width given by
weight(1f)and stay squareon any screen size.
and padding.
ProfileCharacterBottomSheetContentso previews render correctly without
ModalBottomSheet.Does this PR introduce a breaking change?
No.
ScreenShots (If needed)
Summary by CodeRabbit