Skip to content

Write in candidates#1262

Open
jacksonloper wants to merge 18 commits intomainfrom
JacksonLoper/writeins
Open

Write in candidates#1262
jacksonloper wants to merge 18 commits intomainfrom
JacksonLoper/writeins

Conversation

@jacksonloper
Copy link
Collaborator

@jacksonloper jacksonloper commented Mar 5, 2026

A very minimal write-in candidate frontend implementation based on Mike Franze's backend work. If write-ins are checked as allowed for a race....

Voter experience

Voter can add write in candidates to that race, which then get treated as if they were there the whole time by the frontend (these should be kept to the bottom since they are "special" like none of the above).

Screenshot 2026-03-05 at 12 22 09 PM

Frontend treats all trim-lowercase as the same "name" and so refuses to add JOHN if John has already been added.

Screenshot 2026-03-05 at 1 41 45 PM

Admin experience

Admin will see for those races a fun little new icon

Screenshot 2026-03-05 at 12 20 14 PM

If they click on it they will be taken to an approval page where they can approve or disapprove and set the official name of a write-in candidate

Screenshot 2026-03-05 at 12 46 55 PM

Results page

Tabulation then treats approved candidates as normal and others as ignored. User sees something like this in the results

Screenshot 2026-03-05 at 12 25 40 PM

Closing thoughts

This approach essentially (1) ignores capitalization (2) lets admin pick "real name" and (3) doesn't let admin merge "JFK" and "John F Kennedy". It is conceptually simple, weak, but i think viable for "ticking the box" in elections where bylaws require it. Basically election admins won't even know that our backend supports an aliasing system that can support admin-specified write-in merging. When we're ready (or if anyone asks for it) we can implement the rest.

Here's my rationale for not implementing frontend for the candidate merging in this PR: write-in-merging has insane edge cases. Here's one example, but I fear there may be lots like this. What if a voter makes writein "JFK" and gives them 3 stars and also "John F Kennedy" and gives them 5 stars in a multi-winner election, and admin merges "JFK" and "John F Kennedy"? How should ballot be counted? It would seem to necessitate either A Choice or else A Complicated User Interface for admins to handle the mess. I don't want to make either of those things if I can avoid it 😄.

@netlify
Copy link

netlify bot commented Mar 5, 2026

Deploy Preview for bettervoting ready!

Name Link
🔨 Latest commit a6daaf4
🔍 Latest deploy log https://app.netlify.com/projects/bettervoting/deploys/69ab34042e9cb7000892f372
😎 Deploy Preview https://deploy-preview-1262--bettervoting.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jacksonloper jacksonloper requested a review from ArendPeter March 5, 2026 17:55
@jacksonloper
Copy link
Collaborator Author

jacksonloper commented Mar 5, 2026

The nefariousness-avoiding commit made tests fail!

Screenshot 2026-03-05 at 2 53 43 PM

When our ballots have "null" my nefariousness checker doesn't like it. In general submitting strings for ballots could be bad (think 0+"5" = "05" = cascading failure of tabulation 😂 ). I'll contemplate and make a plan tomorrow or next week!

[edit] yep fixed. its just a matter of accepting numbers OR nulls in the validation step. no need to ever accept strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants