Julius Volz ded3a8c309
UI: Fix broken Y axis after graph page reload (#17869)
* UI: Fix broken Y axis after graph page reload

The new `y_axis_min` setting was always encoded into the URL, even if its value
was `null` (in which case it would be set to an empty string parameter). On the
decoding side, this wasn't taken into account correctly, and we tried to parse
the empty string as a float, causing completely broken graphs showing nothing
after reloading the graph page with such URL parameters.

I'm doing two things now:

* For the future, only encode the Y axis min into the URL if it's set at all,
  similar as we do for the `end_input` and `moment_input` fields.
* On the decoding side, accommodate people (at least for now) who already saved
  some links with the empty `y_axis_min` parameter by treating an empty string
  as `null` instead of a number.

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Add URL state encoding/decoding tests

Signed-off-by: Julius Volz <julius.volz@gmail.com>

---------

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2026-01-16 09:50:39 +00:00
..