Skip to content

feat(atlas): render the challenge interaction-only, and say when it needs a click - #1090

Merged
Ardnived merged 1 commit into
mainfrom
feat/turnstile-interaction-only
Nov 6, 2026
Merged

Ardnived merged 1 commit into
mainfrom
feat/turnstile-interaction-only

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Most visitors should never see the captcha on the atlas registration and report forms. The challenge page (GET /api/atlas/challenge) now renders Turnstile with appearance: 'interaction-only', so it stays invisible unless Cloudflare needs a click. It also tells the widget when that happens:

Message Sent from Widget does
interactive before-interactive-callback expands its frame to 300×65
settled after-interactive-callback collapses it again

Cross-repo contract

⚠ This extends the protocol with sydevs/SahajAtlasWeb's src/hooks/use-turnstile.ts. It is safe to ship first: the deployed widget ignores unknown message types (readChallengeEvent returns null) and keeps its fixed 300×65 frame, which now sits blank unless a challenge is interactive. The consumer change rides on the SahajAtlasWeb branch feat/registration-confirmation-ux.

Testing

  • pnpm test:unit tests/unit/atlas-challenge.spec.ts tests/unit/csp-frame-src.spec.ts — 55 passed, including a new spec for the two messages and the appearance option
  • Prettier and ESLint clean on the touched files

🤖 Generated with Claude Code

…eeds a click

The atlas challenge page now renders Turnstile with `appearance:
'interaction-only'`, so most visitors never see it. It posts two new
messages to the parent: `interactive` before Cloudflare asks for a click,
and `settled` after. The widget uses them to keep its frame collapsed until
then.

Backward compatible: the deployed widget ignores unknown message types and
keeps its fixed 300×65 frame, so this can ship before the widget change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1090 November 6, 2026 16:10 Destroyed
@railway-app

railway-app Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1090 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 6, 2026 at 4:16 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot
sydevs-bot enabled auto-merge November 6, 2026 16:24
@Ardnived
Ardnived disabled auto-merge November 6, 2026 16:28
@Ardnived
Ardnived merged commit f95efca into main Nov 6, 2026
9 checks passed
@Ardnived
Ardnived deleted the feat/turnstile-interaction-only branch November 6, 2026 16:28
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 6, 2026
Ardnived added a commit to sydevs/SahajAtlasWeb that referenced this pull request Nov 6, 2026
…hidden captcha (#366)

- One notice under the event summary: the confirmation email, plus the
  join link for an online class.
- "Add to calendar" is one button opening a menu of providers, sharing a
  row with a grey "Okay".
- Closing the native share sheet keeps the Share button. Only a sheet
  that cannot open reveals the fallback grid (AbortError vs NotAllowedError).
- The captcha frame stays collapsed until Cloudflare asks for a click,
  on the registration and report forms (sydevs/SahajCloud#1090).

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1090 — 8dff52f5 Deployed Nov 6, 2026 by railway-app[bot]
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