Skip to content

Rewrite MetaFeatureSettingsDesign#95

Merged
Goooler merged 1 commit into
trunkfrom
rewrite-meta-feature-design
Apr 21, 2026
Merged

Rewrite MetaFeatureSettingsDesign#95
Goooler merged 1 commit into
trunkfrom
rewrite-meta-feature-design

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented Apr 21, 2026

Refs #65.

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

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 MetaFeatureSettingsDesign UI 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.preference APIs 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.

Comment thread app/src/main/AndroidManifest.xml
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 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.

Comment on lines +199 to +205
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) {
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

May fix it in the follow-ups.

@Goooler Goooler merged commit fb31609 into trunk Apr 21, 2026
5 checks passed
@Goooler Goooler deleted the rewrite-meta-feature-design branch April 21, 2026 12:38
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.

2 participants