Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 3a52826 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
🤖 Mapsight review linksPreview for Suggested starting points from the changed files and their demo consumers:
Why these screens?
These are suggested checks, not a verified reproduction of the issue. Current main can move independently of this PR; new behavior may need the PR author's setup steps. Updated after successful deployments. The commit above identifies this preview; a newer build may still be running. |
This branch was successfully deployed
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.
Summary
A layer's
metaData.attributionis rendered as HTML by the chrome. Config has always been treated as trusted input, but for hosts that build layer metadata from text they do not control this is an injection path. In v8,attributionbecomes plain text and markup needs an explicitly named field. This adds the opt-in path for 7.x; the default is unchanged.dangerouslySetAttributionHtml. The chrome always renders it as HTML, with or without the flag, so hosts can migrate first. It takes precedence when a layer sets both fields; an empty string counts as not set.v8_attributionText(Decision 012). When enabled,metaData.attributionis rendered as a plain text node.visibleLayerAttributionPartsSelectorreturning{text?, html?}per visible layer, for the chrome and for host interfaces that render attributions themselves.layerAttributionsSelectorandvisibleLayerAttributionsSelectorare unchanged.metaDataWithAttributionHtml(metaData, html).AttributionEntriesaccepts the new parts and still accepts plain strings, which stay HTML (legends, existing direct callers).Out of scope: legends, feature details and the other HTML fields keep their behaviour.
Migration for hosts: move HTML attributions to
dangerouslySetAttributionHtml, then enablev8_attributionText. Plain-text attributions need no change.Test plan
pnpm --filter @mapsight/core testandpnpm --filter @mapsight/ui test<img src=x onerror=…>string is rendered as text and no element is created; the HTML field in both modes; both fields set; empty HTML field; switching the flag on and removing the HTML field for an existing entry leave no markup behind; server-rendered markup is escaped; plain string entries and legends stay HTMLtypecheckandlintfor both packages (no errors),pnpm run check