Skip to content

feat(map): reserve the add and correct atlas view segments - #197

Merged
Ardnived merged 1 commit into
mainfrom
claude/feat-147-reserve-add-correct
Oct 24, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/feat-147-reserve-add-correct

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • /map/* now treats add and correct as atlas view segments, not region slugs.
  • Without this, a deep link to the widget's new panels loses its server-rendered content and SEO head.

Change outline

Reserved route segments (lib/atlas-route.ts)

RESERVED_SEGMENTS gains add and correct, matching the widget's RESERVED_SLUGS on sydevs/SahajAtlasWeb#147 and SahajCloud's resolver. The docblock names both views with an example each:

  • /map/add → the atlas root; /map/<region…>/add (add-a-class panel) → that region.
  • /map/<region…>/<eventId>/correct (suggest-a-correction panel) → that event.

Before this, parseAtlasRoute('/add') read add as a region slug, so getAtlasSeo asked upstream for a region that does not exist, got a 404, and the page rendered with seo: null (no server-rendered content, no canonical or page metadata). It never 500s or 404s — pages/map/+data.ts degrades by design.

Specs (lib/atlas-route.test.ts)

  • /gb/london/add, /gb/london/1204/correct, /gb/london/CORRECT drop the view segment; bare /add and /correct resolve to the root.
  • matchMapRoute passes /map/nl/amsterdam/add and /map/nl/amsterdam/1204/correct through unchanged.

Contract impact

This is the atlas URL contract: the reserved-word set must match in three places. Widget: sydevs/SahajAtlasWeb#147 (branch claude/feat-147-submit-a-class). Endpoint: sydevs/SahajCloud#1028, the producer — merge it first, then this PR. Until SahajCloud#1028 deploys, /map/<region>/1204/correct still asks upstream with the spelling it was given and SahajCloud would read correct as a slug; bare /map/add already works because the root is collapsed to / before the call.

Test results

  • Lean gate (.claude/skills/pr-prep/check.sh): ✓ lint (0 errors), types, vitest 88 files / 890 tests
  • Targeted spec: lib/atlas-route.test.ts 56 passed
  • Red check: with add/correct removed from the set, 5 cases fail
  • Build: N/A (CI)

Part of sydevs/SahajAtlasWeb#147

🤖 Generated with Claude Code

The atlas widget's add-a-class (`/add`, `/<region…>/add`) and
suggest-a-correction (`/<region…>/<eventId>/correct`) panels are new routed
views (sydevs/SahajAtlasWeb#147). Without them in RESERVED_SEGMENTS, a
server-rendered /map deep link to either panel reads the view word as a
region slug and renders a not-found page with no SEO head.

Part of sydevs/SahajAtlasWeb#147

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying wemeditate-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2df802c
Status: ✅  Deploy successful!
Preview URL: https://92029784.wm-design.pages.dev
Branch Preview URL: https://claude-feat-147-reserve-add.wm-design.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
wemeditate-web 2df802c Commit Preview URL

Branch Preview URL
Oct 24 2026, 05:14 PM

@Ardnived
Ardnived marked this pull request as ready for review October 24, 2026 17:16
@Ardnived
Ardnived merged commit f496030 into main Oct 24, 2026
12 checks passed
@Ardnived
Ardnived deleted the claude/feat-147-reserve-add-correct branch October 24, 2026 17:17
@sydevs-bot

Copy link
Copy Markdown
Contributor

I could not request a reviewer here, so this is the step left for you.

  • request a reviewer — GitHub said: Review cannot be requested from pull request author. - https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request

🤖 sydevs dispatcher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants