Follow-up to the review on #2403.
New unit test `src/locales/translations.test.ts` runs the i18next-cli
extractor (the code behind `npm run i18n:extract`) without writing
anything. It fails if any locale is missing a key used in the code, or
still has the `__STRING_NOT_TRANSLATED__` placeholder. It's part of `npm
run test-unit`, so the existing unit test job in CI runs it and no
workflow change is needed. On failure it lists each missing `locale:
key`.
On `main` the test fails with 8 keys missing in all 10 locales. They
came from #2395, #2397 and #2405. This PR adds translations for them:
- `{{label}} row {{row}} anchor` / `X offset` / `Y offset`
- `Generate feature IDs`, `Feature ID property`, `Feature ID properties
by source layer`, `Enter a JSON object mapping source layer names to
property names.`
- `Use current map view`
The translators listed in `src/locales/README.md` may want to check the
wording. I matched the terms each locale already uses (for example
"Source Layer", "Map view").
The AGENTS.md Translations section now mentions the test.
**Performance:** no runtime impact. It only adds JSON entries and a unit
test, which takes about 2 seconds.
## Launch Checklist
- [x] Briefly describe the changes in this PR.
- [x] Link to related issues: follow-up to #2403.
- [x] Include before/after visuals or gifs if this PR includes visual
changes. (No visual change in English. The other locales show the new
strings instead of the English fallback.)
- [x] Write tests for all new functionality: `translations` in
`src/locales/translations.test.ts`. It fails on `main` with the 8
missing keys.
- [x] Add an entry to `CHANGELOG.md` under the `## main` section.
Tested locally: `npm run lint` clean, `npm run build` clean, `npx vitest
run` (60 passed), `npm run test-unit-ci` passed, and `npx i18next-cli
extract --ci --dry-run` reports no changes. Before adding the
translations, the new test failed with the 80 missing `locale: key`
entries.
Assisted-By: Claude Opus 5.5 (Claude Code). It helped write the test,
the translations and this description. I've reviewed and tested the
change and can answer questions about it.
Fixes#292.
`line-gradient` only renders when the line's GeoJSON source has
`"lineMetrics": true`, and Maputnik had no way to set that. Nothing in
`src` set or showed `lineMetrics`, so a gradient could only be made to
work by editing the source in the code editor. GeoJSON sources (both the
URL and the inline JSON kind) now have a "Line metrics" checkbox in the
Data Sources modal.
The `line-gradient` property itself already works: it shows up under the
line layer's paint properties and is edited in the expression editor
with `["line-progress"]`. I checked that with a style using an
`interpolate` over `line-progress`. So the checkbox was the missing
piece.
**Before / after** (Data Sources → Add New Source → GeoJSON (URL)):
| Before | After |
|---|---|
| <img
src="https://raw.githubusercontent.com/KhadeerBasha1232/maputnik/pr-assets/pr-292/before-geojson-source.png"
width="400"> | <img
src="https://raw.githubusercontent.com/KhadeerBasha1232/maputnik/pr-assets/pr-292/after-geojson-source.png"
width="400"> |
**Performance:** no impact on Maputnik itself. `lineMetrics` only
changes how MapLibre tiles that GeoJSON source when someone turns it on,
and that cost is the reason it's off by default in the spec.
## Launch Checklist
- [x] Briefly describe the changes in this PR.
- [x] Link to related issues: fixes#292.
- [x] Include before/after visuals or gifs if this PR includes visual
changes.
- [x] Write tests for all new functionality: `enable line metrics for a
GeoJSON source` in `modals.spec.ts` (with an `enableLineMetrics` action
in the modal driver). It fails on `main`.
- [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` suite (221
passed). The new test fails when I put back `main`'s
`ModalSourcesTypeEditor.tsx`.
Assisted-By: Claude Opus 5.5 (Claude Code). It helped write the change,
the test and this description. I've reviewed and tested the change and
can answer questions about it.
Follow-up to #2393. In each `text-variable-anchor-offset` row, the
anchor dropdown and both offset fields shared the property name as their
accessible label, so a screen reader announced the same name for every
control in every row. Each control's label now adds its row and what it
edits to the property label, for example "… row 2 X offset".
The labels go through `t()` like the other strings in the component. I
didn't add them to `src/locales/*`; they fall back to English until
translated.
There's no visual change; only the `aria-label` attributes differ.
**Performance:** none. Only the label strings change.
## Launch Checklist
- [x] Briefly describe the changes in this PR.
- [x] Link to related issues: follow-up to #2393.
- [x] Include before/after visuals or gifs if this PR includes visual
changes: no visual change.
- [x] Write tests for all new functionality: an e2e test in
`layers-list.spec.ts` that adds a second row and checks the anchor, X
offset and Y offset labels. It fails on `main`.
- [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 `npx playwright test
e2e/layers-list.spec.ts` (48 passed). The new test fails when I run it
against `main`. I didn't run the full e2e suite locally (it times out on
Windows with several workers); it passes in CI on this PR.
Assisted-By: Claude Opus 5.5 (Claude Code). It helped write the change,
the test and this description. I've reviewed and tested the change and
can answer questions about it.
## Launch Checklist
This PR increases coverage by adding unit tests to lib folde, replace
the skipped end to end placeholder with actual tests and adds more end
to end tests.
This was mostly done by AI (Claude opus 4.8) and I reviewed it and
requested changes where needed.
- [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: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
## Launch Checklist
This PR replaces cypress with playwright.
<img width="1907" height="933" alt="image"
src="https://github.com/user-attachments/assets/b52075b3-eb3b-45dc-93dc-8c5e9cfd35dd"
/>
I hope this will make the end-to-end debugging and fixing easier due to
the async await support of playwright which is missing in cypress.
This is a pure refactoring change.
- [x] Briefly describe the changes in this PR.
- [x] Add an entry to `CHANGELOG.md` under the `## main` section.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file is read by LLM agents when working on the codebase:
https://agentsmd.net/
With this file you don't need to copy paste these instructions in every
prompt.