Skip to content

feat: choose where the atlas opens, map-by-default shortcode, and a volunteer README - #61

Merged
Ardnived merged 2 commits into
mainfrom
feat/start-route
Oct 5, 2026
Merged

Ardnived merged 2 commits into
mainfrom
feat/start-route

Conversation

@Ardnived

@Ardnived Ardnived commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New setting: "Atlas page opens at" (Settings → Sahaj Atlas). A volunteer finds their country or city on sahajatlas.com, copies the address and pastes it in. The plugin turns it into a route, checks it with SahajCloud when they save, and sends it to the widget as its atlas= default.
    • If the address isn't a place in the atlas, the old value stays and the screen says why.
    • If SahajCloud can't be reached, it saves anyway with a warning.
    • An empty field means the widget's own default: the client record's home region, or the world list.
  • The shortcode and block accept the same addresses. [sahaj_atlas map="true" atlas="https://sahajatlas.com/gb"] works, and routes still work as before.
  • README.md is rewritten for a non-technical volunteer. It covers install, setup, choosing where the atlas opens, and the shortcode and block, with an examples table. readme.txt gains a matching FAQ entry.
  • The block editor's help text is corrected. It still said "the map always takes the whole window", which has been wrong since contained maps arrived (SahajAtlasWeb#170).

Shortcode and block changes (owner request)

  • [sahaj_atlas] and the block show the map by default. Use map="false" for the list, a single class, or a sign-up form. A shortcode or block saved without map now shows the map.
  • Size: the full width of the column, at 3:4 (width:height), capped at 80% of the screen height. Uncapped, a 1200px desktop column would get a 1600px map, taller than the window, and the bottom of the map would be out of reach. The widget accepts an aspect-ratio box as a definite height.
  • Visitors scroll past it. In-content map embeds send gestures=cooperative (feat(embed): gestures=cooperative lets the host page scroll past a contained map SahajAtlasWeb#251). One finger and the mouse wheel scroll the page; two fingers or Ctrl/⌘ + wheel move the map. The Atlas page doesn't send it, because it fills the screen and has nothing to scroll to. Until #251 deploys, the widget ignores the parameter.
  • Phones: a column under the widget's 360px width floor shows the "Find a class near you" button, which opens the map full-screen. That includes Astra's 350px column on a 390px phone.

⚠ Depends on SahajAtlasWeb#250 (merged) and #251

On an Atlas page with clean URLs (routing=path, most sites), the widget ignored atlas=. sydevs/SahajAtlasWeb#250 fixes that. Merge #250 first. Until it deploys, this setting only works on sites without clean URLs.

Changes

  • includes/embed.php: sahaj_atlas_route_from_input() reads a pasted address. It accepts sahajatlas.com, this site's own Atlas page in either routing shape, ?atlas=, or a bare gb/london, and refuses any other site. sahaj_atlas_start_route() feeds the page embed.
  • includes/settings.php: the third register_setting, sahaj_atlas_sanitize_start_route() (memoised, because core sanitises a new option twice) and the field.
  • sahaj-atlas.php: SAHAJ_ATLAS_OPTION_START_ROUTE.
  • AGENTS.md principle 4 and docs/rules/code-comments.md counts updated.
  • tests/start.php: 32 assertions.
  • tests/browser.mjs: a start-route cell, and a check that refuses a port another server still answers. A server orphaned by an interrupted run had silently served every later cell on port 8830.

Test results

  • After the shortcode changes: pnpm test:all gives 380 assertions, 0 failures. With the old defaults restored, 5 of the new assertions fail.

  • Browser lane, astra cell, new article check (a bare [sahaj_atlas] between paragraphs):

    Widget Full width 3:4, capped Wheel over the map scrolls the page
    Production ✓ ✓ ✗, the map zooms instead
    #251 preview 8e5690ea ✓ ✓ ✓

    On a phone (350px column) it shows the compact card, as described above.

  • pnpm test:all: 0 failures, 374 assertions. I watched the new assertions fail first: with the page embed ignoring the option, the foreign-address guard removed, the 404 branch disabled, and the read-time sanitiser removed, 10 assertions failed.

  • pnpm test:browser --only start-route:

    • Against production, it fails on laptop, small-laptop and phone. The page opens on the world list, which is the widget gap #250 fixes.
    • Against #250's preview (SAHAJ_ATLAS_WIDGET_FROM=https://9cdfb03c.sahajatlas.pages.dev), it passes with 0 failures. The Atlas page opens on the United Kingdom, listing its regions.
  • astra against the preview: 0 failures.

Manual verification

  1. After #250 deploys, run pnpm test:browser --only start-route against production. It should report 0 failures.
  2. On one live site, paste https://sahajatlas.com/<your country> into the new field and save. The Atlas page should open there.

🤖 Generated with Claude Code

…d rewrite the README

A third site setting, "Atlas page opens at". The volunteer pastes an
address from sahajatlas.com (or from their own Atlas page, or a bare
route); the plugin reads it as a route, checks it with SahajCloud's SEO
endpoint on save, and passes it as the widget's `atlas` default. A refused
or unknown address keeps the previous value and says why. The shortcode and
block's `atlas` attribute take the same addresses.

Under routing=path the widget ignored `atlas=` until SahajAtlasWeb#250, so
this needs that PR deployed to work on path-routed Atlas pages. The
browser lane's new start-route cell shows both: it fails on production and
passes on #250's preview.

The README is rewritten for the volunteer who installs the plugin: install,
set up, choose where it opens, and the shortcode and block with examples.
The block editor's help text no longer claims the map covers the window.

The browser lane also refuses to run a cell on a port another server still
answers: an orphaned server from an interrupted run had silently served
every later cell on that port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the page scroll past it

Owner decision: `[sahaj_atlas]` and the block show the map unless
`map="false"`. The element takes the column's full width at 3:4, capped at
80vh so a wide column never gets a map taller than the screen. In-content
map embeds send `gestures=cooperative` (SahajAtlasWeb#251), so one finger and
the wheel scroll the page and two fingers or Ctrl/⌘ + wheel move the map.
The Atlas page sends none: it fills the screen and has nothing to scroll to.

The browser lane gains an article cell: a bare `[sahaj_atlas]` between
paragraphs, checking the box's size and that a wheel over the map scrolls
the page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Ardnived Ardnived changed the title feat(settings): let a volunteer choose where the Atlas page opens, and rewrite the README feat: choose where the atlas opens, map-by-default shortcode, and a volunteer README Oct 5, 2026
@Ardnived
Ardnived merged commit f55af3c into main Oct 5, 2026
7 checks passed
@Ardnived
Ardnived deleted the feat/start-route branch October 5, 2026 21:36
Ardnived added a commit that referenced this pull request Oct 5, 2026
@Ardnived Ardnived mentioned this pull request Oct 5, 2026
3 tasks done
Ardnived added a commit that referenced this pull request Oct 6, 2026
* chore(release): 0.3.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(readme): the 0.3.0 entry for #58

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(readme): the 0.3.0 entries for #61

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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