feat: crowdsourced verification tab with flashcard task mode#116
Conversation
Adds /verify page with two modes: - Task mode: serves one (entity, field, value) card at a time, prioritised by least-verified first, requiring Confirm / Flag / Skip before advancing. Votes write to field_feedback (same table the map reads for vote badges). - Browse mode: existing full-entity review UI preserved behind a tab. DB: ALTER TABLE verification_correction/review to add voter_id and drop NOT NULL on legacy reviewer_key_id; fix GIN index ordering in migrate.js. ESLint: add dev-server.js to Node globals block so process/console.log are recognised. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Neon preview branch readyThe full connection string is available to workflow steps on this PR |
Deploying mapping-ai with
|
| Latest commit: |
66fa12f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://809d139b.mapping-ai.pages.dev |
| Branch Preview URL: | https://alor-crowdsourcedverificatio.mapping-ai.pages.dev |
- Add welcome popup on first /verify visit (sessionStorage-gated) - Fix field_feedback unique constraint: drop vote from key so each user has one vote per field; upsert instead of silently ignoring - Add voter_id-leading indexes for rate-limit and already_voted queries - Remove dead field_notes query from entity API - Extract submitReview helper, fix optimistic delete rollback, surface queue 1load errors with retry - Expand map welcome popup tips inline (remove collapsible) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…polish - field-feedback.ts: ON CONFLICT now targets (entity_id, field_name, voter_id) and updates the vote in place, matching the migration that dropped `vote` from the unique key. Without this the map's field-vote arrows 500 once a voter changes or repeats a vote. - dev-server task_vote: same DO UPDATE semantics so local mirrors prod. - verify: gate the onboarding popup behind a localStorage flag (first load only), and sanitize entity.notes_html with DOMPurify before dangerouslySetInnerHTML, matching every other render site.
|
Reviewed and tested this end to end: local quality gates plus the Cloudflare preview driven with a browser. Really nice feature, the flashcard flow is smooth and the Browse review UI is polished. I pushed a few fixes directly to the branch (commit d30dc33), details below. Fixed on the branch
All four are verified on the rebuilt preview. Worth considering before merge (non-blocking)
Everything else checks out: typecheck, lint, format, 120 tests, and the production build are all green, and the flashcard and Browse flows work against the preview DB. |
Brings the branch up to date with main: WelcomeOverlay NPR Marketplace link and the claude-sonnet-4-6 enrichment-script migration.
The flashcard VerifyTask only handled free-text and single-select for the corrected value, so multi-select fields (threat models, funding model, evidence sources) fell through to a free-text box. Browse mode's CorrectionForm shows the allowed options for these. Add the same multi-select control to the flashcard so both surfaces match.
|
Two follow-ups pushed:
Both are green on typecheck, lint, format, and build, and verified on the rebuilt preview. |
|
(anushree confirmed its ready for merge, so merging in!) |
Two modes:
a time, prioritised by least-verified + most-connected. Confirm / Flag /
Skip before seeing the next card. Prevents selection bias toward popular
entities. Votes write to field_feedback, the same table the map reads for
vote badges.
with error type + corrected value, mark complete with timer.
Also: onboarding popup on first load, fixed field_feedback unique constraint
(dropped vote from key so each user has one authoritative vote per field),
added voter-leading indexes for rate-limit queries, dropped legacy NOT NULL
on reviewer_key_id left over from an older branch schema.
Preview: https://drive.google.com/file/d/19EbU0smwttOQi_Cm8dbsKenKU9-dZyx7/view?usp=sharing