Skip to content

Cluster-info modal reports the spinner's value, not the strength the map was drawn with #381

Description

@lstein

Found while reviewing #376.

showClusterInfoModal reads the spinner directly:

const eps = parseFloat(document.getElementById("umapEpsSpinner").value);

(photomap/frontend/static/javascript/umap.js, in the cluster-info modal block). Everything else in the modal — cluster count, largest/smallest cluster, unclustered count — is computed from the module-level points array, i.e. from the clustering the map was actually drawn with. The eps is the one field that comes from somewhere else, so it can disagree with the numbers printed beside it.

Reproductions, all with the map drawn at 0.4:

  1. Mid-debounce. Type 0.9 and open the modal inside the one-second window. It reports 0.90; the cluster counts beside it are the 0.4 clustering.
  2. A value the spinner refuses. Type 0.005. Pausing mid-edit no longer discards the Cluster Strength #376 refuses to save it and marks the field, and the map is left alone — the modal reports 0.01, which is neither the field's 0.005 (toFixed(2) rounds it up) nor the map's 0.4.
  3. Half-typed. Type 0. — the field's value is "", so parseFloat gives NaN and the modal reports NaN.

None of these is destructive; the modal is informational. But it is the one place in the UI that claims to say what the map was clustered with, and it is the least reliable reader of that number in the module.

Suggested fix

Have the draw record the eps it was made with — the value fetchUmapData sent, or better the value the server reports back once #380 provides it — and have the modal read that, the same way it already reads points. Then this becomes correct for #380's shrink case too, rather than needing a second fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions