Skip to content

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

Description

@Ardnived

Summary

Events with verificationStage: 'unverified' are published and appear in the widget indistinguishable from coordinator-verified classes. Neither the event read (src/config/api/fetch.ts:605-628) nor the geojson feed select (:75-113) requests verificationStage, so the widget cannot tell them apart. sydevs/SahajCloud#828 is about to publish hundreds of unverified listings per country and is blocked on this.

Approach

Per the reviewer (2026-09-21): the badge appears only on the event page — never on map markers or list cards — every unverified event is marked identically, and confidenceScore is not displayed.

What counts as unverified

verificationStage === 'unverified', exactly. SahajCloud's stage table (src/lib/eventVerification/stages.ts:107-170) makes unverified, verified, reminded, escalated, urgent and finished published; denied and expired are unpublished, and finished is dropped from the feed by notFinishedWhere. So unverified is the only publicly listed stage with no manager vouching for the event. The reminder-ladder stages are all managed and must not be badged.

1. Read the field (detail only)

  • src/config/api/fetch.ts:605-628 — add verificationStage: true to getEventDoc's select. Do not add confidenceScore.
  • src/types/event.ts:181 — add verificationStage to EventDocSchema, nullish and tolerant of an unrecognised value (a narrowed z.string().nullish(), or an enum with a fallback). Two reasons: a live-preview proposal for a new event carries no stage (the same reason region is nullish there, Event submission preview — render a user-submission proposal from postMessage #163), and SahajCloud can add a stage — a strict enum would fail the whole event read and blank the page.

2. Badge on the event page only

  • Render it in src/components/organisms/EventDetails/EventDetails.tsx:88, above EventChips, as an Alert (src/components/atoms/Alert, variant="flat", size="sm").
  • ⚠ Not in EventChips (src/components/molecules/EventChips/EventChips.tsx). The list card and the event header share that component, so a chip added there lands on cards too — the surface the reviewer excluded.
  • Copy comes from sy-atlas-translations: event.display.unverified_title / event.display.unverified_note. That key does not exist yet — see Notes.

3. Rank unverified listings lower, without touching the existing orderings

Three lists, three answers:

  • Search results under ?sort=recommended — calculateOrder (src/components/organisms/EventsList/DynamicEventsList.tsx:45-55) multiplies a distance base by relevance factors (wrong language ×2, online ×1.5, soon ×0.5). Add one more factor for unverified. It composes with the existing score instead of overriding it, which is what "subtle" asks for. A partition here would override distance and relevance both.
  • ?sort=closest / ?sort=soonest — untouched. Those are literal orderings (byDistance, byNextOccurrence), and reordering them makes the label false.
  • Region lists — region.events (src/config/api/fetch.ts:488) renders in feed order, with no ranking at all today; only onlineEvents sorts, by next occurrence (:490). A stable partition there — verified first, relative order otherwise preserved — compromises nothing, because there is nothing to compromise.
  • Calendar (getCalendarEvents) is a grid by date. Unchanged.

The list ranking needs the field in the feed, which the detail read does not cover:

  • src/config/api/fetch.ts:75 — add verificationStage: true to FEED_SELECT.
  • src/types/event.ts:137 — add it to AgnosticFeedEventSchema, nullish as above. FeedEventSchema and EventSlimSchema inherit it.

4. Specs

  • src/types/event.test.ts — the field parses on both schemas, and an unrecognised stage degrades instead of throwing.
  • renderToStaticMarkup specs: the badge renders in EventDetails for an unverified event, and EventListItem renders none for the same event.
  • A sortEvents spec: unverified ranks below an otherwise-identical verified event under recommended, while closest and soonest are byte-identical to before.
  • ⚠ A new assertion is not finished until it has FAILED — docs/testing.md.

Acceptance criteria

  • An event with verificationStage: 'unverified' shows the badge on its detail page. verified, reminded, escalated and urgent events show none.
  • No map marker, popup or list card carries any unverified indicator.
  • confidenceScore appears in no request and no UI.
  • Under ?sort=recommended, an unverified event ranks below an otherwise-identical verified one. ?sort=closest and ?sort=soonest order exactly as they do today.
  • In a region list, unverified events follow verified ones, and the relative order inside each group is unchanged.
  • An event whose verificationStage the widget does not recognise renders with no badge and no error boundary.
  • pnpm lint, pnpm typecheck and pnpm test:run pass.

Verification checklist

  • pnpm test:run
  • pnpm dev, then open an unverified event's page: the badge renders once, above the chips, and that event's card in the list behind it carries none.
  • Network tab: the /events/geojson request's select includes verificationStage; the /events/<id> request's includes verificationStage and not confidenceScore.
  • To get an unverified event locally: verificationStage is readOnly in the admin (SahajCloud src/collections/Events/Events.ts:574-586), so set it through the local API with context: { skipVerifyHook: true }, as src/collections/UserSubmissions/lifecycle/review.ts:189-194 does. Editing the field in /admin does not work.

Open questions

  • What penalty does recommended apply? ×1.5, the weight online already carries, is a starting point. Anything that always outranks distance is the partition the reviewer ruled out.
  • Ranking unverified listings among themselves by confidenceScore: SahajCloud's field doc states the Atlas does this (src/collections/Events/Events.ts:624-645). Dropped here, on the reviewer's "all marked the same" and on feed weight. If it stays dropped, that SahajCloud comment is wrong and should be corrected.
  • The feed is fetched whole, pagination: false. One enum string per feature is cheap now. Re-measure after feat(events): bulk-import events into a region from CSV SahajCloud#828 imports hundreds of listings per country.
  • Does the badge vary with confidence? No. Every unverified event is marked identically.
  • Badge on markers and cards? No. Event page only.

Notes

Blocked by: sydevs/SahajCloud#829 — the badge copy must exist in sy-atlas-translations first, because src/config/translations.test.ts fails any t() call whose key the committed snapshot does not answer

Blocks: sydevs/SahajCloud#828.

  • Split out of feat(widget): submit or correct a class, and opt into a mailing list #147 §1, which keeps the submission form and voting.
  • No host-facing contract change: no new origin, attribute or CSP entry, so docs/embedding.md and CHANGELOG.md stay untouched.
  • A finished event that was never adopted reads as finished, not unverified, so an old link to one shows no badge. Accepted: it is off the feed either way.

Related

Activity

  1. added theissue type on Sep 21, 2026
  2. Ardnived commented on Sep 21, 2026

    @Ardnived
    ContributorAuthor

    @sydevs-bot Revise and flesh out this ticket. Note that we shouldn't need confidenceScore in the display. All unverified events should be marked in the same manner. Additionally don't include any indicator of the unverified status on the event markers or cards, just on the event pages.

    Subtly de-prioritizing unverified events (like listing them lower than verified events) is a good idea, but we also don't want to compromise the existing ranking system by doing this

  3. added
    bot:working
    and removed on Sep 21, 2026
  4. moved this from Proposed to Revising in SYDevelopers Technical Roadmapon Sep 21, 2026
  5. sydevs-bot commented on Sep 21, 2026

    @sydevs-bot
    Contributor

    🤖 no session running

    recent dispatches
    • 22:37Z implement · attempt 1 · session · done
    • 22:37Z implement · attempt 1 · session
    • 18:58Z revise · attempt 1 · session · done
    • 18:58Z revise · attempt 1 · session

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

  6. sydevs-bot commented on Sep 21, 2026

    @sydevs-bot
    Contributor

    Badge is event-page only. It lands in EventDetails.tsx:88 as an Alert, not in EventChips — the list card and the event header share that component, so a chip there would show on cards too.

    confidenceScore is out of both the reads and the UI. SahajCloud's field doc claims the Atlas ranks by it (Events.ts:624-645), so that is now an open question.

    Ranking splits three ways. recommended gets one more multiplier in calculateOrder (DynamicEventsList.tsx:45-55), composing with distance and language instead of overriding them. closest and soonest stay literal. Region lists have no ranking at all today, so a stable verified-first partition there compromises nothing.

    Unverified means verificationStage === 'unverified' exactly. Every other published stage has a manager vouching for it.

    New blocker: sydevs/SahajCloud#829, the copy key. translations.test.ts fails any t() whose key the committed snapshot cannot answer.

    Retitled for the narrowed scope. Effort stays Moderate.

    @sydevs-bot implement starts the work.

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

  7. changed the title [-]feat(widget): badge unverified listings on map, cards and detail[/-] [+]feat(widget): badge unverified listings on the event page[/+] on Sep 21, 2026
  8. added and removed
    bot:working
    on Sep 21, 2026
  9. sydevs-bot commented on Sep 21, 2026

    @sydevs-bot
    Contributor

    @Ardnived unblocked: every blocker is closed. Say @sydevs-bot implement to start.

    🤖 sydevs dispatcher

  10. Ardnived commented on Sep 21, 2026

    @Ardnived
    ContributorAuthor

    @sydevs-bot implement

  11. added
    bot:working
    and removed on Sep 21, 2026
  12. moved this from Revising to Approved in SYDevelopers Technical Roadmapon Sep 21, 2026
  13. removed
    bot:working
    on Sep 21, 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

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions