← Back to Pull requests

fix(engine): a legend's lists bind every layer of a name they give #3622

Open
unknown opened this pull request with 228 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 02, 2026 18:49 UTC
Author

Summary

A legend's exclude, layerOrder, columnBreaks, labels and classLabels name layers, and the legend applies each name to every layer of the frame's map that has it, in any case. The inputs of layout.addElement and layout.update took only the first of those layers, so an exact approval didn't bind the others.

legend_inputs, which both commands and all five lists go through, now binds every layer of a named name in the frame's map. Map::layer_by_name is unchanged, and so is what a table, chart or colorbar binds, which each read one layer.

Surfaces: the change is in the shared engine, in what layout.addElement and layout.update bind when a plan is approved, so the Assistant, MCP and any other surface that plans these two commands get it, whichever app it runs in. No command, option or tool description changed, and there is nothing to add to the ribbon, shortcuts, command search or any pane. Nothing saved or undone changes.

Testing

  • New tests in crates/engine/src/tests/layout_legend_shared_names.rs: with two layers named Rivers, each of the five lists (and another case of the name) binds both, through both commands; with one, only that layer is bound, a same-named layer in another map isn't, and a call that gives no list binds none. The first test fails without the fix (left: [(2, 4)], right: [(2, 3), (2, 4)]).

  • Local: fmt, clippy, doctests, layers and the schema check pass. The full nextest run: 12302 passed and 8 failed, all outside this diff and failing on this machine without it (7 in rustgis-geolibre and the line_strokes_editor_edits_one_class smoke test, #3411). After a last change to one new test, the 62 layout_legend tests, fmt and clippy of rustgis-engine pass again.
  • UI evidence

    No visible UI change.

    Related issue

    Closes #3288.

    Diff: 228 lines (+171 / -57) across 2 files Reviewer: github-actions[bot] Review duration: 27m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 228 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.325
    Real PR Conversation Timeline
    1 comments
    "Review active on #3622"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.0% (MEDIUM) · Higher = larger blast radius
    37.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%