-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs to switch between term pages for legislatures/houses in a single country #13598
Conversation
@@ -70,8 +70,5 @@ DEPENDENCIES | |||
sinatra! | |||
yajl-ruby | |||
|
|||
RUBY VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change was added because I ran bundle install
before starting work. Not sure whether it's needed or not? @tmtmtmtm @chrismytton
Makes it easier to move from, for example, a country’s lower to upper chamber. Will also help people navigate once executive branch is included (#13297).
Also includes some fixes for various term_table page elements that were causing horizontal scrolling on narrow screens.
b102f6d
to
dc9ece3
Compare
Thanks @zarino. I'm having difficulties getting this running at the minute, as |
<ul class="house-tabs"> | ||
<% @country[:legislatures].each do |house| %> | ||
<li> | ||
<% latest_term = house[:legislative_periods].sort_by{ |term| term[:start_date] }.last %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already pre-sorted (though in most-recent-first order), so you just need a house[:legislative_periods].first
there (which also means you can probably inline it rather than setting up a latest_term
).
@zarino The behaviour of always jumping to the most recent term for a country surprised me a little here — e.g. when I was on Was it an explicit decision that that's what the behaviour should be? |
@tmtmtmtm: Yeah, it's not really what I wanted it to do. In an ideal world it would switch to the term, I guess, with the most overlap with the current term you're viewing. (I'm assuming terms don't necessarily increment at the same times, or have synchronised IDs between legislatures?) |
Yeah — in some countries they'll pretty much always be in sync, but in others they'll be quite significantly different. Plus of course, they're not always two current houses of the same legislature. Most overlap seems like an interesting way to go about it… |
Yeah, at least then you end up staying at roughly the same period in time. A simpler alternative might be to switch to the term with a start date closest to the start date of the term you're looking at. |
I think I'd be more inclined to make that a check on the end date rather than the start date, unless there's a case I'm overlooking? (I'm imagining a scenario where the Upper house has 6 year terms, and the lower house 3 year terms, where if I'm looking at the current term in the Senate, and then switch to the lower house, I'd end up on the previous term, rather than the current one…) |
I'm also not sure whether we should just go live with what we currently have, and potentially surprise some users in the meantime whilst we fix this up, or whether this is worth spending a bit of extra time doing the right thing now… |
It's hard to tell when we don't have any analytics data yet on how people navigate these pages. I'm typically in favour of small incremental changes. But I'm a bit worried this is a sufficiently annoying thing that, if it happens, you'll just think the site is broken. Or, more perniciously, you might get switched to the wrong term without noticing. Whatever we pick, there's always going to be a chance of people landing on the wrong term. Your suggestion of going by the end date is interesting, and certainly makes sense when you're switching from the most recent term. I just wonder whether it also makes sense when you're looking at historical terms? |
Yep — that's my fear too. If a change clearly adds value with no negatives, I'm all for pushing it through, even if that value is miniscule. But here I'm worried that it adds possible negative value as well as the positive, so I'm more cautious.
I think it does. The one case where it might be odd is if you're looking at the first term in a country and then switch house, and end up on the second term of the other house. But that one doesn't worry as much as the opposite. What this might all be telling us, of course, is that these tabs shouldn't be taking us to term pages at all, but just to the front page for that legislature. And the problem is that there's currently no such thing… |
Two worries about this:
|
I think we're uncovering something quite interesting here, as now I'm unsure whether these should be tabs or not. To me the primary thing we're dealign with here is the ability to switch to another sub-entity of the current country, and only secondarily to switch to an equivalent page — i.e. I currently see this as being something that's much more connected to what's above it, than to what's below it. I suspect part of the difficulty in reasoning about this is because we mostly only really have one type of page per legislature, and currently only one type of 'entity' we're dealing with. And whilst I definitely think we should work with what we currently have, rather than what we're hoping to have in the future, I'm a little way of introducing patterns that will completely break in other contexts if we can spot up-front something that would more naturally work both now and in the future. To spell this all out a little more (as much for my own sake, as anything else), the only "Organization" (for lack of more precise terminology) we're dealing with here is a Legislature at the minute. In countries where we currently have more than one entity, those are of two types:
Soon we will have a third, connected but more distinct, version with executive level ones, e.g. the UK Cabinet. At a future data we may also have sub-national legislatures etc too (e.g. the legislatures of each of the US States). [NB: I don't think we need to pay a lot of attention to this yet, as that's probably quite a way off, and we'll likely have to rethink a lot of other core stuff when we get to that stage. Listing here purely for completeness] Within each of those we currently only really have the Term-table pages. Reasonably soon it's highly likely that we'll have other types of things too. In practice we do currently have other pages too, except we're careful not expose those on the static site. Interestingly the main one of those is now broken: https://everypolitician-viewe-pr-13598.herokuapp.com/australia/senate/wikidata The breakage seems to be from an earlier change, which we'll need to track down, but the interesting question is whether that page should also have a way to get to the other house. My initial impression is that it should, but I guess I do expect that that would take me to the equivalent Wikidata page for the House of Representatives, rather than a 'front page' for it, which somewhat contradicts where I started this comment from, so I think I need to go away think about this a lot more! |
I've fixed the broken Wikidata page in #13743; might be worth rebasing this over that so we can reason better about what that page should do under this PR… |
Adds tabs to the top of the term_table pages, serving the dual purpose of making it clear which legislature/house is currently selected, and also making it easier to switch between legislatures/houses without having to go back "up" to the country-level page.
Country with more than one legislature:
Country with only one legislature:
Part of #13297, but actually quite beneficial to deploy on its own, since it improves the current experience.