mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Put the parties with the most candidates at the top of the party drop-down #822

Closed mhl closed 8 years ago

mhl commented 8 years ago

A first pass at this - no tests yet, and it doesn't do the nice formatting of right-aligning the candidate numbers as Zarino's sketch suggested, but it's a start:

ranked-parties

JoeMitchell commented 8 years ago

Oooh, this is exciting! Formatting is definitely only a 'nice to have'.

jf1 commented 8 years ago

This will be such a time-saver as-is, so hope it goes live asap.

Agree with Joe that Zarino's formatting would be nice, but the lack of it shouldn't hold up deployment.

I do wonder if the UK version would benefit from the 'big 5' parties being sorted alphabetically, to prevent their order changing so people can quickly select from a stable list. Or might the UK version suit having its lists sorted by 'most candidates in this country' to enable Plaid and SNP to be shown at the top of lists where they're likely to be present?

tfgg commented 8 years ago

I was just thinking the same thing as jf1, it'd be good if the order could be somewhat stable over time. Perhaps alphabetically sort in blocks of a few hundred candidates? On 12 Apr 2016 12:34 pm, "jf1" notifications@github.com wrote:

This will be such a time-saver as-is, so hope it goes live asap.

Agree with Joe that Zarino's formatting would be nice, but the lack of it shouldn't hold up deployment.

I do wonder if the UK version would benefit from the 'big 5' parties being sorted alphabetically, to prevent their order changing so people can quickly select from a stable list. Or might the UK version suit having its lists sorted by 'most candidates in this country' to enable Plaid and SNP to be shown at the top of lists where they're likely to be present?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mysociety/yournextrepresentative/pull/822#issuecomment-208857787

wfdd commented 8 years ago

On another point, when looking for 'Labour', the first result shouldn't be Democratic Labour. I'd expect the results to be sorted according to their proximity score. Perhaps the algorithm should weigh proximity with the number of candidates? I don't know if chunking is a good idea; at least, not when the list isn't being filtered. We could have the top x parties listed at the top, and then a little divider like you might have in a country dropdown, and everything else following that.

jf1 commented 8 years ago

I'd always been mindful that different countries might have a different number of 'big' parties, and that multiple chunks each with their own sort isn't ideal, so would suggest at most two chunks / one divider, with a variable so each local install can choose how many parties will be 'prioritised' and placed in alphabetical order at the top of the list.

All that said, it's not clear if there's an overall benefit from the split-list approach described above, so it's certainly not something I'd encourage to be prioritised.

The main reason I've come back to this thread is to comment after using experiencing the feature: As currently implemented, it is is such a (sanity- and) time-saver, so thanks @mhl.

mhl commented 8 years ago

@wfdd I think that changing the item that's highlighted to be partly based on string proximity would need changes to Select2, unfortunately. I'm sure it could be done, but I think the reaction from people who've used this variant has been positive enough that I'd like to merge this anyway as an incremental improvement.

@tfgg Plaid Cymru and the SNP do come much closer to the top of the list with this variant, of course. I think the best solution to having them higher in Wales and Scotland is to have separate PartySets for England, Scotland, Wales and Northern Ireland, rather than just Great Britain and Northern Ireland. We used the latter split because those are the two registers kept by the Electoral Commission, but as @andylolz has pointed out the EC also have "Field candidates in Scotland?" etc. fields so we could build the more specific party sets.

I'm not bothered by the stability of the top parties myself; having done quite a bit of candidate entry over the last week, my feeling is that experienced users will get the right party by typing a couple of characters after tabbing into the party select, and less experienced users will have to actually look at the drop-down anyway.

Anyway, as above I think we should merge this (@struan's reviewing it this morning)

struan commented 8 years ago

This looks good to me.