Unwrap NewProfileDesign#142
Conversation
683ad0f to
4cf68eb
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the “New Profile” flow to align with the ongoing effort to split Design classes into a @Composable screen + ViewModel (Issue #119), moving business logic and one-shot events out of the Activity/Design loop and into a lifecycle-aware ViewModel.
Changes:
- Introduces
NewProfileViewModelto own provider loading, profile creation, and one-shot UI events (launchers/navigation/snackbar). - Replaces
NewProfileDesignwith a Compose-firstNewProfileScreen+NewProfileContent. - Simplifies
NewProfileActivityto aBaseActivitythat only sets Compose content.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/src/main/kotlin/com/github/kr328/clash/profile/vm/NewProfileViewModel.kt | New ViewModel managing provider discovery, profile creation, and event emission for the New Profile UI. |
| app/src/main/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreen.kt | Converts Design-based UI into Compose screen/content; wires activity result launchers and handles ViewModel event state + snackbar. |
| app/src/main/kotlin/com/github/kr328/clash/profile/NewProfileActivity.kt | Removes DesignActivity coroutine loop; switches to a simple Compose host Activity that finishes via callback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
…leViewModel Agent-Logs-Url: https://github.com/Goooler/MihomoForAndroid/sessions/ae89cf4b-41f9-4d9b-837e-dc15f294bc1d Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Done in 5a7b0c0. All three |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
app/src/main/kotlin/com/github/kr328/clash/profile/ui/NewProfileScreen.kt:111
MihomoScaffoldalready supports asnackbarHostslot; adding a separateBox+SnackbarHostoverlay here duplicates scaffold responsibilities and can cause inconsistent insets/positioning vs other screens. Consider moving theSnackbarHost(hostState = snackbarHostState)intoNewProfileContentby wiring it throughMihomoScaffold(snackbarHost = { ... })and removing the extraBoxwrapper.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refs #119.