zetkin / app.zetkin.org

Current-generation ("Gen 3") web interface for the Zetkin Platform.
https://app.dev.zetkin.org
24 stars 54 forks source link

Smart Search: Weird sankey diagram when first filter(s) return zero #2026

Open richardolsson opened 5 months ago

richardolsson commented 5 months ago

Description

For a Smart Search that starts with an empty list, adding filters that (currently) return zero people yield weird sankey diagrams.

Steps to reproduce

  1. Go to Smart Search
  2. Add any filter that returns zero
  3. Add another filter that returns zero

Expected Behaviour

For empty first filters, the diagram should be a dashed "add" arrow. For empty second filters following on an an empty first filter, it should be a dashed "add" arrow coming into a dashed main.

Actual Behaviour

Weird arrows that go nowhere (see screenshots).

Screenshots

Ex 1: Two consecutive zero-returning filters (as described in "Steps to reproduce")

image

Ex 2: Single zero-returning filter

image

Ex 3: Zero-returning filter followed by some-returning filter

image

Proposed solution

Write tests for makeSankeySegments() repeating the cases above and expect the output to be nicer segments.

richardolsson commented 5 months ago

This issue partly overlaps with #1579