Repository navigation
feat(seo): slugs keep native letters, and Unicode atlas routes are encoded exactly once - #341
Conversation
…coded exactly once slugify now follows the recipe shared with SahajCloud and WeMeditateApp (NFC, lowercase, apostrophes dropped, any letter, mark or digit kept), so heading anchors read "café-société" rather than "cafe-societe". Vike hands a route over decoded while SahajCloud's webUrl is encoded, so the /map route is now decoded to one NFC spelling before it reaches the /api/atlas/seo read and the widget's atlas= parameter, and every URL that leaves in HTML or XML (canonical, hreflang, sitemap loc) is percent-encoded by encodeUrl, which is idempotent. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The cross-repo claim checks out: this slugify is character-for-character SahajCloud's slugifyValue on feat/umlaut-slugs, vectors too. The diff is no bigger than the problem: 151 lines deleted for 298 added, most of them tests. Two layering problems remain, both about where the one encode lives.
The gap is content slugs, not atlas routes. SahajCloud#1269 makes every slugField keep native letters, so a page slug becomes über-uns too — yet the Summary covers anchors and /map only. pages/[slug]/+route.ts:38 hands match[1] to the slug query undecoded, and only the atlas got a decode. It all rests on "Vike hands the pathname over decoded" (lib/atlas/route.ts:93), which nothing here pins. Add a Unicode content-route case, or say why the claim holds.
Findings
should-fix—server/sahajcloud/atlas.ts:75: canonicalized twice, and not idempotent on a segment still holding a%escape.should-fix—server/routes/sitemap.xml/sitemap.ts:68: the alternates encode is dead; thelocencode compensates for a producer.consider—lib/urls/urls.ts:186:new URL(url).hrefis idempotent on%XXtoo.consider—lib/urls/slugify.ts:9: thelexical-helpersre-export has one caller.
What was checked
Read whole on the branch: the six changed source files, plus lib/seo/{content-seo,hreflang}.ts and pages/{[slug]/+route,map/+data}.ts. Producer side on SahajCloud feat/umlaut-slugs: slugify.ts, its spec, and atlas-url-contract.json — v2's slugPattern accepts these slugs, and this repo commits no copy.
Every URL emitter traced to localeUrl/absoluteHref. Ran the double-canonicalize in node.
Ladder: 3 pieces, 2 kept. Streamliner: 3 findings, 2 posted — its parseAtlasRoute merge is dropped, since route.ts is a declared port. No ## Preview link, no question threads.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`getAtlasSeo` canonicalized the route its caller had already canonicalized through `matchMapRoute`. The second pass is not a no-op: a segment spelling a literal escape decodes again, so `/bg/%25D1%2581` asked upstream for `с`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
The builder encoded every loc because the content read glued `${origin}/${slug}`
itself, and encoded every alternate for nothing: they already come from
`localeUrl`. The content read now uses `localeUrl` too, the atlas read holds
the spelling for the hand-mirrored upstream field, and the builder respells
nothing.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
`lexical-helpers` re-exported it for importers that no longer exist. Its one caller reads it from `lib/urls/slugify` directly. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
`slugSchema` took ASCII only, and a refusal is `render(404)`, so a page whose slug keeps its native letters had no address at all. The class is now SahajCloud's own `slugPattern`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXVGNzZvoNJyFV5xQP
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 3285ca2 | Commit Preview URL Branch Preview URL |
Nov 25 2026, 07:01 PM |
|
Four threads answered. The review's gap was a 404. Adopted — the double canonicalize, the sitemap's two encodes, the Rebutted —
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
There was a problem hiding this comment.
Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. 🤖 Written by the sydevs autonomous loop — see what this is
#341 moved `slugify` out of `lexical-helpers` into `lib/urls/slugify`, and this branch added `IMAGE_CREDIT_CLASS` to the same import. The list keeps both: the credit class from here, the slug module from main. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWoXwc2UgVbP35ujsy
Both conflicts were import lines where main reached this branch's own conclusion by another route. RichText.tsx: #341 added `import { slugify } from '@/lib/urls/slugify'`, which 6d39ecc had already added higher up. Kept this branch's import block, dropped the duplicate. lexical-helpers.ts: #341 deleted the `slugify` re-export, which 6d39ecc had also deleted. Kept this branch's `Image`/`Page` type import. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW3VocbMjDB2WnN81x
Summary
slugify(heading and tab anchors) now uses the cross-repo recipe and keeps native letters in every script, so#café-sociétéand#über-unsnow match SahajCloud's stored anchors./mapatlas routes with Unicode place slugs are decoded once, sent to SahajCloud encoded once, and every emitted URL (canonical, hreflang, sitemap<loc>) is percent-encoded.[slug]route's own gate accepts those letters too, so a page sluggedüber-unshas an address at all.Change outline
Behaviour —
slugifyGate — a content slug
Flow — a Unicode
/maprouteFlow — a sitemap URL
Preview
The branch alias tracks the branch's latest successful build, so it answers for whichever commit built last.
/maproute — https://feat-native-letter-slugs-wemeditate-web.contact-c66.workers.dev/map/gb/london/sitemap.xmlcannot be reviewed on a preview:isCanonicalOriginrefuses a preview host and the route serves an empty<urlset>there on purpose, so the sitemap half rests onroute.test.ts.Test results
check.sh): ✓ — lint, format,tsc --noEmit, 1793 tests in 173 files.lib/atlas/route.test.ts,embed.test.ts,seo.test.ts,lib/urls/urls.test.ts,sitemap.test.tsandserver/sahajcloud/atlas.test.ts, each run with/bg/софияand/de/trier/universität-trier/1998, raw and encoded.server/validation.test.tsasserts the gate accepts every slugslugifyemits, over seven scripts;pages/[slug]/route.test.tsanddata.test.tscarry/über-unsend to end.Notes for reviewer
#cafe-societebecomes#café-société). The site is unpublished, so no shared links depend on them.?route=encoding against SahajCloud's/api/atlas/seois unverified live, because local atlas reads return 403. SahajCloud'satlasRoute.tsalready decodes each segment.encodeUrlstays areplacerather thannew URL(url).href:lib/atlas/seo.tshands it an upstream canonical, andnew URLthrows on a malformed one and resolves...🤖 Generated with Claude Code