Refactor EditableTextList to use Set - #240
Merged
Merged
Conversation
Goooler
force-pushed
the
use-set-for-edit-list
branch
from
May 14, 2026 06:07
f58d7e4 to
b1d4707
Compare
Goooler
force-pushed
the
use-set-for-edit-list
branch
from
May 14, 2026 06:10
b1d4707 to
67ac139
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the EditableTextList screen to use Set<String> instead of List<String> for its values, to align with the patterns used in EditableTextMapScreen and naturally enforce uniqueness of entries. Callers convert at the boundary via toSet()/toList().
Changes:
- Renamed
EditableTextListScreen/editableTextListScreenEntrytoEditableTextSetScreen/editableTextSetScreenEntryand switched parameter types fromList<String>?toSet<String>?. - Added a duplicate guard in the add dialog (
!values.contains(newValue)) since list semantics would have allowed duplicates. - Updated
OverrideSettingsScreenandMetaFeatureSettingsScreencallers to convert betweenListandSetat the boundary.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/EditableTextSetScreen.kt | Renames screen/entry and changes value collection to Set<String>, adds duplicate guard. |
| ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/OverrideSettingsScreen.kt | Updates caller to use new entry name and converts to/from Set. |
| ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/MetaFeatureSettingsScreen.kt | Updates caller to use new entry name and converts to/from Set. |
Comments suppressed due to low confidence (1)
ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/EditableTextSetScreen.kt:47
- After renaming the screen and entry function to use "Set", the
@SerializableNavKey data class is still namedEditableTextListand its property isinitialValues(not e.g.initialValues: Set). Renaming the class toEditableTextSetwould keep naming consistent with the rest of the file (EditableTextSetScreen,editableTextSetScreenEntry). This is a non-breaking change since the type isinternal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns with https://github.com/Goooler/Tabby/blob/e7567b1d1888c4643a16fbf59cda4e1b64492ff8/ui/settings/src/main/kotlin/com/github/kr328/clash/settings/ui/EditableTextMapScreen.kt.