Skip to content

SoPN indication#2666

Merged
symroe merged 18 commits intomasterfrom
sopn-indication
Mar 18, 2026
Merged

SoPN indication#2666
symroe merged 18 commits intomasterfrom
sopn-indication

Conversation

@symroe
Copy link
Copy Markdown
Member

@symroe symroe commented Feb 21, 2026

This is a bucket'o'changes that all focus on some easy wins in the UI.

Some of them are in direct response to feedback we've got, some of them are things I noticed while working on the project. I'll try to break them out.

Icons

There are some areas where we use icons to indicate something. This is generally useful for power users (as most users are), but less useful for new users. We've moved to using both icon and text where we can.

Still TODO:

  • Icons on suggest lock review form
  • Mop up areas where we only use icons still
  • Ensure we're using icon + text everywhere.

SOPN upload indication

Fixed a minor bug on the all elections page that didn't show if a SOPN was uploaded to a ballot.

This is written as "At present it’s not obvious whether a ballot has a SoPN or not" and is addressed in f9b4a1c.

Add candidates button on ballot page

I've made a number of changes here.

  • For anonymous users I've hidden the 'add new candidate' button in the window between SOPN uploaded and the ballot being locked. This isn't a useful thing to ask someone to log in for, most of the time. 25129bb

  • In ea384b8 I revert the earlier change to hide the button if we have a SOPN, but I do mark it as a secondary CTA. This means it's still possible, but it's not competing on the page to be the main CTA.

Move all SOPN related CTAs to the top of the page

