Append popup-added conditions to the end of switch rules#332
Open
galaxy-sea wants to merge 1 commit into
Open
Conversation
Add an optional addToBottom parameter to addCondition and pass it from popup condition entry points so rules added from the popup are appended instead of prepended. Preserve the existing default behavior for other callers.
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.
What does this PR do?
This PR updates popup-added switch rules so they are appended to the end of the rule list instead of being inserted at the top.
Switch rules are matched from top to bottom, so newly added broader conditions should not take priority over existing, more specific rules.
Example:
*.gemini.google.com->xxx*.google.com->yyyIf the new rule is inserted at the top,
*.google.comcan shadow the existing*.gemini.google.comrule. Appending popup-added rules to the bottom preserves the priority of existing rules while still adding the new condition.Implementation details:
addToBottomparameter toOptions#addCondition.-addConditionsToBottomoption as the default behavior for callers that do not pass the new parameter.addToBottom = truefrom popup condition entry points:Compatibility
This PR is compatible with old versions. Users can upgrade normally.
There are no data format or migration changes. The only UX behavior change is that conditions added from popup entry points are now appended to the bottom of the switch rule list, preserving existing rule priority. Other callers keep the previous default behavior.
Screenshots (if applicable)
Not applicable.