fix(app): render materialized split children like continuous features [MRXNM-82] - #1775
Merged
agnlez merged 1 commit intoJul 28, 2026
Merged
Conversation
… [MRXNM-82]
Split children were deliberately kept out of the gradient renderer
(useContinuousFeaturesLayers) because their synthetic row ids had no
tiles or amounts behind them, so they drew as flat solid polygons from
raw geometry while every other (non-legacy) feature draws as a PU-grid
amount gradient — the "not visualized like other features" report.
Since materialization now computes each child's own per-PU amounts and
the spec reads back the child's real id and amount range, a materialized
child qualifies for the gradient path. Both toggles (table eye, legend)
now route such children through selectedContinuousFeatures, stamping the
child's real feature id into layerSettings so the renderer requests the
child's tiles instead of the synthetic `${parentId}-${value}` id.
Also:
- legend buckets children by their OWN amount range (not the parent's),
so the swatch matches what the map draws — gradient once materialized,
solid square while pending;
- child rows take their own ramp color in the table (matching the
legend) instead of inheriting the parent's, so siblings are
distinguishable on the map;
- solid-path toggles clear stale stamped amountRange (null, not
undefined) so pending children can't get stuck excluded from
useTargetedPreviewLayers.
Children still pending materialization keep the previous fallback:
solid fill from parent tiles with a property filter. A child that
materializes while visible stays on the solid path until re-toggled.
agnlez
deleted the
bugfix/app/mrxnm-82-split-children-continuous-rendering
branch
July 28, 2026 10:38
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.
Client feedback on the split functionality: "the features are not visualized like other features."
Split children of a continuous feature were deliberately kept out of the gradient
renderer (
useContinuousFeaturesLayers), because their synthetic${parentId}-${value}row ids had no tiles or per-PU amounts behind them. Theytherefore drew as flat, fully saturated polygons from raw geometry with a black
outline, while every other feature in a non-legacy project draws as a
planning-unit-grid amount gradient — two different visual languages on the same
map.
Materialization now computes each child's own per-PU amounts, and the scenario
specification reads back the child's real feature id and amount range. That is
everything the gradient renderer needs, so a materialized child now takes exactly
the same path as any other continuous feature.
Jira story
https://vizzuality.atlassian.net/browse/MRXNM-82
What changed
hooks/map/index.ts—useContinuousFeaturesLayersresolves achildFeatureIdfrom layer settings, so gradient tiles are requested with thechild's real feature id instead of the synthetic row id.
target-spf/index.tsx(table eye toggle) — materialized children with theirown amounts route through
selectedContinuousFeatures; child rows also taketheir own ramp colour instead of inheriting the parent's, so siblings are
distinguishable and the table agrees with the legend.
legend/hooks/index.ts— children are bucketed by their own amountrange rather than the parent's, so the legend swatch matches what the map draws
(gradient once materialized, solid square while pending). The legend toggle now
stamps the same settings as the table, ending the "colour depends on which
control you used" divergence.
amountRange(null, notundefined— the reducer dropsundefined) so a pending child can no longerget stuck excluded from
useTargetedPreviewLayers.Children still pending materialization keep the previous fallback: solid fill from
the parent's tiles with a property filter. A child that materializes while already
visible stays on the solid path until re-toggled.
Testing instructions
Verified against the staging API using the client's own data: project
Galapagos test 1 → scenario Baseline check (13 materialized split children).
ordinary continuous feature). Expect a white→orange PU-grid gradient and a
gradient legend bar labelled
0.001–92. Toggle it off.gradient style in a different hue, covering only the units where that habitat
occurs, with a gradient legend bar labelled
9.763–92,000,000— thechild's own range, not the parent's.
preview/tilesand re-toggle a child. Requestsmust go to
/api/v1/projects/{pid}/features/{realChildUuid}/preview/tiles/...and return 200 — not
/geo-features/...?bbox=, and never the synthetic{parentId}-{value}id.two eyes stay in sync.
Not exercised live: the pending (not-yet-materialized) child fallback, since every
child in that scenario is already materialized. That path is unchanged by this PR.
Checklist before submitting
staging(base branch for theMRXNM-82 work stream; branch is current with it).