Skip to content

fix(registration): give the collapsed captcha slot no gap of its own #367

Closed

Description

@sydevs-bot

Summary

Since #366 the captcha frame is 0px tall until Cloudflare asks for a click, which is the state most visitors now see. The frame is still a flex item, so it keeps consuming its column's gap on both sides: RegistrationForm shows about 24px of blank where 12px belongs. ReportIssueForm cancels the same gap by hand with a negative margin, so the two forms space one shared slot two different ways.

Approach

One owner for the collapsed slot

useTurnstile publishes interactive (src/hooks/use-turnstile.ts:219) only so each caller can patch its own column gap, and the two callers patch it differently:

  • src/components/organisms/RegistrationForm/RegistrationForm.tsx:387 — className={interactive ? 'mt-4' : undefined}, in the form's gap-3 column (:339). Nothing cancels the gap, so the collapsed slot costs 12px.
  • src/components/organisms/ReportIssueForm/ReportIssueForm.tsx:498 — className={interactive ? undefined : '-mt-4'}, in a gap-4 column (:475), which does cancel it.

Each spelling hardcodes its own parent's gap value, which is how the registration one was missed. Move the collapse to the one place that already owns the slot: the hook holds challengeRef, and already toggles the frame's height where it handles interactive and settled (src/hooks/use-turnstile.ts:260 and :264). Setting the wrapper's own block margin there leaves no form reading interactive, and a third caller cannot get it wrong.

Keep the 0px frame rather than display: none. probeTurnstile deliberately avoids display: none for its own frame, to stay close to the frame a form mounts (src/hooks/use-turnstile.ts:185).

AddToCalendar follow-ups

All in src/components/molecules/AddToCalendar/AddToCalendar.tsx:

  • :55 and :57 — the menu and item class strings are now a third copy. SortMenu and SettingsMenu carry the same pair, and SortMenu's comment justifying the duplication still says "the two menus". They have already drifted: min-w-56 against min-w-44, px-3 against px-2. Hoist the shared surface and row classes to one export, and leave only the per-menu difference local. src/lib/overlay.ts already owns the Radix-popper concerns for these three files, and src/lib/overlay.popper.test.ts already pins the call-site list.
  • :40 — downloadEventIcs is exported, but nothing outside the file imports it, and it was a local closure before feat(registration): tidy the confirmation screen, one calendar menu, hidden captcha #366. Make it local again. calendarLinkTargets keeps its export, which the spec reads.
  • :90 — the comment states that the accessible name contains the visible label (WCAG 2.5.3), but the aria-label it describes is gone: the name is now simply the row's text. Delete the comment.

Acceptance criteria

  • With the challenge collapsed, RegistrationForm spaces the slot exactly as if it were absent — no extra blank band between the fields and what follows.
  • With the challenge open, both forms space the 300x65 frame identically.
  • No form hardcodes a gap value for the slot; either neither reads interactive, or both read one shared spelling.
  • AddToCalendar, SortMenu and SettingsMenu read their dropdown surface and row classes from one place.
  • downloadEventIcs is not exported.
  • The WCAG comment above the Apple Calendar row is gone.

Verification checklist

  • A spec pins the collapsed slot's contributed height at 0 for both forms, watched failing before the fix.
  • pnpm test:run src/hooks/use-turnstile.test.tsx src/components/molecules/AddToCalendar/AddToCalendar.test.tsx src/lib/overlay.popper.test.ts
  • .claude/skills/pr-prep/check.sh
  • In Ladle, open the sort menu and the add-to-calendar menu: same surface radius, border, shadow and row height.
  • On the register route with a challenge that never turns interactive, no blank band sits between the last field and the buttons; with one that does, the 300x65 frame is spaced as before.

Notes

Activity

  1. added theissue type on Nov 6, 2026
  2. added
    proposal
    on Nov 6, 2026
  3. Ardnived commented on Nov 7, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  4. added
    bot:working
    and removed
    proposal
    on Nov 7, 2026
  5. sydevs-bot commented on Nov 7, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running
    approved by Ardnived

    recent dispatches
    • 21:44Z implement · attempt 1 · session · done
    • 21:44Z implement · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Nov 7, 2026
  7. removed
    bot:working
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Low

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions