Repository navigation
feat(server): switch wemeditate.com over to the new site - #288
sydevs-bot wants to merge 20 commits into
Conversation
A reader on `/it/about` gets a 404 today whenever that page has no Italian translation, because `getPageBySlug` answers `null` for a locale the document is not published in. Production serves `availableLocales: ["en"]`, so nothing reaches that branch yet; the moment the ten launch locales are set, every untranslated page 404s and every language-dropdown entry on one leads nowhere. The data hook now falls back to the English path instead. It needs no second read: `getPageLocaleStatus` is already in the same `Promise.all`, and `advertisedLocales` already owns the shape guard over its map. 302, not 301: publishing the translation has to change where the URL lands, and a 301 is cached indefinitely. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
The comment claimed the two "cannot disagree about where a locale switch leads". That is true of the spelling and false of which locales each lists: the cluster carries published ∩ offered, the dropdown carries every offered locale. Record the difference and why it is right, and pin the dropdown's side with a test, so nobody closes the gap by filtering the list and hiding the language switch from the readers who need it most. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
`/meditations`, `/live` and `/classes` are the old Rails site's slugs. This site serves the same three pages at `/meditate-now`, `/live-meditations` and `/classes-near-me` (all measured 200 on the preview Worker; all three old paths measured 404). Nothing upstream corrects a hard-coded href, so these are the only rendered literal links in the tree that lead nowhere. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
Both pointed absolutely at `https://wemeditate.com/…` because that domain belonged to the old Rails site, which localized its own slugs. This app serves the domain now, so the `shortcut:` marker at the top of the file is resolved: both are site paths, and `Link` spells each through `localeHref`, so a French reader of an embed reaches `/fr/meditate-now`. `/meditations` also moves to `/meditate-now`, which is the slug this site publishes. `WEMEDITATE_DOMAIN` survives only as the web arm's link text. Both links keep `external`. In this atom that is what opens a new tab, and the only route rendering the upsell is the embed, inside an iframe on someone else's page — a same-tab link would draw this whole site into that frame. The ticket asked for `external` to go; see the PR's question thread. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
Without a site key the widget never renders a token, and SahajCloud requires one on every public write — so every contact and signup submission comes back `captcha_failed`. The key is SahajCloud's own: it holds both halves of exactly one pair and serves this site key on `GET /api/atlas/challenge`, read live to confirm it. Taking that pair rather than provisioning a second one is what guarantees siteverify accepts the token. `wemeditate.com` still has to be added to the widget's hostname allowlist in the Cloudflare dashboard, which is an attended step. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
…ot exist The parenthetical said locale-prefixed paths are "handled by [locale]/[slug]". There is no `pages/[locale]/` directory, and never was: `+onBeforeRoute` strips a known locale into `urlLogical`, so this one matcher serves every locale. Say what the guard actually refuses, and pin the single case it uniquely refuses with a test. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
Shorter comments where the first draft narrated, one helper call where it
restated the helper's body, and one test folded into the case it duplicated.
- `pages/[slug]/+data.ts` redirects through `localeHref`, which *is*
`localePath(locale, normalizeContentPath(path))` and whose doc names this
caller. Verified equivalent for every shape `slugSchema` admits, plus the
routing-only `index`.
- The fallback now skips a live-preview session, for the reason
`server/site-context.ts`'s locale gate does: `getPageLocaleStatus` reports
published status only, and moving an editor to the English URL would end
their session. One gate knowing the rule and one not was the gap.
- The player's `external` rationale moves from the constant 790 lines away to
the block that renders the links, and `/app`'s unmet precondition gets the
`shortcut:` marker the deleted one used to carry.
- `data.test.ts`'s live-preview fixture said `enabled`, a key
`LivePreviewSession` does not carry. It is `{ active, scope, token }`.
- `.env.production` drops what `.env.example` already says.
Refs #280
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
Two claims the branch makes stale. The deployment section named only the design Worker's custom domain, which read as if the web Worker had none. And the hreflang bullet said a URL advertises only the locales its document is published in, without saying what the other locales do now — which is the one place prose can hold the coupling between the cluster, the dropdown and the 302, since no single function owns all three. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
This Worker is bound to no domain, so the new site is reachable only at its workers.dev host and `wemeditate.com` still serves the old Rails app. ⚠ Cloudflare Workers Builds deploys this Worker from `main`, and a custom domain overwrites the zone's DNS record for that hostname. Merging this commit moves the apex, so it is deliberately the last commit on the branch, and the comment beside it names what has to be in `main` first. Only the apex needs a route: `www` and all five country hosts already redirect to it at Cloudflare, before an origin is chosen (re-measured, and `wemeditate.cz` sends `/articles/x` to `/cs/articles/x`). Verified reaching the deploy, which is not obvious: the build writes `dist/server/wrangler.json` and wrangler deploys from that redirected config, not from this file. The generated JSON carries the route. Refs #280 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZYMDrz1EMD9d66QLj
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
| key="upsell" | ||
| external | ||
| href={`https://${WEMEDITATE_DOMAIN}/meditations`} | ||
| href="/meditate-now" |
There was a problem hiding this comment.
Should these two links keep external?
The acceptance criterion says they should lose it, reading external as "off-site" — and the href is now our own origin. But in this atom external is what sets target="_blank", rel and the "opens in a new tab" announcement. Link cannot read the request origin, so the prop is a new-tab prop, not an origin claim.
A — keep it. Built. Only the embed route renders this line, inside an iframe on someone else's page. A same-tab link navigates that iframe, drawing this whole site into a small box.
B — drop it, as the criterion says. The link then opens in the host's frame.
C — keep the new tab and rename the atom's prop to newTab, so neither this call site nor the next same-origin one needs a comment defending external. One atom plus a handful of call sites, including RichText's pass-through of the editor's own newTab field.
Reply with a letter, or your own answer.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | 0abce32 | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:30 AM |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | 0abce32 | Commit Preview URL Branch Preview URL |
Nov 24 2026, 01:30 AM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Six of the ticket's nine parts, built with no new layer: the fallback reuses advertisedLocales, localeHref and DEFAULT_LOCALE, the diff adds no file but a test, and each of the four non-firing cases is a test, not a claim. Two things to settle. The embed is the one route with no availableLocales gate, so its newly relative upsell links are reachable in locales the site refuses. And this says Closes #280 while parts 1 and 6 sit in #276 (Part of #160) and #284 (Closes #278) — so nothing ties #280's fifteen redirect-layer criteria to a PR, and merging this closes the ticket with them unverified. Strike them from #280, or have #276 close it.
Findings
- should-fix
MeditationPlayer.tsx:842— the upsell links 404 permanently in a locale outsideavailableLocales, which only the embed reaches. - should-fix
pages/[slug]/+data.ts:96— the 302 drops the query string #276's 301 keeps. - should-fix
wrangler.toml:27— an 11-line merge checklist over a 3-line block, stale a day later. - consider
AGENTS.md:111— claims the Pages 302 for every route the dropdown renders on.
What was checked
Read whole: both [slug] hooks, MeditationPlayer, LayoutChrome, the Link atom, lib/hreflang.ts, server/site-context.ts, the embed +data.ts, wrangler.toml, .env.production. Ladder: no new file, hook, type or constant — every piece is an existing export. Confirmed advertisedLocales(status, offered) matches its call, anchorFor exists in tests/_helpers/markup.ts, PUBLIC__TURNSTILE_SITE_KEY matches .env.example:77, [[routes]] closes before [vars], and upsell is passed only by the embed route, so that comment holds. Read #276 and #284 for parts 1 and 6. No preview request sent. The external question thread is the reviewer's; its reading is argued and I left it.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The embed route fetches no settings, so it renders under any KNOWN_LOCALES code. `server/site-context.ts` 404s a locale outside `availableLocales` before a page is read, so a locale-prefixed upsell href is permanently dead there — and `availableLocales` is `["en"]` today, which makes that every non-English embed. The absolute URL these replaced had no prefix to go wrong. Pinning both to DEFAULT_LOCALE costs a translated embed the English page. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVZc1mzQSDzGNdz7nK
The legacy redirect layer's 301 carries the search through (#276), and that 301 may hand off to this 302, so `/it/articles/x?utm=y` kept the campaign tag over the first hop and lost it on the second. A cutover's inbound traffic is exactly what arrives tagged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVZc1mzQSDzGNdz7nK
The prerequisite list was a point-in-time ordering, and a day after the cutover it reads as history. The PR body carries it, which is where a reviewer reads it. The deploy mechanism stays: that is the part a reader of this file cannot derive. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVZc1mzQSDzGNdz7nK
The dropdown renders on every route, so both notes on it read as if the `[slug]` fallback covered the routes it does not. Name the route, and say why the id-addressed ones need no fallback of their own. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVZc1mzQSDzGNdz7nK
|
Merged All four critic findings adopted, a commit each:
The One review-body point needs you, not a commit. This says
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#325 trimmed the SEO inventory out of the root guide's head bullet, and this branch had appended the `[slug]` untranslated-locale fallback to the longer version of that bullet. Took main's trimmed prose and kept the fallback paragraph: it is behaviour this branch adds, not inventory #325 moved to the modules' own headers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXwXBeD2ne3FtN5Ais
|
Merged #325 trimmed the SEO inventory out of that bullet. This branch had appended the
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#283 moved the `languages` derivation out of `LayoutChrome` into `useSiteNav`, where this branch had only corrected its comment. The code is main's; the comment's second paragraph — which locales the dropdown lists versus the hreflang cluster, and the `[slug]` 302 that makes an untranslated entry work — moves to `useSiteNav.ts` with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYtbM5nSLeexEEY5i8
|
Merged #283 moved the
Lean gate green: lint, The body's file list now names 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#313 reformatted the repo and made any lint warning fail the gate, which touched both of this branch's conflicted files. - `SocialShare.tsx`: the hunk is #313's prop reordering against this branch's removal of `platforms.sort()`. Took main's formatting with this branch's `.map`, so the caller's order survives and the file clears `--max-warnings 0`. Those were the 7 warnings the PR body logged as unfixable on lines it does not write; main has now fixed them. - `DiscoverMeditation.stories.tsx`: main's side is #313 reformatting the old story body, which this branch replaces — `pages` is required now, so `<DiscoverMeditation />` with no props would not typecheck. Took this branch's file. Main carries no `DiscoverMeditation.test.tsx`, so the add/add the PR body anticipated from #288 did not arrive. Lean gate on the merge: lint clean under `--max-warnings 0`, prettier clean, `tsc --noEmit` clean, 164 files / 1706 tests pass. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYq1nwFopvLJWfb9Jv
`main`'s module reorg renamed every path this branch imports. Three files
conflicted, each the same shape: take the new paths, keep this branch's
added lines.
- `MeditationPlayer.tsx`: `DEFAULT_LOCALE` now comes from
`@/lib/i18n/locales`, which is where the reorg put it. Dropped `main`'s
`shortcut:` comment on `WEMEDITATE_DOMAIN`, whose stated trigger — "once
this app serves wemeditate.com" — is what this branch does; the two upsell
hrefs are site paths now, and only the link text still names the domain.
- `+data.ts`: `localeHref` and `DEFAULT_LOCALE` added to `main`'s import block.
- `data.test.ts`: kept the real `LivePreviewSession` fixture shape. `main`
still carried the `{ enabled: false }` that nothing reads, which would make
the preview-active case vacuous.
`main` also added a `no-restricted-imports` rule requiring `@/` across folder
boundaries, which this branch's new `markup` helper import in the embed test
predates. Respelled.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWZZJqzV3yK9HqZk1F
|
Merged
One clean auto-merge still broke: Lean gate green — 170 files, 1717 tests. Rebuilt too, since the reorg moved all of 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
`main` replaced DiscoverMeditation's three hard-coded hrefs with the pages an editor configures in `wm-web-config.classPages`, resolved through `documentHref`, and wired the organism into `pages/[slug]/+Page.tsx`. That delivers part 4 of #280 — no literal a rename can break — so the conflicted hunk takes `main`'s loop, and this branch's `DiscoverMeditation.test.tsx` goes with it: it rendered the organism with no `pages`, which now returns null, and `DiscoverMeditation.pages.test.tsx` on `main` pins the same slugs from the configured pages. `layouts/useSiteNav.ts` merged with both sides kept: `main`'s `documentHref` spelling of `actionLinkHref`, and this branch's note on why the dropdown lists every served locale while the hreflang cluster lists published ∩ offered. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXSfMyNJuQ1p68AyVC
|
Merged It took
Two claims in the body are now stale — the Lean gate green on the merge: lint, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
Change outline
Behaviour — the Pages data hook
A locale a page has no translation in renders 404 today. It now falls back to the English URL. No second SahajCloud read:
statusis already in the hook'sPromise.all.Four ways it deliberately does not fire, each a test:
Contract — the links a visitor can click
Five rendered hrefs pointed at the old Rails site's slugs. All five measured 404 on the preview Worker, and every target measured 200 except
/app, which has no page in SahajCloud yet.externalstays on both, which departs from one acceptance criterion — see the question thread on the diff.locale={DEFAULT_LOCALE}on both, which the ticket does not ask for. The embed route fetches nosettings, so it renders under any
KNOWN_LOCALEScode, andserver/site-context.ts404s a prefixoutside
availableLocalesbefore the page is read.availableLocalesis["en"]today, so avisitor-locale prefix would make these two links dead on every non-English embed. Cost: a
translated embed points at the English page.
Contract — the deploy
wrangler.toml name, compatibility_date, compatibility_flags, main + [[routes]] pattern = "wemeditate.com", custom_domain = true [vars].env.production + PUBLIC__TURNSTILE_SITE_KEY # SahajCloud's own pair; unset, every submission is captcha_failedFiles — three comments the ticket calls out as wrong
pages/[slug]/+route.ts # claimed a `pages/[locale]/[slug]` route that has never existed layouts/useSiteNav.ts # claimed the dropdown and the hreflang cluster cannot disagree # (#283 moved the derivation there) AGENTS.md # named only the design Worker's custom domainPreview
https://claude-feat-280-cutover-wemeditate-web.contact-c66.workers.dev—/and/meditate-nowboth 200 on it.
Worth opening:
/meditations/142/embed— the upsell line's link, now/meditate-now, opening in a new tabgrep -c '0x4AAAAAAEFpp8n3BBZfG0KF'on it should print at least 1, and a submission should no longer come backcaptcha_failed⚠ Two of this branch's changes cannot be seen on a preview at all.
availableLocales: ["en"](re-read live), soserver/site-context.ts404s every non-English prefix before the page is read —/it/techniquesand/fr/techniquesboth measured 404 for that reason, not this one. The tests are the only evidence until The player and site speak every visitor's language #163 publishes the launch locales.DiscoverMeditationlinks. See the notes — nothing renders that organism yet.Test results
tsc --noEmit+vitest run— 126 files, 1203 tests, onmainmerged inpages/[slug]/data.test.ts(9 new cases),pages/[slug]/route.test.ts,layouts/LayoutChrome.test.tsx,components/organisms/DiscoverMeditation,components/organisms/MeditationPlayer,pages/meditations/[id]/embed/Page.test.tsxpnpm build, thenwrangler deploy --dry-run— 3165.83 KiB / gzip 783.21 KiBwrangler.tomland.env.production. Nofindings. The second pass traced the request query string into the 302's
Location:slugSchemaadmits no
/,.,:or%,searchOriginalisnullor starts with?and carries no#,and
localeHrefreattaches it after the path, so the value always begins/+[a-z0-9]and thescheme and host are never reachable.
Every new case was watched failing first. Reverting the redirect fails the three positive cases; loosening its condition to
locale !== DEFAULT_LOCALEalone fails the three status guards; dropping!preview.activefails the preview case.Manual verification
main),wemeditate.comadded to the Turnstile widget's hostname allowlist in the Cloudflare dashboard, and The player and site speak every visitor's language #163's launch locales. This list lives here only: thewrangler.tomlcomment keeps the deploy mechanism and no longer restates the ordering, which would read as history a day after cutover.appin SahajCloud. The player's second upsell link points at/app, which 404s until that page exists; Switch wemeditate.com over to the new site #160's "Not included" allows exactly this page, and the slug is fixed, so do not substitute another.curl -s https://wemeditate.com/robots.txtshould printAllow: /and aSitemap:line;/sitemap.xmlshould be a non-empty<urlset>;/techniques's canonical should namewemeditate.com; andPREVIEW_URL=https://wemeditate.com pnpm test:smokeshould pass. All three are host-derived and correct themselves at cutover — measured on the preview today asDisallow: /, an empty<urlset>, and aworkers.devcanonical.Notes for reviewer
Two of the ticket's nine parts are not in this branch, because they are already open. Neither was rebuilt: a second copy would conflict with the PR that has it and win nothing.
core.tscarries thept-br→pt-BRrespelling,sitemap.xml.gz, the section walk-up and the unsupported-locale fallback.usePageHeadcalls(full)route's own+Page.tsx, not to the shared templates, as the ticket requires. Both routes still serve<title>We Meditate</title>on the preview, so part 6 is unmet until #284 merges.Merge order: #276 and #284 before this one. #282 and #284 also touch
pages/[slug]/+data.ts,layouts/LayoutChrome.tsxandAGENTS.md, so expect a small conflict whichever lands second.⚠ Sequencing is the real risk in this PR, not any one hunk. Merging the
[[routes]]block without #276 moves every old address —/articles/*,/subtle-system/*,/techniques/*,/privacy,/contact,/meditations,/live,/music,/classes,/pt-br,/sitemap.xml.gz— from 200-on-Rails to 404-on-this-Worker. Repointing the in-code hrefs fixes only the links this repo authors; every inbound backlink and bookmark depends on #276.DiscoverMeditationis rendered by nothing. It is exported fromcomponents/organisms/index.tsand appears in no route, no layout and no content block — only its own story and tests. So repointing its three hrefs ships no visitor-facing fix today; it fixes the component for whenever it is wired up, and its new test is the guard for that moment. Worth knowing before judging the change's weight.Part 8 produced no code. Nothing on the indexing surface is verifiable before the switch and all of it corrects itself at cutover, so it is step 3 above rather than a diff.
Detail
Why
externalstays on the player's two links. The acceptance criterion asks for it to go, on the reading that an own-origin link is not external. In this atomexternalis what setstarget="_blank",rel="noopener noreferrer"and the screen-reader "opens in a new tab" announcement —Linkcannot read the request origin, so the prop is a new-tab prop, not an origin claim. The only route that renders the upsell is/meditations/:id/embed, which runs in an iframe on a third party's page: droppingexternalwould navigate that iframe, drawing the whole site into a small box. The question thread asks which reading wins; the branch builds the new-tab one. The deeper fix, if the criterion's reading is the intended one, is to rename the atom's prop tonewTaband keep the announcement keyed to it — one atom and a handful of call sites, includingRichText's pass-through of the editor's ownnewTabfield. Not done here: it is a change to a shared atom, outside this ticket.localeHref, notlocalePath+normalizeContentPath.localeHrefis that composition, and its doc names this caller — "the one entry point for a caller that cannot promiselocalePath's already-normalized input". Verified equivalent for every shapeslugSchemaadmits plusindex.Why the fallback is a 302 and not a rewrite. Serving English content under an
/it/URL would break the canonical andhreflangcontractlib/hreflang.tsowns, andserver/AGENTS.mdrecords the invariant it rests on: a page always renders in a locale it is published in, and its canonical is always self-referential. The 302 costs a round trip, and the second request's config read sits behind the 600s edge cache in front of SahajCloud.The chain this permits. A part-1 301 may be followed by this 302 —
/it/articles/x→/it/<slug>→/<slug>. Collapsing it into one 301 would cache a language choice that has to change the moment someone publishes the translation.Only
pagescan have this fallback.meditationsreturns_statusas a plain string andlecturesomits it, soadvertisedLocalesanswers[]for both. The same branch in their data hooks would be unreachable code, and their 404s are id-based and locale-invariant.Verifying that the route binding reaches the deploy.
wrangler.tomlis not what wrangler deploys: the build writesdist/server/wrangler.jsonand wrangler reports "Using redirected Wrangler configuration". That generated JSON carries"routes":[{"pattern":"wemeditate.com","custom_domain":true}], so the binding does arrive. A check ofwrangler.tomlalone would not have shown this, and an unknown-key control test confirmed wrangler never reads the TOML during the dry run.Measurements, all re-taken on this branch. Preview Worker:
/meditations,/live,/classes,/music,/app,/privacy,/contact→ 404;/meditate-now,/live-meditations,/classes-near-me,/music-for-meditation,/privacy-notice,/contact-us,/techniques→ 200. Country hosts:wemeditate.it/articles/x→ 301wemeditate.com/it/articles/x, and likewise.fr→/fr/,.ru→/ru/,.cz→/cs/,ua.→/uk/;www→ 302 apex. The Turnstile site key was read fromGET https://cloud.sydevelopers.com/api/atlas/challenge?parent=https%3A%2F%2Fwemeditate.com.Fixture pre-mortem.
pages/[slug]/data.test.ts's live-preview fixture returned{ enabled: false }.LivePreviewSessioninserver/live-preview.tsis{ active, scope, token }— nothing readsenabled, so a preview-active case written against that fixture would have been vacuous. Corrected to the real shape before the preview test was written.Review findings dismissed, with reasons.
data.test.tsinto oneabortOfreturning{url,status}|null. Rejected:redirectOfrethrows a non-redirect abort on purpose, and collapsing both into onenullanswer would make three existing tests pass on a silent 404 — exactly the bug they exist to catch. Its JSDoc was cut to two lines instead, which was the finding's real cost.localeSwitchTargets(status, offered, path), that the dropdown calls and the fallback is checked against. Rejected: a new shared layer for one caller, and the three sites it would couple do not agree on inputs —/mapand/meditations/:idresolve a locale switch for unrelated reasons. The coupling is recorded inAGENTS.md's hreflang bullet instead, which is where a reader looking at locale behaviour lands.components/returns 200". A good idea and a bigger one than this ticket: it needs the source scan plus a live fetch per href, and it would have to tolerate/appuntil that page exists. Not built here.Closes #280
Generated by Claude Code