Repository navigation
feat(widget): badge unverified listings before registration - #221
Conversation
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
Deploying sahajatlas-design with
|
| Latest commit: |
61196f4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d19d2fff.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://claude-feat-220-unverified-b.sahajatlas-design.pages.dev |
Deploying sahajatlas with
|
| 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 |
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 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
confidenceScoreadmin copy is now false (fetch.ts:116) - consider —
verifiedFirsthas one caller (event.ts:47) - consider —
sortEventsexported 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
`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
|
Addressed all three review threads. Pushed
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 |
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
|
Addressed both review threads. Pushed
Lean gate green: lint, typecheck, 1589 specs. Five defects watched red first — including the banner gated on New preview: Views → Registration, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
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
|
Addressed the one open thread. Pushed
Lean gate green: lint, typecheck, 1589 specs. The position spec now bounds against the 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
verificationStageisunverifiedcarries 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.?sort=recommendedand in region lists.?sort=closestand?sort=soonestorder exactly as before.confidenceScoreis requested nowhere and displayed nowhere: every unverified listing reads and ranks the same.Changes
src/types/event.ts—verificationStageon the feed event and the full document, as a tolerant string rather than an enum, plusUNVERIFIED_STAGEpinned 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 ingetRegion.src/lib/shape/event.ts—isUnverified, the one definition of what the stage match means.src/components/organisms/EventDetails/EventDetails.tsx— theAlert, directly above Register.src/views/RegistrationView/RegistrationView.tsx— the sameAlert, below the registration form.src/components/organisms/EventsList/DynamicEventsList.tsx— one more relevance factor incalculateOrder.Preview
examplecontrol for the banner below the form.unverifiedevent yet (feat(events): bulk-import events into a region from CSV SahajCloud#828 is what publishes them), so no page here renders the banner today. Worth opening to confirm nothing else moved: region lists and?sort=are unchanged for an all-verified inventory, which is the current one.Test results
pnpm lint,pnpm typecheck,pnpm test:run(1589 specs), re-run after this round.src/types/event.test.ts,src/config/api/fetch.test.ts,EventDetails.badge.test.tsx,RegistrationView.badge.test.tsxandDynamicEventsList.sort.test.tspnpm build+pnpm sizewithin 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.mdnamed 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
contrastramp with no new component (thread). Adopted:StagedEventLikeis gone;isUnverifieddeclares 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
/events/geojson'sselectincludesverificationStage;/events/<id>'s includes it and notconfidenceScore.context: { skipVerifyHook: true }— the field isreadOnlyin SahajCloud's admin, so editing it there does not work.Notes for reviewer
recommendedpenalty is ×1.5, the weightonlinealready 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.onlineEventsis deliberately not partitioned, onlyregion.events.RegionViewcan 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=soonestis untouched — but it is a judgement call worth confirming.src/config/translations.en.jsonis hand-edited here, whichAGENTS.mdnormally forbids.pnpm sync:translationsneeds 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 ownseeds/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.CHANGELOG.mdstays 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.confidenceScore's admin copy) and refactor(list): move sortEvents into src/lib/shape/sort.ts #222 (movesortEventsintosrc/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
Alertatom 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.
RegistrationViewrenders 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.tsxpins 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_STAGEpins it withsatisfiesagainst the synced CMS union — the same guardRegistrationQuestionsSchemacarries (#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.
verificationStageon 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.confidenceScorestaying 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-formmarker, 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 thannull, 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 onregisterInline(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
soonestarm of the sort spec cannot distinguish anything." It can. Wrapping thesoonestbranch 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=recommendedwas ruled out by the reviewer and would override distance and language both. Badging inEventChipswas 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;AlertrendersReactNodechildren with nodangerouslySetInnerHTML; andverificationStagecarries no field-level access control in SahajCloud, so adding it to aselectgrants nothing the key did not already have. This round moves one render site within one file — no new origin, attribute, or style injection, sodocs/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