Rewrite MetaFeatureSettingsDesign#95
Conversation
There was a problem hiding this comment.
Pull request overview
This PR rewrites the Meta Feature settings UI to Jetpack Compose (refs #65) and removes the legacy view/data-binding based preference UI infrastructure that previously powered this screen.
Changes:
- Replaced
MetaFeatureSettingsDesignUI implementation (and its XML layout) with a Compose-based screen. - Extracted reusable Compose “settings preference” components/dialogs into
design.component.SettingsPreference. - Removed the old
design.preferenceAPIs and related adapters/overlays that are no longer used.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| design/src/main/res/layout/design_settings_meta_feature.xml | Removed obsolete data-binding layout for Meta Feature settings. |
| design/src/main/java/com/github/kr328/clash/design/preference/*.kt | Removed legacy view-based preference framework (no longer used after Compose migration). |
| design/src/main/java/com/github/kr328/clash/design/adapter/PopupListAdapter.kt | Removed unused popup adapter from the old preference UI path. |
| design/src/main/java/com/github/kr328/clash/design/adapter/EditableTextListAdapter.kt | Removed unused RecyclerView adapter from the old editable-list UI path. |
| design/src/main/java/com/github/kr328/clash/design/adapter/EditableTextMapAdapter.kt | Removed unused RecyclerView adapter from the old editable-map UI path. |
| design/src/main/java/com/github/kr328/clash/design/component/SettingsPreference.kt | Added shared Compose preference items + dialogs (list pref, editable text list, fullscreen editor, etc.). |
| design/src/main/java/com/github/kr328/clash/design/OverrideSettingsDesign.kt | Refactored to reuse the extracted shared Compose preference components. |
| design/src/main/java/com/github/kr328/clash/design/MetaFeatureSettingsDesign.kt | Rewritten into Compose; adds reset confirmation dialog and preference groups. |
| app/src/main/java/com/github/kr328/clash/MetaFeatureSettingsActivity.kt | Adjusted reset flow to rely on Compose confirmation before sending reset request. |
| app/src/main/AndroidManifest.xml | Updated activity declarations for Override/MetaFeature settings activities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f409925 to
7cedd5c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| item(key = "sniffHttpPorts", contentType = "EditTextListPreference") { | ||
| val enabled = configuration.sniffer.enable != false | ||
| SettingsEditTextListPreferenceItem( | ||
| title = R.string.sniff_http_ports, | ||
| placeholder = R.string.dont_modify, | ||
| state = | ||
| rememberWriteThroughState(configuration.sniffer.sniff.http.ports) { |
There was a problem hiding this comment.
The enabled flag for sniffer-dependent items is derived from configuration.sniffer.enable (a plain model field) instead of Compose state. Toggling the "strategy" preference may not trigger recomposition for the other items, so they can remain enabled/disabled incorrectly. Hoist a MutableState for sniffer.enable (like dnsEnableState in OverrideSettingsDesign) and derive enabled from that state value, then pass it into the dependent items so they recompose when the toggle changes.
There was a problem hiding this comment.
May fix it in the follow-ups.
Refs #65.