mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 50 forks source link

Better handling of dual mandates #1706

Open ajparsons opened 1 year ago

ajparsons commented 1 year ago

Looking at the https://github.com/mysociety/theyworkforyou/issues/1704 (Mayor of London is former MP), this a specific case of a general problem.

We have a unique page for a person, but a person may not only move from one body to another over time, but be in multiple bodies at once.

This currently applies to:

This is despite the fact we do have URL syntax that would allow the same person to be referenced in multiple Parliaments.

The problem is the MP pages are all set up around the person model, and default to the 'latest' thing that is happening to that person (which can lead to confusing descriptions in the above).

We can fix this, with varying degrees of effort:

  1. Add requirements around the representative type to items in the templates that only affect MPs. This fixes the Mayor of London problem, where their past life as an MP becomes inaccessible in favour of a clearer description of the present (preferable to current arrangement).
  2. Allow multiple valid URLs for a person - in combination with the above, this would mean former MPs profile could be linked from their new profile (not losing history).
  3. Varying degrees of untangling to handle current duel mandates: a. Need to adjust how links to representatives are generated so the 'correct' URL for a chamber is created through postcode search, lists of MPS etc. b. Potentially untangling how appearances etc are generated so only appearances for the relevant body appear on the right page.

I think going as far as 1 solves my problem for now, but the rest feels like it can be chipped away at over time.

dracos commented 1 year ago

"2. Allow multiple valid URLs for a person - in combination with the above, this would mean former MPs profile could be linked from their new profile (not losing history)." - all the URL combinations for a person do/should work? https://www.theyworkforyou.com/peer/11963/baroness_clark_of_kilwinning https://www.theyworkforyou.com/mp/11963/baroness_katy_clark https://www.theyworkforyou.com/msp/11963/katy_clark What do you mean by losing history - everything is still there, it's just most recent first? I think one URL per person is deliberate, I'm not sure we want to have multiple different URLs for a person just because they've been in more than one house - if they were an MP, become an MSP, then go back to being an MP, seems odd to split their information/summary across two locations? I realise some is only house-applicable but some is not - perhaps this could be served as sub pages of a person for each house or similar?

ajparsons commented 1 year ago

I meant there that those URLs don't go to separate places - so if I start putting in logic to hide Sadiq Khan's MP past, there's no 'mp' link I could go to get it back - it's not a problem yet, but I would make it one if I went down that path.

I'm not sure of the best approach here. This another version of our growing "range of time" problem, because we have more information about MPs, it's taking precedence even for people who haven't been an MP in some time.

That's easy enough to fix for former MPs but the duel mandates just don't work well. We could go the tab approach - but then we might need to change the tab names to be clearer which we were talking about in which case. Given there's not many of them, it might be better to do that than a big restructure for an edge case.

So I guess a lighter set of actions:

That does feel a bit more practical to do.