[WOOMOB-3761] Add Store design system segment control and modal sheet - #16373
hichamboushaba merged 11 commits into
Conversation
Generated by 🚫 Danger |
|
|
There was a problem hiding this comment.
AI Code Review - Found 1 potential issue
This is a clean design-system migration: the scheduled-import bottom sheet moves off a WCBottomSheetDialogFragment onto the new WooModalBottomSheet, and WooSegmentControl / WooModalBottomSheet are promoted to production APIs. A few things I verified positively:
- The removed
ScheduledImportInfoBottomSheetFragment, its nav-graph<dialog>entry, and theaction_dashboard_to_scheduledImportInfoBottomSheetaction are fully cleaned up — no dangling references remain in the codebase. - The ViewModel's move from nav-args to a hosted
show()/onDismissed()model correctly persistsisVisible/confirmedIsEnabledinSavedStateHandlewhile keepingisUpdating/hasErrortransient, andensureActive()aftersetEnabled()properly guards against writing state on a dismissed/cancelled update. Restoration and cancellation paths are well covered by the new tests. WooSegmentControlexposes correctselectableGroup/Role.RadioButtonsemantics and a 48dp interaction target, and stays fully controlled (index in, index out).
One minor UX note is inline.
PR housekeeping
- Applied repo
AGENTS.md/CLAUDE.mdguidance: verified store-app MVVM patterns (ScopedViewModel,triggerEvent,StateFlowfor new state) and that no Android framework types leak into the ViewModel.
Automatic review · claude-opus-4-8 · Workflow run
How to reply to a finding
Reply on this review (or inline at the line the finding refers to) with one of:
@claude addressed- I made the change. Bot verifies against the next diff before marking resolved.@claude rejected: <reason>- Will not fix; reason gets quoted on the next review.@claude not-applicable- Finding does not apply (wrong file, already covered elsewhere, etc.).
The bot honours these on the next review pass.
| onOptionSelected: (Boolean) -> Unit, | ||
| onLearnMoreClick: () -> Unit, | ||
| ) { | ||
| if (!state.isVisible) return |
There was a problem hiding this comment.
AI Code Review [nit]
Issue: Visibility is driven purely by removing the composable from composition (if (!state.isVisible) return, with the parent onDismissed() flipping isVisible to false). When the sheet auto-closes after a successful save (SettingUpdated -> onDismissed()), the ModalBottomSheet is dropped from composition immediately, so Material's slide-down exit animation is skipped. The old WCBottomSheetDialogFragment.dismiss() animated on close, so this is a subtle regression on the programmatic-dismiss path (user-initiated swipe/scrim dismissals still animate). Same pattern applies to OrderDateTypeBottomSheet.
Suggestion: If preserving the exit animation matters, drive dismissal through the state the design system already exposes — e.g. scope.launch { sheetState.hide() }.invokeOnCompletion { if (!sheetState.isVisible) onDismissed() } — instead of removing the composable outright. Otherwise it's fine to accept the tradeoff as the standard conditional-composition idiom.
There was a problem hiding this comment.
Fixed in 01c8737c59d. Both Dashboard sheets now animate through WooModalBottomSheetState.hide() and leave composition only after reaching Hidden; I also verified the programmatic dismissal path on a Pixel 8a running API 36.
6edd7ea to
9316e6e
Compare
217d5bd to
62e0338
Compare
|
Hey @hichamboushaba, the diff here is massive - is there a problem with the branch not being updated, or is that expected? |
|
Version |
62e0338 to
e903c9f
Compare
AdamGrzybkowski
left a comment
There was a problem hiding this comment.
Looks good in general, left two comments/suggestions.
One weird thing that needs to be looked at (or at least confirmed it's real) is this weird slow animation that expand the bottom sheet to full screen height in landscape mode.
I've tried on two emulators and got the same result, but a physical devices works fine.
Screen_recording_20260810_125719.mp4
| val dismissOrderDateTypeBottomSheetWithAnimation: () -> Unit = { | ||
| if (!isOrderDateTypeBottomSheetDismissing) { | ||
| isOrderDateTypeBottomSheetDismissing = true | ||
| coroutineScope.launch { | ||
| try { | ||
| orderDateTypeBottomSheetState.hide() | ||
| if (!orderDateTypeBottomSheetState.isVisible) { | ||
| showOrderDateTypeBottomSheet = false | ||
| } | ||
| } finally { | ||
| isOrderDateTypeBottomSheetDismissing = false | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
❓ We will need this logic every time we use the bottom sheet (two places already) - would it make sense to extract that to a helper funciton?
There was a problem hiding this comment.
I had the same question, and thought about adding a helper, but then later I decided to defer that. This logic is also needed for the M3 bottom sheet (https://developer.android.com/develop/ui/compose/components/bottom-sheets#control-sheet-state), our implementation is just a thin wrapper.
I will still think more about it, and reply later.
There was a problem hiding this comment.
I added a helper in 7fdf0db, please let me know what you think.
|
Ready for another round @AdamGrzybkowski |
AdamGrzybkowski
left a comment
There was a problem hiding this comment.
Thanks for the changes! ![]()
1e46b55
into
feature/store-design-system-migration



Description
Fixes WOOMOB-3761
Promotes Segment Control and Modal Bottom Sheet from preview-only Store design-system examples into production
Woo*components, then migrates both Dashboard-owned sheet flows to consume them.WooSegmentControlkeeps caller-owned selection and localization, exposes radio/selectable semantics, preserves the 36dp track and 32dp pill, and provides a 48dp interaction target without clipping large text.WooModalBottomSheetkeeps experimental Material types internal while delegating gestures, scrim, back handling, focus, semantics, system insets, IME behavior, and width to Material. Its Store styling supplies the Surface Bright container, rounded top corners, and drag handle defined by the canonical Figma component.The Performance card now uses these components for revenue segments and order-date selection. The Analytics updates sheet also moves from its legacy
WCBottomSheetDialogFragmentand navigation destination into the Dashboard's design-system composition, keeping the Dashboard visible behind the scrim while Material owns Back, scrim, and swipe dismissal.The scheduled-import feature retains its existing copy, repository calls, Learn more behavior, success/failure handling, and Dashboard analytics. Sheet visibility and the last server-confirmed option survive recreation, while optimistic, loading, and error state remain transient. Manual dismissal cancels in-flight UI work; if the server has already applied a change, the Dashboard's existing repository observer converges to that stored value and reseeds the sheet the next time it opens.
Focused component and ViewModel tests, catalog previews, and design-system documentation are included.
Note
Known dark-theme limitation: The modal sheet currently has limited contrast against the surrounding surface. We will address this in a separate PR once Design provides the intended treatment. p1786013954706019/1785758642.339779-slack-C03L1NF1EA3
Test Steps
Images/gif
Segment Control
Modal Bottom Sheet
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.