mirror of
https://github.com/maputnik/editor.git
synced 2026-11-27 04:23:45 +00:00
## Description The sprite picker added in #2359 only replaced the input for `icon-image`. Maputnik already treats `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, and `icon-image` as sprite-backed properties through the shared `iconProperties` list. The other four properties still rendered the text-only autocomplete, so their dropdowns could not preview the sprite atlas even though they use the same sprite catalog in the style spec. This change routes every property in `iconProperties` through `InputSprite`. Non-sprite string fields continue to use `InputString`, and free-form values, search, keyboard selection, and expression editing keep the behavior introduced in #2359. Having one special case for `icon-image` and another branch for the remaining sprite properties was redundant and left the UI inconsistent. This is a follow-up to #2359 and completes the sprite-preview behavior related to #1294 for all sprite-backed style properties. ## Visuals No new visual treatment is introduced. Before this change, the four pattern fields displayed the text-only autocomplete; after this change they display the same thumbnail/search/keyboard picker already shown for `icon-image` in #2359. ## Verification - Added Playwright coverage for `background-pattern`, `fill-pattern`, `line-pattern`, and `fill-extrusion-pattern`. Each case opens the picker, verifies rendered atlas thumbnails, selects a sprite, and asserts the persisted style value. - `npm run lint` - `npm run build` - `npm run test-unit -- --run` (55 tests passed) - `npm run test -- e2e/sprite-picker.spec.ts --workers=1` (19 tests passed) - Confirmed the new assertion fails when the expected option count is deliberately mutated, then restored the assertion. - Local `.npmrc` changes were not included in the commit. ## Launch Checklist - [x] Briefly describe the changes in this PR. - [x] Link to related issues. - [x] Include before/after visuals or gifs if this PR includes visual changes. - [x] Write tests for all new functionality. - [x] Add an entry to `CHANGELOG.md` under the `## main` section. Co-authored-by: FantasticSPM <asd507172@gmail.com>