feat: support multiline patterns in switch rule conditions#288
Open
rz467fzs7d wants to merge 1 commit intozero-peak:masterfrom
Open
feat: support multiline patterns in switch rule conditions#288rz467fzs7d wants to merge 1 commit intozero-peak:masterfrom
rz467fzs7d wants to merge 1 commit intozero-peak:masterfrom
Conversation
Author
What does this PR do?
(Note: Translations and typo fixes should be done on https://hosted.weblate.org/projects/switchyomega/ instead of PR.) Please explain the changes in details here... CompatibilityIs this PR compatible with old versions? Can users simply upgrade the extension? Please describe any possible breaking changes (or surprising UX differences).Screenshots (if applicable)After creating the PR:
|
- HostWildcardCondition, UrlWildcardCondition, HostRegexCondition, UrlRegexCondition now accept newline-separated patterns in addition to pipe-separated ones - Replace pattern input with expandable textarea (1 row collapsed, 10 rows expanded) with toggle button - Single-line mode blocks Enter key and auto-expands on click when multiline content exists - validateCondition validates each line independently for regex types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f0267d4 to
6111824
Compare
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.

Summary
Allow users to enter multiple patterns in a single switch rule condition, separated by newlines (in addition to the existing pipe
|separator).Changes
omega-pac/src/conditions.coffee
HostWildcardCondition,UrlWildcardCondition,HostRegexCondition,UrlRegexConditionnow split patterns by both|and newline\nomega-web/src/partials/profile_switch.jade
inputwith an expandabletextarea(1 row collapsed, 10 rows expanded)omega-web/src/omega/controllers/switch_profile.coffee
isMultiline()helpervalidateConditionvalidates each line independently for regex typesNotes
The pre-existing SOCKS5 test failure (
should return special compatible result for SOCKS5) exists on master and is unrelated to this change.