When we have a SOPN we:

  • Link to the above the table
  • (If the ballot isn't locked) show a link to bulk add
  • (If the user can lock and there is a suggestion) Show a link to the lock review form
  • (If there is a SOPN) show a link to the suggest lock form
  • (If the user can unlock) Show a link to the unlock form

This groups all the 'Do a thing with a SOPN' actions to one place, and hopefully makes things a little clearer.

This is confusing for new users, and the 'unlocked' icon is very unclear
It's not useful to ask users to add a single canddiate when we have a
SOPN
@symroe
Copy link
Copy Markdown
Member Author

symroe commented Feb 21, 2026

Closes #756

@symroe symroe requested a review from chris48s February 21, 2026 09:31
Comment thread ynr/apps/candidates/models/popolo_extra.py Outdated
Comment thread ynr/apps/elections/templates/elections/ballot_view.html Outdated
Move the election to the heading and make everything smaller apart from
the ballot name
@symroe symroe force-pushed the sopn-indication branch 3 times, most recently from 095bec5 to a23c466 Compare February 28, 2026 21:07
@symroe symroe force-pushed the sopn-indication branch 4 times, most recently from 5e61f50 to 5727fc3 Compare March 1, 2026 11:01
@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 1, 2026

One thing to note is that the template indenting is all over the place. I've had to disable my editor's indenting as it's going to change everything. Once this PR is in I'd like to shove djhtml in this project to keep it in line with other projects and do a big reformattting commit. Let's ignore indending for the time being.

@symroe symroe force-pushed the sopn-indication branch 2 times, most recently from e706644 to c92d049 Compare March 3, 2026 15:09
@symroe symroe requested a review from chris48s March 3, 2026 15:10
@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 3, 2026

@chris48s I'm calling this ready for review. There's loads to do when you start pulling at the thread, but I reckon this is a reasonable stopping point.

Reading the commit messages should be useful if not let me know and I'll amend them.

I've force pushed, but mainly to deal with linting errors when pushing a fixup wasn't useful.

I've been checking the whole process of a ballot from unlocked with no SOPN, to SOPN, to locked, via suggested locking. You'll either need two user accounts or to change the suggesting user to a different user ID after you suggest locking.

@chris48s
Copy link
Copy Markdown
Member

Right. This is quite a difficult PR to review because there's so much going on I'm sure there are some situations affected by this PR that I haven't worked out how to get myself into, but I'll give it a go..

Comment thread ynr/apps/candidates/models/popolo_extra.py
Comment thread ynr/apps/elections/templates/elections/ballot_view.html Outdated
Comment thread ynr/apps/elections/templates/elections/election_list.html Outdated
@chris48s
Copy link
Copy Markdown
Member

button-order

In this case, I reckon put "add a new candidate" button at the bottom, rather than at the top.

Then if you expand the form, the "Save changes" button isn't next to a bunch of other primary buttons. It is clearer what to do next

@chris48s
Copy link
Copy Markdown
Member

disconnect

In this situation, I feel like the text explaining what is going on and the actions to take as a result are very disconnected.

@chris48s
Copy link
Copy Markdown
Member

Once this PR is in I'd like to shove djhtml in this project to keep it in line with other projects and do a big reformattting commit. Let's ignore indending for the time being.

👍

@chris48s
Copy link
Copy Markdown
Member

In your top post, there's one checklist item that is still un-checked:

(If the user can lock and there is a suggestion) Show a link to the lock review form

Is that intentional? It looks like that did get done to me

@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 12, 2026

In your top post, there's one checklist item that is still un-checked:

(If the user can lock and there is a suggestion) Show a link to the lock review form

Is that intentional? It looks like that did get done to me

Sorry, no I should explain: this isn't done becuase it's going to get done later. We currently show a 'lock' button when there's a suggestion, but there's no deep link to the form at /moderation/suggest-lock/<ballot> at this stage. That's mainly because that URL doesn't exist yet, and I didn't want to get into adding it in this PR. It needs moving to a task on the PR that alters that review form.

@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 12, 2026

button-order

In this case, I reckon put "add a new candidate" button at the bottom, rather than at the top.

Then if you expand the form, the "Save changes" button isn't next to a bunch of other primary buttons. It is clearer what to do next

2205600

@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 13, 2026

disconnect

In this situation, I feel like the text explaining what is going on and the actions to take as a result are very disconnected.

I agree wit this, but I'm not really sure what to do about it. I'm trying to move away from 'put everything at the top of the page' and I want to keep the status of the ballot in one place.

There aren't very many people who will see this code path, as there are ~100 people who can actually lock ballots.

So, I've added a callout panel and added some extra text to it. I don't really think this is beautiful, but it's not a lot worse than what we had before?

image

@chris48s
Copy link
Copy Markdown
Member

I like the approach/design, but there's a couple of issues with the logic for showing and hiding it:

  1. I am seeing this "lock suggested" callout even on ballots that are already locked
callout1
  1. On ballots without a lock suggestion, I've got an empty box
callout2

Can you have a look at these bugs

@chris48s
Copy link
Copy Markdown
Member

chris48s commented Mar 18, 2026

There's a few problems with "Add Candidates" buttons now:

  1. There's a bit of a "wrong number of cells in the row" bug here
Screenshot at 2026-03-18 14-11-48

..but not always. Sometime it is in the right place:

Screenshot at 2026-03-18 14-13-09

Also, is the button supposed to sometimes be a different colour? What does the green vs grey signify?


  1. I think we only need the button the once in this situation
Screenshot at 2026-03-18 14-12-57

Good catch on the welsh run ballots, I've fixed that.

With the duplicate buttons: this was some boolean logic parsing issues, it's not meant to show if there is a SOPN. I've fixed this too.

The colours remove focus when there's a SOPN: the main CTA is to bulk add not to add a single candidate, but as we agreed, it's still possible to do.

@chris48s
Copy link
Copy Markdown
Member

chris48s commented Mar 18, 2026

Spotted a few more minor bugs here, but I think this is very close to done.

In general, this is making things better so I think fixing those and then getting it in front of some users is probably higher priority than further bikeshedding on some of the outstanding rough edges.

@chris48s
Copy link
Copy Markdown
Member

I think this is enough better than what we have now and sufficiently not-broken that we can merge it.

That said, I reckon in a case like this one, where we have 1 or more candidates and a SOPN

Screenshot at 2026-03-18 16-38-21

"Add new candidate" is still in a sub-optimal place because you end up with 2 primary action buttons (the "save changes" and "suggest locking") next to each other at the bottom of the form that opens.

I think I'm fine if you just want to merge it and note this for another time.. but also fine if you want to go one more round to try and clear that up.

@symroe
Copy link
Copy Markdown
Member Author

symroe commented Mar 18, 2026

I think this is enough better than what we have now and sufficiently not-broken that we can merge it.

That said, I reckon in a case like this one, where we have 1 or more candidates and a SOPN
Screenshot at 2026-03-18 16-38-21

"Add new candidate" is still in a sub-optimal place because you end up with 2 primary action buttons (the "save changes" and "suggest locking") next to each other at the bottom of the form that opens.

I think I'm fine if you just want to merge it and note this for another time.. but also fine if you want to go one more round to try and clear that up.

I think that's sensible, but one thing I'm going to do after the initial bulk adding re-work is to prevent bulk-adding again after someone has gone through it once. At this stage we'll know if someone has gone through it at all, and I reckon we should hide / change the 'suggest' button, or maybe only allow people who can lock to see it.

Point is: I reckon I'll re-visit this later anyway. I'll clean this up and merge.

symroe and others added 12 commits March 18, 2026 16:46
Combine a bunch of logic and move everything to the top of the page in a
status block.
This is especially needed when there are no candidates on the ballot
I think this is a nicer way to link 'candidate actions' with the
candidate table, leaving other actions to be 'ballot actions' in a
fucutre commit.
In CI we fail if ruff format fails, but we don't fail pytest. This means
local devs need to remember to run format before pushing. This change
means that pytest will fail if ruff format would make changes
This just makes everything look a bit neater
This includes a better inline suggest lock form.

In a future PR we will add better links to the lock review page, but I'm
ignoring that feature request here.
@symroe symroe merged commit 18c0dc7 into master Mar 18, 2026
6 checks passed
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