Follow-up to #2391. The earlier change added a numeric list for one to
four values. `FieldFunction` still sends every `padding` value to that
list, including expressions made by **Convert to expression**.
Recognize expression arrays before sending padding values to the number
inputs. Numeric arrays and legacy scalar values still use the regular
padding editor.
Added a Playwright regression check that converts a saved padding value
to a literal expression and verifies that the expression editor opens.
The existing numeric padding tests also pass.
`text-variable-anchor-offset` is the only layer property whose spec
type, `variableAnchorOffsetCollection`, had no input. `InputSpec` fell
through to its `default` case, so the layer editor showed the label with
nothing next to it, even when the layer had a value. It also logged `No
proper field input for text-variable-anchor-offset` on every render
(mentioned in #1524). HarelM suggested looking for spec properties that
maputnik doesn't support yet in #2391, and this is the one I found for
layers.
The value is a flat list of anchors, each followed by its `[x, y]`
offset, e.g. `["top", [0, 4], "left", [3, 0]]`. The new
`InputVariableAnchorOffsetCollection` shows one row per anchor: an
anchor dropdown (the same nine values as `text-variable-anchor`), then
the x and y offsets. It reuses the add/remove row layout and the delete
button from `InputDynamicArray`. "Add value" appends `center` with `[0,
0]`, and removing the last row unsets the property.
`FieldFunction` used to route every value of this type to the plain
input, including expressions. It now does that only for a literal list
(`isVariableAnchorOffsetCollection` in `spec-helper.ts`). An expression,
including the `["literal", ...]` that "Convert to expression" produces,
opens the expression editor as it does for other properties.
| Before | After |
|---|---|
|

|

|
Both show a symbol layer with `"text-variable-anchor-offset": ["top",
[0, 1], "left", [2, 0]]` in Chromium.
**Performance:** none. The input only renders for this one property, and
the type check is a single pass over a short array.
## Launch Checklist
- [x] Briefly describe the changes in this PR.
- [x] Link to related issues: #1524 (the console warning), follow-up to
#2391.
- [x] Include before/after visuals or gifs if this PR includes visual
changes.
- [x] Write tests for all new functionality: three e2e tests in
`layers-list.spec.ts` (save an anchor with its offset, change the
anchor, remove a row) and a unit test for
`isVariableAnchorOffsetCollection`. All three e2e tests fail on `main`,
and the anchor and remove tests fail when I change the expected anchor
or skip the delete.
- [x] Add an entry to `CHANGELOG.md` under the `## main` section.
Tested locally: `npm run lint` clean, `npx tsc --noEmit` clean, `npx
vitest run` (57 passed), and the full `npx playwright test` (213
passed). I also checked it in the dev server: editing an offset,
changing an anchor, adding and removing rows all save to the style, and
a layer whose value is a `case` expression opens in the expression
editor.
Assisted-By: Claude Opus 5.5 (Claude Code). It helped write the change,
the tests and this description. I've reviewed and tested the change and
can answer questions about it.
## Launch Checklist
<!-- Thanks for the PR! Feel free to add or remove items from the
checklist. -->
When a fixed paint value is converted to a zoom function, Maputnik
creates exactly two stops.
<img width="362" height="226" alt="image"
src="https://github.com/user-attachments/assets/209aebbf-7bb3-4422-b0c7-1019e20a9ddb"
/>
Deleting either one of those two stops leaves a single remaining value.
During the transition back to the ordinary field editor, `ZoomProperty`
can render with `stops` undefined. It previously called `.map`
unconditionally, causing the editor to crash.
<img width="2551" height="1248" alt="image"
src="https://github.com/user-attachments/assets/f5c2af59-dcae-4ffe-8245-f175eea9c843"
/>
This PR guards the stop list with optional chaining. The change only
protects the render path and does not alter zoom-function conversion or
value persistence.
Now, the remaining stop's value will be restored after deleting the
other stop:
<img width="367" height="168" alt="image"
src="https://github.com/user-attachments/assets/8d13236b-6140-451b-8613-0bc5f11893de"
/>
The regression test covers `circle-opacity`:
1. Convert a fixed value to a zoom function.
2. Change the second stop's value.
3. Delete the first of the two stops.
4. Verify that the ordinary field editor reappears.
5. Verify that the remaining stop's value is restored.
6. Edit the restored field and verify that the style updates
successfully.
- [x] Briefly describe the changes in this PR.
- [ ] 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.
## Launch Checklist
See title,
Also removed some "_" from some file names.
This is a pure refactoring, no logic changes.
- [x] Briefly describe the changes in this PR.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
## Launch Checklist
This PR adds back the error panel which was under the map for some
reason.
It also highlights problematic layers in the layers list (which already
worked).
It also highlights the field that has an error related to it.
It fixes the error types throughout the code.
Before:
<img width="1141" height="665" alt="image"
src="https://github.com/user-attachments/assets/c0593d6c-8f14-41b3-8a51-bc359446656d"
/>
After:
<img width="1141" height="665" alt="image"
src="https://github.com/user-attachments/assets/1ffeebb7-31ea-4ed5-97f4-fc5f907a6aea"
/>
- [x] Briefly describe the changes in this PR.
- [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: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Keeps the repo clean, same as several other of our repos
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This is a rough start on adding react-i18next. I'll be working on adding
more translatable strings and translations in the coming days. I'm going
to need to wrap class components in HOCs, so let me know if there's
something I should be fixing before doing that. I'm thinking now to keep
the exported class names exactly the same, and rename the existing
classes by prefixing an `I` (for internal). For example:
```
export default class AppToolbar ...
```
becomes
```
class IAppToolbar ...
const AppToolbar = withTranslation()(IAppToolbar);
export default AppToolbar;
```
I'll be able to contribute Japanese strings (I've talked to a couple
people on my team and they'll be happy to help as well), so that's the
language I decided to go with in this PR.
Closes#746
---------
Co-authored-by: Ko Nagase <nagase@georepublic.co.jp>
Co-authored-by: Harel M <harel.mazor@gmail.com>
Recover commented out tests,
Improve usage of helper in driver,
Added data-wd-key for test to use instead of classes
Moved all non tsx file to a single folder (lib) instead of lib and utils
---------
Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
Adds lint to CI and fixes errors.
I'm not sure I'm fully proud of all the solutions there.
But there's no lint issues and the lint is being checked as part of the
CI.
---------
Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>