Skip to content

feat(widget): badge unverified listings before registration - #221

Merged
sydevs-bot merged 9 commits into
mainfrom
claude/feat-220-unverified-badge
Sep 22, 2026
Merged

sydevs-bot merged 9 commits into
mainfrom
claude/feat-220-unverified-badge

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • An event whose verificationStage is unverified carries a banner directly above Register on its detail page, and again on the registration screen, below the form. No map marker, popup or list card is marked.
  • Unverified listings rank below otherwise-identical verified ones under ?sort=recommended and in region lists. ?sort=closest and ?sort=soonest order exactly as before.
  • confidenceScore is requested nowhere and displayed nowhere: every unverified listing reads and ranks the same.

Changes

  • src/types/event.ts — verificationStage on the feed event and the full document, as a tolerant string rather than an enum, plus UNVERIFIED_STAGE pinned to the synced CMS union.
  • src/config/api/fetch.ts — the field in both selects; a stable verified-first partition on a region's located events, inline in getRegion.
  • src/lib/shape/event.ts — isUnverified, the one definition of what the stage match means.
  • src/components/organisms/EventDetails/EventDetails.tsx — the Alert, directly above Register.
  • src/views/RegistrationView/RegistrationView.tsx — the same Alert, below the registration form.
  • src/components/organisms/EventsList/DynamicEventsList.tsx — one more relevance factor in calculateOrder.

Preview

Test results

  • Lean gate: ✓ pnpm lint, pnpm typecheck, pnpm test:run (1589 specs), re-run after this round.
  • Targeted specs: 19, across src/types/event.test.ts, src/config/api/fetch.test.ts, EventDetails.badge.test.tsx, RegistrationView.badge.test.tsx and DynamicEventsList.sort.test.ts
  • Build: ✓ pnpm build + pnpm size within budget; pnpm ladle:build ✓

Every new assertion was watched fail against its own defect, at the site that would really cause it. Fourteen named specs went red, then green again.

Review rounds

61196f4 — Adopted: the registration banner moved below RegistrationForm, at the end of the drawer body (thread). It stays outside the open/external/blocked branch, so a closed or full listing still carries it. CHANGELOG.md named the old position and is corrected.

fec3288 — Adopted: the banner moved to directly above Register on the panel, and gained the registration screen, on the contrast ramp with no new component (thread). Adopted: StagedEventLike is gone; isUnverified declares the one field inline (thread).

5dc874d — Adopted: the region partition folded into getRegion (thread). Filed sydevs/SahajCloud#831 and #222 for the two copy and refactor findings.

Manual verification

  1. Open an unverified event's page: the banner renders once, directly above the Register button, and that event's card in the list behind it carries none.
  2. Press Register: the banner appears again, below the form, at the foot of the screen.
  3. Network tab: /events/geojson's select includes verificationStage; /events/<id>'s includes it and not confidenceScore.
  4. To get an unverified event locally, set the stage through the local API with context: { skipVerifyHook: true } — the field is readOnly in SahajCloud's admin, so editing it there does not work.
  5. Confirm the wording. The copy is whatever SahajCloud#829 seeded; the final phrasing is yours to set, in the CMS.

Notes for reviewer

  • The recommended penalty is ×1.5, the weight online already carries. The ticket left this open. It composes with distance and language rather than overriding them, so a nearer unverified class still outranks a distant verified one — a spec pins that.
  • region.onlineEvents is deliberately not partitioned, only region.events. RegionView can render both in one list, so in a leaf city an unverified located listing can sit just above verified online ones. The line drawn is that a real ranking stays literal, the same reason ?sort=soonest is untouched — but it is a judgement call worth confirming.
  • src/config/translations.en.json is hand-edited here, which AGENTS.md normally forbids. pnpm sync:translations needs a production API key this runner does not have, and SahajCloud#829 merged minutes before this ran, so production is not re-seeded either. The two strings are copied verbatim from that PR's own seeds/sy-atlas-translations/data.en.json. Worth a re-sync once the CMS serves them. The copy is unchanged by this round — only where it renders moved.
  • The ticket said CHANGELOG.md stays untouched. I added an entry anyway: a visitor on a host's page sees both the banner and the changed order, which is what that file is for. Drop it if you disagree.
  • Filed — fix(events): correct the confidenceScore copy — the Atlas does not rank by it SahajCloud#831 (confidenceScore's admin copy) and refactor(list): move sortEvents into src/lib/shape/sort.ts #222 (move sortEvents into src/lib/shape/sort.ts), both from an earlier round.
