feat: compound watchlist criteria (AND/OR conditions)#487
Merged
Conversation
A watch entry can now carry extra conditions beyond its primary match — e.g. 'C1 system that leads to Null-sec'. Each editable entry gets an 'Add criteria' button; every criterion is Contains (wormhole type) or Leads to (class), plus a per-entry Match all / Match any (AND/OR) selector. - types: WatchEntry gains optional criteria: WatchMatch[] + criteriaMode. - watchMatch: the full [match, ...criteria] set is combined by mode. One shared predicate per condition drives both system and connection matching, so a node-only criterion (leadsTo) simply reads false on an edge — meaning compound entries light up connections only in OR mode. All four matcher consumers are unchanged (same signatures). - useWatchlist: coerce round-trips criteria + criteriaMode (per-user nexum.watchlist JSONB; no server change). - WatchlistBlock: criteria rows + AND/OR selector on the editable entries only (quick-add characteristic chips stay simple); dedupe key folds in criteria so 'class C1' and 'class C1 + leads to NS' aren't twins. - i18n across all 9 locales; new CSS for the criteria block.
In the narrow watchlist column the 'Contains'/wh-type picker button rendered 'Q003 -> Null-Sec' and clipped to 'Q003 -> 1...'. Added a codeOnly prop that drops the destination badge from the button (the dropdown still shows it), used for both watchlist wh-type pickers.
…bines criteria) Match any was OR-ing the primary match too, so 'C3, leads-to C2 OR contains K162' flagged non-C3 systems. The primary match is now always required (the base filter); the AND/OR mode combines only the extra criteria. So it correctly means a C3 that ALSO leads to C2 or contains a K162.
The top-row controls wrapped as a flat flex, so on a narrow panel the delete button dropped onto its own line. Moved the marker / match-type controls into an inner wrapping group and pinned the delete button beside it (top-right), so it stays on the first line and the controls wrap under it instead.
Pinning the delete to the top row just pushed the locate button onto its own line instead. Per the suggestion, the entry delete is now a full-width 'Remove from watchlist' button along the bottom of the entry, so nothing in the top row has to make room for it. Criterion delete buttons are unchanged.
Restyled the leads-to value control from a plain native <select> to a ClassPicker that matches the connection leads-to dropdown look — a coloured class label on the button and a grouped J-Space / K-Space popover of colour-coded classes. Content is unchanged: still the individual classes (C1, C2, … Null-Sec), not bands. New ClassPicker component reuses the .wh-picker styling. Used for both the primary 'Leads to' match and 'Leads to' criteria.
… controls The criteria block had a 26px left padding that offset the Match all/any selector and the criterion rows from the primary match controls above. Removed it so everything left-aligns and fills the same width.
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.
Extends the watchlist so one entry can require multiple conditions — the ask being "a C1 system that also leads to Null-sec", not just any C1.
What you get
On the editable entries (Specific system / Wormhole type / System type / Leads to), a new Add criteria button. Each criterion is a 2-option dropdown:
plus a per-entry Match all / Match any (AND / OR) selector so you decide how the primary match and the criteria combine.
Example: primary System type = C1, criterion Leads to = NS, mode Match all → only C1 systems that lead to null-sec light up.
How it works
WatchEntrygains optionalcriteria: WatchMatch[]+criteriaMode('and' | 'or', defaultand). Absent = a plain single-condition entry (fully backward compatible).[match, ...criteria]set by the mode. There's one shared per-condition predicate for systems and one for connections, so a node-only condition (leads-to) is simplyfalseon a bare edge — which means a compound entry glows connections only in Match any mode, never in Match all (a node condition can't hold on an edge). The four matcher consumers (node glow, edge glow, alerts, the editor's own matched-list) are untouched — same function signatures.nexum.watchlistJSONB viacoerce(no server change).tsc + build + lint (0 errors) + i18n parity (all 9 locales) pass locally. (No web unit-test harness exists; verified via build.)