Repository navigation
Conversation
- Gave every parameterised expression a value widget in `getWidgetKind`, so two-parameter expressions without pairs and free-text ones are editable - Made `MultiValueCriteriaModal` pick pairs or a single listed parameter from its list, and otherwise show one select (listed) or text input (unlisted) per parameter - Labelled the inputs with the new `ParameterName` and `SecondParameterName`
This branch has not been deployed
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.
Why
The filter editor only gave a condition a value picker when the server listed values for it, or when its parameter was a number. Everything else became a True/False condition:
The server's filter expression help now sends one list per parameter: either
PossibleParameters/PossibleSecondParametersorPossibleParameterPairs, never both, withParameterName/SecondParameterNameto label the inputs. This PR builds the editor on that, and supersedes the parameter editing of #1482.Where this sits
feat/filter-parameter-inputs, one commit onmaster. Independent of the other open PRs.What
One rule: a list from the server means you pick from it, never type; free text only when the server sends no list for that parameter.
getWidgetKind): pairs or a second parameter make it a two-value condition, any parameter a one-value condition. Only parameterless expressions stay True/False. Saved conditions with free-text parameters now load and save with their values.MultiValueCriteriaModalpicks in one of two ways:Source: Genrefor pairs).Number) when it is not, with an Add button (andEnter). For example, "AniDB Character ID" is typed and "Appearance" is picked.:is never split wrongly. Duplicates and empty values cannot be added.FilterExpressiongainedParameterNameandSecondParameterName.Look first at:
src/components/Collection/Filter/MultiValueCriteriaModal.tsx(ParameterInputand the list or inputs branch), thengetWidgetKindinsrc/core/utilities/filterTree.ts.Feedback wanted
<select>; only the per-parameter form uses selects. Is that split right, or should a single list become a select too?Testing
pnpm lint,pnpm tscheck,pnpm test(199 passed;filterTree.test.tsgained cases for free-text parameters and two-parameter expressions without pairs) andpnpm buildall pass. No dependency changes.