feat(website/matchers): add @format annotations to Location matcher#84
Merged
Conversation
Wire up @Format map on Map.coordinates so the Studio renders MapField (the widget already exists at schema-form.tsx). Also tag the Location interface with @Format location so a future Studio widget can render city/regionCode/country as a single friendly picker. No runtime behavior change; existing lat,lng,radius string values are preserved.
viktormarinho
approved these changes
Jul 1, 2026
|
🎉 This PR is included in version 5.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
3 tasks
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
@format maptoMap.coordinatesinwebsite/matchers/location.tsso the Studio's existingMapFieldwidget renders instead of a plain text input. The underlying string format (lat,lng,radius) is unchanged.@format locationon theLocationinterface itself (not per prop) so a future Studio widget can rendercity/regionCode/countryas a cohesive picker rather than three loose text inputs.No runtime change — matcher logic and expected data shapes are untouched. Existing configured values keep working.
Context
Today the location matcher exposes three fields (
city,regionCode,country) that the admin has to fill by hand:country: ISO 3166-1 alpha-2 (BR,US, ...) — known finite list from Cloudflare'scf-ipcountry.regionCode: subdivision suffix fromcf-region-code(e.g.SPforBR-SP).city: free-text city name fromcf-ipcity— encoding-sensitive, matched by string equality.Free text inputs make it easy to typo values that will silently never match. This PR annotates the type so the Studio can render a purpose-built widget when one lands.
Widget rendering in the Studio is dispatched by
schema.formatinapps/mesh/src/web/components/sections-editor/schema-form.tsx— a follow-up PR on the Studio side will add thelocationcase.Test plan
Map.coordinatesstill acceptlat,lng,radiusstrings unchanged.Locationvalues (city/regionCode/country) round-trip through the CMS admin.MapFieldrenders onMap.coordinatesin the Studio admin.Locationfield falls back to default rendering until the Studio-side widget lands (no visible regression yet).🤖 Generated with Claude Code
Summary by cubic
Add @Format map to Map.coordinates so the Studio renders the MapField widget instead of a text input, keeping the "lat,lng,radius" string format. Tag the Location interface with @Format location to enable a future unified picker for city/regionCode/country; no runtime changes.
Written for commit ff2b6cc. Summary will update on new commits.