fix(frontend): drop dead resample trigger/resolutions config

config.ResampleConfig stopped emitting the trigger and resolutions fields,
but MetricPlot still read them. resampleResolutions and resampleMinimum
were therefore always null, which made the array-based resolution branch in
the setScale hook unreachable and the timestep !== resampleMinimum guard
always true. Keep only the policy-based branch and derive the zoom trigger
straight from targetPoints.

configs/config-large.json still carried the removed minimum-points, trigger
and resolutions keys, which DisallowUnknownFields now rejects, so starting
against it aborted. Replace them with the current keys and add a test that
loads the file, so the example configs cannot drift out of the schema
unnoticed again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 12:17:34 +02:00
co-authored by Claude Opus 5
parent a5c1fdf21f
commit 769da61570
4 changed files with 31 additions and 22 deletions
+19
View File
@@ -41,6 +41,25 @@ func TestInitMinimal(t *testing.T) {
}
}
// config-large.json carried the removed resampling keys (minimum-points,
// trigger, resolutions), which DisallowUnknownFields rejects.
func TestInitLarge(t *testing.T) {
fp := "../../configs/config-large.json"
ccconf.Init(fp)
if cfg := ccconf.GetPackageConfig("main"); cfg != nil {
Init(cfg)
} else {
cclog.Abort("Main configuration must be present")
}
if Keys.EnableResampling == nil {
t.Fatal("resampling config missing")
}
if Keys.EnableResampling.DefaultAlgo != "average" {
t.Errorf("wrong default algo\ngot: %s \nwant: average", Keys.EnableResampling.DefaultAlgo)
}
}
func TestTargetPointsForPolicy(t *testing.T) {
tests := []struct {
policy string