Skip to content

fix(embed): honour the script's atlas default under routing=path - #250

Merged
Ardnived merged 1 commit into
mainfrom
fix/path-mode-start-route
Oct 5, 2026
Merged

Ardnived merged 1 commit into
mainfrom
fix/path-mode-start-route

Conversation

@Ardnived

@Ardnived Ardnived commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The script's atlas= default now works under routing=path. Before, it was ignored there, and the page always opened on the world list. Now the widget navigates to the default the first time the interface opens. This is the same mechanism that already opens a client record's home region. The default outranks the region, and Back returns to the world list.
  • Query routing is unchanged: there, the default was already the route the widget starts on.
  • docs/embedding.md and CHANGELOG.md describe the path-mode behaviour.

Why now: the WordPress plugin's new "Atlas page opens at" setting (sydevs/SahajAtlasWordpress, for 0.3.0) sends atlas=. Atlas pages run path routing whenever they have pretty permalinks and are registered, so without this the setting would do nothing on most sites. The plugin's browser lane caught it: the plugin printed auto.js?…&atlas=/gb&routing=path, and the page still opened on the world list.

Changes

  • src/lib/shape/routing.ts: new homePathFor(). In path mode it returns the script's default; otherwise the client record's region. A route that came from the page is never treated as a default.
  • src/App.tsx: homePath comes from homePathFor().
  • src/views/FullInterface.tsx: comment only.

Test results

  • pnpm vitest run src/lib/shape/routing.test.ts: 90 passed, 5 of them new.
  • .claude/skills/pr-prep/check.sh passed. pnpm build passed, including the CSS-scoping and no-sourcemap checks.
  • The WordPress browser lane's start-route cell will run against this PR's Cloudflare preview, with the result posted here.

Notes for reviewer

No other in-tree host sends atlas= with routing=path: WeMeditateWeb's lib/atlas-embed.ts sends only routing: 'path'. So no existing host's behaviour changes.

🤖 Generated with Claude Code

Path mode always booted at the prefix root, so a host's `atlas=` default
was ignored: the page's own address is the root view, and mountDecision
has no "nobody asked" state there. The default now becomes the home route,
which FullInterface already navigates to once when the interface opens —
the mechanism the client record's home region uses — and it outranks that
region. Query mode is unchanged: the default was already its boot route.

The WordPress plugin's "Atlas page opens at" setting depends on this; most
Atlas pages run path routing.

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

Copy link
Copy Markdown

Deploying sahajatlas-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7520dba
Status: ✅  Deploy successful!
Preview URL: https://0ecbf954.sahajatlas-design.pages.dev
Branch Preview URL: https://fix-path-mode-start-route.sahajatlas-design.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7520dba
Status: ✅  Deploy successful!
Preview URL: https://9cdfb03c.sahajatlas.pages.dev
Branch Preview URL: https://fix-path-mode-start-route.sahajatlas.pages.dev

View logs

@Ardnived

Ardnived commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

The WordPress browser lane confirms the fix. The start-route cell, from sydevs/SahajAtlasWordpress#61, sets the Atlas page to open at /gb on a path-routed page (auto.js?…&atlas=/gb&routing=path).

Widget Result
Production FAIL at laptop, small-laptop and phone: the page opens on the world list
This preview (9cdfb03c) 0 failures: the page opens on the United Kingdom and lists its regions

The astra cell, which sets no start route, also has 0 failures on this preview, so the change doesn't affect other pages.

@Ardnived
Ardnived merged commit 4ae6cd3 into main Oct 5, 2026
10 checks passed
@Ardnived
Ardnived deleted the fix/path-mode-start-route branch October 5, 2026 17:28
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.

1 participant