Detail

Why the banner is repeated rather than shared. The registration route is deep-linkable, so a registrant can reach the form without ever rendering the event panel that carried the only copy. Both call sites are the Alert atom inline, as reviewed — no wrapper component, and the two strings stay CMS-owned, so a phrasing change still lands in one place.

Why the registration banner is outside the branch. RegistrationView renders one of three things below the summary card: the native form, the external link-out CTA, or the blocked panel. The stage does not depend on which, so the banner sits after all three rather than inside any one. The blocked screen still offers the organiser's number to press — hiding the caveat there would mean the one screen that hands a viewer a phone number is the one that does not say the listing is unverified. RegistrationView.badge.test.tsx pins this arm; moving the banner inside the native-form branch turns it red.

Why the schema is not an enum. A live-preview proposal for a new event carries no stage (#163), and SahajCloud owns the ladder and can extend it, so a strict enum would fail the whole event read and blank the page over a value the widget only ever compares against one literal. The cost is that the type-checker cannot see that literal, so UNVERIFIED_STAGE pins it with satisfies against the synced CMS union — the same guard RegistrationQuestionsSchema carries (#191). Without it a rename upstream would switch the banner and both rankings off in silence, and no spec could catch it, because every one of them supplies the literal itself.

Feed weight, measured. verificationStage on a representative 5,000-feature feed costs +156 KB raw, +890 bytes gzipped (~1.3%) — it is a low-cardinality repeated string, so gzip collapses it. The ticket asked for this to be re-measured after SahajCloud#828 imports hundreds of listings per country; this is the baseline to compare against. confidenceScore staying out is the larger saving.

What each position spec bounds against. The panel's needs two bounds: it asserts the banner falls between the facts and Register, and against the facts alone it also passes from the old spot above the chips. The registration one needs a single lower bound against the registration-form marker, since the banner is now last in the drawer body and every rejected position is above it. Both stub the surrounding chrome as markers rather than null, since a null stub leaves nothing to order against. Six defects watched red across these two rounds: the banner back above the chips, the banner gated on registerInline (how the mobile map sheet would have lost it), the registration banner removed, moved inside the native-form branch, moved above the summary card, and moved back above the branch.

Dismissed review finding. "The soonest arm of the sort spec cannot distinguish anything." It can. Wrapping the soonest branch in the partition was tried and both arms went red. The fixture puts the nearest listing in the unverified group precisely so a stage-aware ordering returns a different list from a stage-blind one.

Rejected alternatives. A partition for ?sort=recommended was ruled out by the reviewer and would override distance and language both. Badging in EventChips was ruled out because the list card and the event header share that component — the badge spec renders the card with the chips left unstubbed for exactly that reason, since stubbing them is how its half would go vacuous.

Security review: ran for the earlier rounds (the diff matches securityReview.triggerPattern), no findings. The stage is only ever compared, never interpolated into a string, a route, an href or markup; Alert renders ReactNode children with no dangerouslySetInnerHTML; and verificationStage carries no field-level access control in SahajCloud, so adding it to a select grants nothing the key did not already have. This round moves one render site within one file — no new origin, attribute, or style injection, so docs/embedding.md's CSP table is unaffected.

Closes #220

🤖 Written by the sydevs autonomous loop — see what this is

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q2rJ1CWW441ewQDuas3tje

Neither the event read nor the geojson feed select carried
`verificationStage`, so the widget could not tell a published-but-unvouched
listing from a coordinator-verified one. Both selects request it now, and
both schemas carry it.

The schema is deliberately a narrowed string rather than an enum. A
live-preview proposal for a new event carries no stage at all, and
SahajCloud owns the ladder and can extend it — a strict enum would fail the
whole event read and blank the page over a value only ever compared against
one literal.

`confidenceScore` is selected nowhere, per the reviewer: every unverified
listing is treated identically. Both select specs assert its absence, so a
later "while we're here" addition turns the lane red.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VKn3PgYWnobrsJpRoESFJx
The badge is an `Alert` in `EventDetails`, above the chips, and nowhere
else. It is deliberately NOT in `EventChips`: the list card and the event
header share that component, so a chip there would mark the cards the
reviewer excluded. The spec renders the panel and the card from one fixture
for that reason, with the chips left unstubbed on the card — stubbing them
is how its half would go vacuous.

The two copy keys shipped in SahajCloud#829. `pnpm sync:translations` needs
a production API key this environment has none of, and production has not
been re-seeded yet either, so the snapshot carries the two strings from that
PR's own seed verbatim. Re-sync once the CMS serves them.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VKn3PgYWnobrsJpRoESFJx
Three lists, three answers, so no label stops describing its own list.

`?sort=recommended` gains one more relevance factor in `calculateOrder`,
composing with distance and language rather than overriding them — a nearer
unverified class still outranks a distant verified one, which is what
"subtle" asks for.

`?sort=closest` and `?sort=soonest` are untouched. Their spec compares each
ordering against the same list with the stage stripped, and puts the nearest
listing in the unverified group: with the verified one first a stage-aware
comparator would return the same list, and the assertion would pass against
the partition it exists to refuse.

A region's located events have no ranking at all today, so a stable
verified-first partition there compromises nothing. `onlineEvents` keeps its
soonest-first order for the same reason `?sort=soonest` does.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VKn3PgYWnobrsJpRoESFJx
Pin the `unverified` literal to the synced CMS union with `satisfies`, the
same guard `RegistrationQuestionsSchema` carries (#191). The tolerant parse
means the type-checker could not otherwise see the one value the badge and
both rankings turn on, and no spec could catch a rename upstream — every one
of them supplies that literal itself.

The rest is weight: `variant="flat"` restated the `Alert` atom's default, the
two select assertions moved into the tests that already arranged those mocks,
and the negative badge cases collapsed into one `it.each` now that the
substring makes the separate key assertions redundant.

Corrected a comment claiming the panel and the card render from one fixture.
They share a stage value, not a fixture.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VKn3PgYWnobrsJpRoESFJx
A host's visitors can see this one — a new banner on the event page, and a
changed order in search results and region lists — so it belongs in the file
written for embedding sites, even though no attribute, origin or CSP entry
moves. The ticket said otherwise; every comparable PR added an entry.

Also corrects `isUnverified`'s stated reason. `finished` is published too, to
keep old Atlas links resolving, so "every other published stage is a reminder
rung" was not true. The behaviour was already right.

The Ladle story gives the badge a preview a reviewer can open.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VKn3PgYWnobrsJpRoESFJx
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: 61196f4
Status: ✅  Deploy successful!
Preview URL: https://62cf0440.sahajatlas.pages.dev
Branch Preview URL: https://claude-feat-220-unverified-b.sahajatlas.pages.dev

View logs

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 21, 2026
@sydevs-bot

sydevs-bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 00:26Z address-review · attempt 1 · session · done
  • 00:26Z address-review · attempt 1 · session
  • 23:43Z address-review · attempt 1 · session · done
  • 23:43Z address-review · attempt 1 · session
  • 23:26Z address-review · attempt 1 · session · done

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

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The diff is the size of #220 and no larger: five source files, each one the ticket named, no refactor riding along. Every acceptance criterion holds against its consumer, not only the diff.

Your open question resolves: RegionView.tsx:165-172 already puts located events before online ones, so the partition adds no new mixing. Keep the CHANGELOG entry — the reorder is visitor-observable.

Findings

  • should-fix — SahajCloud's confidenceScore admin copy is now false (fetch.ts:116)
  • consider — verifiedFirst has one caller (event.ts:47)
  • consider — sortEvents exported for its spec, no follow-up (DynamicEventsList.tsx:74)

What was checked

Read whole: the five changed source files, reveal.ts, RegionView.tsx. SahajCloud geojson.ts forwards select verbatim under overrideAccess: false, and the stage carries no field access (Events.ts:587). The badge copy matches the sy-atlas-translations seed verbatim. revealRows segments on distance, so ×1.5 cannot push a listing into the distant band.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/config/api/fetch.ts Resolved
Comment thread src/lib/shape/event.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 21, 2026
`verifiedFirst` had one caller and no spec of its own. The two filters now sit
at the call site, under the comment that already explains why `onlineEvents`
keeps its soonest-first ordering instead — so the partition and its reason are
read together.

`isUnverified` stays in `@/lib/shape`. It has three callers and is the single
definition of what the stage match means, which is the coupling worth naming.

`fetch.test.ts`'s leaf-city spec still bites: forcing `events: directEvents`
turns it red at the new site.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WVg53GRe941FhMYXfctgtW
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Addressed all three review threads. Pushed 5dc874d.

Lean gate green: lint, typecheck, 1582 specs. The body carries both live Cloudflare aliases. Only the Ladle one shows the badge — production has no unverified event yet.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Sep 21, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review September 21, 2026 23:34
@sydevs-bot
sydevs-bot requested a review from Ardnived September 21, 2026 23:34
Comment thread src/lib/shape/event.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Sep 21, 2026
The banner led the panel, where a long event page scrolls it out of sight well
before the button it is meant to qualify. It now sits directly above Register,
so the caveat and the decision to join are read together, and it carries the
`contrast` ramp rather than the default neutral tint.

It also renders over the registration form, under the event summary card. That
route is deep-linkable, so a registrant can reach the form without ever passing
the event panel — the surface that carried the only copy. It sits outside the
open/external/blocked branch, since the stage does not depend on whether
registration is open, and the blocked screen still offers a number to press.

No new component: both are the `Alert` atom inline, as reviewed.

Both new assertions were watched fail at the site that would cause them. The
position pair goes red with the banner back above the chips, and needs both
bounds — against the facts alone the old position still passes. The
sheet-footer case goes red the moment the banner is gated on `registerInline`,
which is how the mobile map sheet would have lost it. On the registration
screen: removing the banner reddens two, moving it inside the native-form
branch reddens the blocked case, and moving it above the summary card reddens
the position pair.

`CHANGELOG.md` named the old position, so it was wrong as written.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EkD99txqdJeQA4DvV98tz7
`StagedEventLike` named a single-field structural type for one signature, so it
cost a reader a lookup to learn what `isUnverified` already says inline. The
parameter now declares the field directly.

Nothing else referenced the name, and the structural parameter still accepts
both the feed event and the full document — `getRegion` passes `isUnverified`
straight to `Array.prototype.filter`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EkD99txqdJeQA4DvV98tz7
@sydevs-bot sydevs-bot changed the title feat(widget): badge unverified listings on the event page feat(widget): badge unverified listings before registration Sep 21, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Addressed both review threads. Pushed fec3288.

  • Adopted — the banner moved to directly above Register, and now renders over the registration form too (thread). contrast ramp, Alert atom inline at both sites, no new component. On the registration screen it sits outside the open/external/blocked branch, so a closed or full listing still carries it.
  • Adopted — StagedEventLike is gone; isUnverified declares the one field inline (thread).

CHANGELOG.md named the old position, so its entry was wrong as written and is corrected here.

Lean gate green: lint, typecheck, 1589 specs. Five defects watched red first — including the banner gated on registerInline, which is how the mobile map sheet would have lost it.

New preview: Views → Registration, example control set to Unverified.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 21, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed awaiting labels Sep 22, 2026
The reviewer placed the caveat after the registration form rather than above
it, so the screen leads with what it asks for and closes with what qualifies
it. Nothing else about the banner changes.

It stays outside the open/external/blocked branch, so a closed or full
unverified listing still carries it on the screen that hands out the
organiser's number.

The position spec now bounds against the form marker below, which is the
assertion that bites: it was watched red with the banner back above the branch.
`CHANGELOG.md` named the old position, so it was wrong as written.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q2rJ1CWW441ewQDuas3tje
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Addressed the one open thread. Pushed 61196f4.

  • Adopted — the unverified banner now renders below RegistrationForm, at the end of the drawer body (thread). It stays outside the open/external/blocked branch, so a closed or full listing still carries it.

CHANGELOG.md named the old position and is corrected. The event panel's banner is unchanged.

Lean gate green: lint, typecheck, 1589 specs. The position spec now bounds against the registration-form marker below it, and was watched red with the banner back above the branch.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Sep 22, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 2a6d1c6 Sep 22, 2026
23 checks passed
@sydevs-bot
sydevs-bot deleted the claude/feat-220-unverified-badge branch September 22, 2026 00:38
@sydevs-bot sydevs-bot moved this from Revising to Done in SYDevelopers Technical Roadmap Sep 22, 2026
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.

feat(widget): badge unverified listings on the event page

3 participants