Skip to content

Unwrap NewProfileDesign#142

Merged
Goooler merged 5 commits into
trunkfrom
unwrap-new-profile-design
Apr 26, 2026
Merged

Unwrap NewProfileDesign#142
Goooler merged 5 commits into
trunkfrom
unwrap-new-profile-design

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented Apr 26, 2026

Refs #119.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 NewProfileViewModel to own provider loading, profile creation, and one-shot UI events (launchers/navigation/snackbar).
  • Replaces NewProfileDesign with a Compose-first NewProfileScreen + NewProfileContent.
  • Simplifies NewProfileActivity to a BaseActivity that 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.

@Goooler
Copy link
Copy Markdown
Owner Author

Goooler commented Apr 26, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Apr 26, 2026

@copilot apply changes based on the comments in this thread

Done in 5a7b0c0. All three e.message ?: "" occurrences (lines 64, 84, and 109) have been replaced with e.message ?: application.getString(R.string.unknown) so the snackbar always shows a non-empty message when an exception has no message.

@Goooler Goooler requested a review from Copilot April 26, 2026 07:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

  • MihomoScaffold already supports a snackbarHost slot; adding a separate Box + SnackbarHost overlay here duplicates scaffold responsibilities and can cause inconsistent insets/positioning vs other screens. Consider moving the SnackbarHost(hostState = snackbarHostState) into NewProfileContent by wiring it through MihomoScaffold(snackbarHost = { ... }) and removing the extra Box wrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Goooler Goooler enabled auto-merge (squash) April 26, 2026 07:36
@Goooler Goooler merged commit 5c63d28 into trunk Apr 26, 2026
3 checks passed
@Goooler Goooler deleted the unwrap-new-profile-design branch April 26, 2026 07:39
@Goooler Goooler review requested due to automatic review settings April 26, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants