Skip to content

feat(website/matchers): add @format location to Location interface#1630

Merged
guitavano merged 1 commit into
mainfrom
guitavano/location-matcher-format
Jul 1, 2026
Merged

feat(website/matchers): add @format location to Location interface#1630
guitavano merged 1 commit into
mainfrom
guitavano/location-matcher-format

Conversation

@guitavano

@guitavano guitavano commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add @format location on the Location interface in website/matchers/location.ts (annotation on the interface itself, not per prop) so the Studio can render a purpose-built widget for city / regionCode / country.
  • Map.coordinates already uses MapWidget (which encodes @format map), so no change needed there.

No runtime change — matcher logic and expected data shapes are untouched. Existing configured values keep working; falls back to default rendering until a Studio-side widget for location lands.

Context

The Location matcher targets users by three free-text fields:

  • country: ISO 3166-1 alpha-2 (BR, US, ...) — known finite list from cf-ipcountry.
  • regionCode: subdivision suffix from cf-region-code (e.g. SP for BR-SP).
  • city: raw city name from cf-ipcity — encoding-sensitive, matched by string equality.

Free-text inputs make it easy to typo values that silently never match. This annotation gives the Studio a hook to render a cohesive picker.

Mirrors the equivalent change on the successor package: decocms/apps-start#84.

Test plan

  • Existing Location values (city / regionCode / country) round-trip through the CMS admin.
  • Location matcher continues to evaluate the same way at runtime for existing configured entries.
  • Location field falls back to default rendering until the Studio-side widget lands (no visible regression yet).

🤖 Generated with Claude Code


Summary by cubic

Adds @format location to the Location interface in website/matchers/location.ts so Studio can render a single location widget for city, regionCode, and country. No runtime changes; existing matcher behavior and saved values remain valid, and the field falls back to default rendering until the Studio widget is available.

Written for commit 4a07baa. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation
    • Added a small code comment annotation for location-related typing.
    • No user-facing behavior, settings, or interface changes.

Tag the Location interface with @Format location so the Studio can render
a purpose-built widget for city/regionCode/country instead of three free
text inputs (which are easy to typo silently).

No runtime change — matcher logic and expected data shapes are untouched.
Existing configured values keep working; falls back to default rendering
until a Studio-side widget for `location` lands.

Mirrors the equivalent change on decocms/apps-start #84.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.158.12 update
  • 🎉 for Minor 0.159.0 update
  • 🚀 for Major 1.0.0 update

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a80d9086-6cc9-461f-8a18-6dfb33b7e518

📥 Commits

Reviewing files that changed from the base of the PR and between 120b444 and 4a07baa.

📒 Files selected for processing (1)
  • website/matchers/location.ts

📝 Walkthrough

Walkthrough

Added a JSDoc comment block with @format location tag before the Location interface in website/matchers/location.ts. No logic or exported/public API signatures were altered.

Changes

Location interface annotation

Layer / File(s) Summary
Add JSDoc metadata annotation
website/matchers/location.ts
Inserted a JSDoc comment block containing @format location immediately before the Location interface declaration.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Related Issues: None mentioned in the provided context.

Related PRs: None mentioned in the provided context.

Suggested labels: documentation

Suggested reviewers: None identified from the provided context.

🐰 A tiny JSDoc, quiet and neat,
Tags the Location, ever so sweet,
No logic bent, no code askew,
Just format hints for interfaces new.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is relevant, but it does not follow the required template and omits the issue, Loom video, and demonstration link sections. Reformat the description to use the required headings and add the Issue Link, Loom Video, and Demonstration Link sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding @format location to the Location interface.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch guitavano/location-matcher-format

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@guitavano
guitavano merged commit 66d1232 into main Jul 1, 2026
8 checks passed
@guitavano
guitavano deleted the guitavano/location-matcher-format branch July 1, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant