You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@boboroshi, one of the features that we'd discussed for the UI was the ability to provide preview data of the contents of structural units. So in a listing of titles of the Code of Virginia, it could be possible to scrub over the listing of titles or select a disclosure triangle or something to display another line or so of information. (Or maybe just use any remaining space to the right of the structure's name.) Within that line, we might display the most-read chapters of a given title, or the most-read laws within a given chapter, or something along those lines. This is going to be especially useful for legal codes with bad—or no—titles for their structural units.
Is that a thing? If not, can we make it a thing? :)
I haven't pictured a hover pop-up, but instead an expanded excerpt area, but that's not to say that it couldn't work. :) I think what an expanded excerpt area (or maybe just using any available space to the right on the existing, allotted space) has going for it that it becomes possible to have "open all" functionality, to let people scan through a detailed listing, should they prefer it. (I intend to add user preferences, to let people set options like that to affect how the site works for them, so that could be stateful.) That could then be a default site for legal codes with crappy/no titles on their structural units.
So, in Virginia, Title 18.2 ("Crimes and Offenses Generally") is the most-read title. "Crimes Against Property," "Crimes Involving Morals and Decency," "Crimes Involving Health and Safety," "Crimes Against Property," and "Crimes Against Peace and Order" are the most-read chapters of that title, in that (descending) order. That's the sort of material that I have in mind.
@boboroshi and @krues8dr, could y'all put together my loopy one-line preview idea, in CSS and JS? (Bill, your JS skills are way better than mine, so it'd be faster for you to do it.) I wouldn't put any work into polishing it, but just put together a functioning prototype, so that if this really is a terrible idea, we can bail and move to the obviously easier model that y'all understandably prefer.
Specifically, I'm thinking that a mouseover over a <dd> turns the blank space within that <dd> (everything to the right of the existing text within that definition) into a view of Ajax-called data, displayed inline using that remaining space. Like such:
General Provisions Code of Virginia, Common Law and Rules of Construction, Boundaries of...
This is going to require figuring out how to style the text of that child sections so that they're visually subservient to the parent section, how to separate each one of them out (not commas, as I've used here, because structure titles often contain commas), and how to terminate them at the end of the allocated space (I've gone with an ellipsis here).
Bill, the JSON will be returned from the API like this:
children: {0: {id: "1",label: "title",name: "General Provisions",identifier: "1",url: "http://vacode.org/1/",api_url: "http://vacode.org/api/structure/1/"},1: {id: "2",label: "title",name: "Administration of Government",identifier: "2.2",url: "http://vacode.org/2.2/",api_url: "http://vacode.org/api/structure/2.2/"},2: {id: "3",label: "title",name: "Agriculture, Animal Care, and Food",identifier: "3.2",url: "http://vacode.org/3.2/",api_url: "http://vacode.org/api/structure/3.2/"}}
That's in the order in which the results should be displayed. (I'll generate those using some kind of a sort attribute passed in the request to the API.) So the URL and name will just need to be pulled out of those and turned into whatever HTML that John figures should go within the <dd> (<li>s?)
Humor me. :) If this is a terrible idea, that's fine, and I'll say so—we'll still need that API call, and we'll still need the Javascript to transfer that into HTML.
OK, for starters: awesome. This was just really helpful, to be able to quickly see the viability of this.
I'm torn. I think that the qTip-style dialog is the wrong way to display this data. But this is a so-so method of displaying it. I showed this to @tauberer today, and he remarked that it is surprising, as a user—there's just no indication that this is going to happen. He prefers the idea of leaving those up all the time, maybe as an extremely light gray, and having them become properly legible on mouseover. I worry that will make the page look much too busy, but I do agree with him that it might be undesirable to surprise people with that display. That said, I suspect that any method by which we would display this data is likely to fail to operate under the principle of least surprise.
Sometimes this mouseover data just isn't useful. The worst case is a chapter title that's so long that only a section number is displayed on hover. That's useless. But the best case is really pretty good, especially when stripping out the section numbers (I don't think those are useful) and just displaying the catch lines. I think this is going to be even more useful when looking at structures within structures, e.g. lists of chapter names when mousing over titles. Perhaps some clever truncation of catch lines and structure names will help, too. When the results are linked, and consist of the most-viewed child units, that's when I think this is liable to save people a great deal of time.
@boboroshi, @krues8dr, what do y'all think? Do you dislike this as much as you thought you would? Do you want to try piping this through qTip and see how that experience is?
I was imagining that the entire right side would get taken over and list the sub-sections one per line (no pop-up). Kind of a highlight hover that would tie it together. This is a nice touch but you only get two, maybe 3 max. I can do a quick and dirty mock up or we can try qTip as well. Game for either.
On Aug 15, 2013, at 10:41 PM, Waldo Jaquith [email protected] wrote:
OK, for starters: awesome. This was just really helpful, to be able to quickly see the viability of this.
I'm torn. I think that the qTip-style dialog is the wrong way to display this data. But this is a so-so method of displaying it. I showed this to @tauberer today, and he remarked that it is surprising, as a user—there's just no indication that this is going to happen. He prefers the idea of leaving those up all the time, maybe as an extremely light gray, and having them become properly legible on mouseover. I worry that will make the page look much too busy, but I do agree with him that it might be undesirable to surprise people with that display. That said, I suspect that any method by which we would display this data is likely to fail to operate under the principle of least surprise.
Sometimes this mouseover data just isn't useful. The worst case is a chapter title that's so long that only a section number is displayed on hover. That's useless. But the best case is really pretty good, especially when stripping out the section numbers (I don't think those are useful) and just displaying the catch lines. I think this is going to be even more useful when looking at structures within structures, e.g. lists of chapter names when mousing over titles. Perhaps some clever truncation of catch lines and structure names will help, too. When the results are linked, and consist of the most-viewed child units, that's when I think this is liable to save people a great deal of time.
@boboroshi, @krues8dr, what do y'all think? Do you dislike this as much as you thought you would? Do you want to try piping this through qTip and see how that experience is?
—
Reply to this email directly or view it on GitHub.
I do strongly agree with @tauberer that not showing these until hover is awkward and not great for UX. I think I need a better idea of what @boboroshi is suggesting, but I think it's a good solution.
This is a nice touch but you only get two, maybe 3 max.
I think this is a feature, not a bug. There's a very long tail in traffic patterns, which is to say that overwhelmingly people are going to a tiny collective slice of legal codes. A title might have 20 chapters within it, but a supermajority of people only want to look at the same one or two of those chapters.
The goal here isn't to show somebody a list of all of the child structures, just the few that they're most likely to be interested in. I'd like to speed people's path through the code, and also provide some previews of what lies beyond each link.
I think I need a better idea of what @boboroshi is suggesting, but I think it's a good solution.
Yeah, I'd be interested in seeing this, too. John, would you mind putting together a quick mock-up?
We use order_by internally. For consistency, it's worth at least considering using that terminology within the URL, too. (Obviously, it's often not appropriate to use internal nomenclature externally.)
So far I've only modified the external API to allow it to accept such queries and pass them to the internal API, but not includes/class.Structure.inc.php to actually do anything with that request.
Note that there's a significant flaw with the present implementation: it will only return meaningful results for those legal codes that are a) 3 levels deep or fewer or b) deeper than 3 levels and also have laws within levels other than the final one. That's because the minimally viable SQL is joining structure to laws to laws_views, which means that it can only do the math on the aggregate view count for those structures that actually contain laws. For example, the Code of Virginia has titles, chapters, and sections. Hovering over a title will fire off a query for that title's children—chapters—which will work fine, because each chapter contains sections. But there are six states (Wisconsin, Massachusetts, Delaware, Connecticut, California, and Arizona) that have structures that are four levels deep, and this functionality would only work when hovering over third-level elements within a second-level listing.
This, incidentally, is the proof-of-concept of the SQL that I'm using:
SELECT structure.identifier, structure.name, COUNT( laws_views.id ) AS view_count
FROM structure
LEFT JOIN laws
ON structure.id = laws.structure_id
LEFT JOIN laws_views
ON laws.section = laws_views.section
WHERE structure.parent_id =1
GROUP BY structure.id
ORDER BY view_count DESC , structure.order_by
Actually merging this into Structure::list_children() is non-trivial, because that's already using a pretty tortured set of conditionals to assemble its own query. I don't think that assembling the SQL will be hard, but it will be hard to do so in a fashion that won't be confusing to look at later on, and that is as simple as possible.
Anything that relies on a specific-depth is going to be problematic, not just 3-or-4 as the discussion point; we've got Baltimore and San Francisco where there are variable depths depending on where you are in the code. Is not simply a new "last" marker of some sort enough?
Is not simply a new "last" marker of some sort enough?
I'm sorry, I don't follow.
The challenge here, to be specific, is having a method of saying "give me a list of all laws that are a descendent of the current structural unit." Ideally that could be accomplished in a single query, which would allow this to fit neatly into the logic of Structure::list_children().
To be clear, I don't regard the present solution as a permanent one, simply as one that constitutes an iterative improvement. I only have a few weeks' funding left, so a solution that works for 90% of people beats one that works for 0% of people. :)
Oh, and it's worth mentioning that this will fail quietly and cleanly. If somebody isn't tracking views (if config.inc.php's RECORD_VIEWS is set to FALSE), or if their legal code doesn't fit the necessary structure, then instead this will return the child structures sorted by order_by and structure.identifier+0, in that order. That means that, on hover, somebody will still see a list of child structures, but it'll be the first X structures in order, rather than the first X structures in the order of likely usefulness.
FWIW, I've removed the CSS and the JS that @krues8dr added with 76e48d6, but I've left the functionality in structure.php. I hope that leaves enough for you to hook into, @boboroshi. I imagine you'll want to keep using the JavaScript, I just don't want to leave it in unused, since it's making trouble. :)
On Oct 15, 2013, at 11:13 PM, Waldo Jaquith [email protected] wrote:
FWIW, I've removed the CSS and the JS that @krues8dr added with 76e48d6, but I've left the functionality in structure.php. I hope that leaves enough for you to hook into, @boboroshi. I imagine you'll want to keep using the JavaScript, I just don't want to leave it in unused, since it's making trouble. :)
—
Reply to this email directly or view it on GitHub.
Activity
jathayde commentedon Jun 7, 2013
It's not a thing, but we can make it a thing. Do we want to do hover pop up or more an expanded excerpt area?
waldoj commentedon Jun 7, 2013
I haven't pictured a hover pop-up, but instead an expanded excerpt area, but that's not to say that it couldn't work. :) I think what an expanded excerpt area (or maybe just using any available space to the right on the existing, allotted space) has going for it that it becomes possible to have "open all" functionality, to let people scan through a detailed listing, should they prefer it. (I intend to add user preferences, to let people set options like that to affect how the site works for them, so that could be stateful.) That could then be a default site for legal codes with crappy/no titles on their structural units.
jathayde commentedon Jun 7, 2013
Do you have an example of some content you'd want to show?
waldoj commentedon Jun 7, 2013
I'll gin some up. :)
waldoj commentedon Jun 7, 2013
So, in Virginia, Title 18.2 ("Crimes and Offenses Generally") is the most-read title. "Crimes Against Property," "Crimes Involving Morals and Decency," "Crimes Involving Health and Safety," "Crimes Against Property," and "Crimes Against Peace and Order" are the most-read chapters of that title, in that (descending) order. That's the sort of material that I have in mind.
waldoj commentedon Aug 13, 2013
I'm going to chew over the proper UI for this, based on the options that @boboroshi laid out.
waldoj commentedon Aug 14, 2013
I think I'm willing to risk doing this twice.
@boboroshi and @krues8dr, could y'all put together my loopy one-line preview idea, in CSS and JS? (Bill, your JS skills are way better than mine, so it'd be faster for you to do it.) I wouldn't put any work into polishing it, but just put together a functioning prototype, so that if this really is a terrible idea, we can bail and move to the obviously easier model that y'all understandably prefer.
Specifically, I'm thinking that a mouseover over a
<dd>turns the blank space within that<dd>(everything to the right of the existing text within that definition) into a view of Ajax-called data, displayed inline using that remaining space. Like such:This is going to require figuring out how to style the text of that child sections so that they're visually subservient to the parent section, how to separate each one of them out (not commas, as I've used here, because structure titles often contain commas), and how to terminate them at the end of the allocated space (I've gone with an ellipsis here).
Bill, the JSON will be returned from the API like this:
That's in the order in which the results should be displayed. (I'll generate those using some kind of a
sortattribute passed in the request to the API.) So the URL and name will just need to be pulled out of those and turned into whatever HTML that John figures should go within the<dd>(<li>s?)Humor me. :) If this is a terrible idea, that's fine, and I'll say so—we'll still need that API call, and we'll still need the Javascript to transfer that into HTML.
Quick and dirty hack to show subsection details. #312
krusynth commentedon Aug 15, 2013
Give that a try? Only implemented on the structure list secondary pages (not the home or laws page).
krusynth commentedon Aug 15, 2013
waldoj commentedon Aug 16, 2013
OK, for starters: awesome. This was just really helpful, to be able to quickly see the viability of this.
I'm torn. I think that the qTip-style dialog is the wrong way to display this data. But this is a so-so method of displaying it. I showed this to @tauberer today, and he remarked that it is surprising, as a user—there's just no indication that this is going to happen. He prefers the idea of leaving those up all the time, maybe as an extremely light gray, and having them become properly legible on mouseover. I worry that will make the page look much too busy, but I do agree with him that it might be undesirable to surprise people with that display. That said, I suspect that any method by which we would display this data is likely to fail to operate under the principle of least surprise.
Sometimes this mouseover data just isn't useful. The worst case is a chapter title that's so long that only a section number is displayed on hover. That's useless. But the best case is really pretty good, especially when stripping out the section numbers (I don't think those are useful) and just displaying the catch lines. I think this is going to be even more useful when looking at structures within structures, e.g. lists of chapter names when mousing over titles. Perhaps some clever truncation of catch lines and structure names will help, too. When the results are linked, and consist of the most-viewed child units, that's when I think this is liable to save people a great deal of time.
@boboroshi, @krues8dr, what do y'all think? Do you dislike this as much as you thought you would? Do you want to try piping this through qTip and see how that experience is?
jathayde commentedon Aug 16, 2013
I was imagining that the entire right side would get taken over and list the sub-sections one per line (no pop-up). Kind of a highlight hover that would tie it together. This is a nice touch but you only get two, maybe 3 max. I can do a quick and dirty mock up or we can try qTip as well. Game for either.
On Aug 15, 2013, at 10:41 PM, Waldo Jaquith [email protected] wrote:
krusynth commentedon Aug 16, 2013
I do strongly agree with @tauberer that not showing these until hover is awkward and not great for UX. I think I need a better idea of what @boboroshi is suggesting, but I think it's a good solution.
waldoj commentedon Aug 16, 2013
I think this is a feature, not a bug. There's a very long tail in traffic patterns, which is to say that overwhelmingly people are going to a tiny collective slice of legal codes. A title might have 20 chapters within it, but a supermajority of people only want to look at the same one or two of those chapters.
The goal here isn't to show somebody a list of all of the child structures, just the few that they're most likely to be interested in. I'd like to speed people's path through the code, and also provide some previews of what lies beyond each link.
Yeah, I'd be interested in seeing this, too. John, would you mind putting together a quick mock-up?
4 remaining items
waldoj commentedon Oct 7, 2013
We use
order_byinternally. For consistency, it's worth at least considering using that terminology within the URL, too. (Obviously, it's often not appropriate to use internal nomenclature externally.)Support a "sort" attribute for structural API queries
waldoj commentedon Oct 7, 2013
So far I've only modified the external API to allow it to accept such queries and pass them to the internal API, but not
includes/class.Structure.inc.phpto actually do anything with that request.Note that there's a significant flaw with the present implementation: it will only return meaningful results for those legal codes that are a) 3 levels deep or fewer or b) deeper than 3 levels and also have laws within levels other than the final one. That's because the minimally viable SQL is joining
structuretolawstolaws_views, which means that it can only do the math on the aggregate view count for those structures that actually contain laws. For example, the Code of Virginia has titles, chapters, and sections. Hovering over a title will fire off a query for that title's children—chapters—which will work fine, because each chapter contains sections. But there are six states (Wisconsin, Massachusetts, Delaware, Connecticut, California, and Arizona) that have structures that are four levels deep, and this functionality would only work when hovering over third-level elements within a second-level listing.This, incidentally, is the proof-of-concept of the SQL that I'm using:
Actually merging this into
Structure::list_children()is non-trivial, because that's already using a pretty tortured set of conditionals to assemble its own query. I don't think that assembling the SQL will be hard, but it will be hard to do so in a fashion that won't be confusing to look at later on, and that is as simple as possible.krusynth commentedon Oct 7, 2013
Anything that relies on a specific-depth is going to be problematic, not just 3-or-4 as the discussion point; we've got Baltimore and San Francisco where there are variable depths depending on where you are in the code. Is not simply a new "last" marker of some sort enough?
waldoj commentedon Oct 7, 2013
I'm sorry, I don't follow.
The challenge here, to be specific, is having a method of saying "give me a list of all laws that are a descendent of the current structural unit." Ideally that could be accomplished in a single query, which would allow this to fit neatly into the logic of
Structure::list_children().To be clear, I don't regard the present solution as a permanent one, simply as one that constitutes an iterative improvement. I only have a few weeks' funding left, so a solution that works for 90% of people beats one that works for 0% of people. :)
waldoj commentedon Oct 7, 2013
Oh, and it's worth mentioning that this will fail quietly and cleanly. If somebody isn't tracking views (if
config.inc.php'sRECORD_VIEWSis set toFALSE), or if their legal code doesn't fit the necessary structure, then instead this will return the child structures sorted byorder_byandstructure.identifier+0, in that order. That means that, on hover, somebody will still see a list of child structures, but it'll be the first X structures in order, rather than the first X structures in the order of likely usefulness.Add logic to list_children() to order by views
waldoj commentedon Oct 7, 2013
Well, that's not pretty (3 new conditionals!), but it's syntactically sound. @boboroshi, it's all you!
waldoj commentedon Oct 16, 2013
FWIW, I've removed the CSS and the JS that @krues8dr added with 76e48d6, but I've left the functionality in
structure.php. I hope that leaves enough for you to hook into, @boboroshi. I imagine you'll want to keep using the JavaScript, I just don't want to leave it in unused, since it's making trouble. :)jathayde commentedon Oct 16, 2013
Okay, will take a look here this morning.
On Oct 15, 2013, at 11:13 PM, Waldo Jaquith [email protected] wrote:
Remove experimental CSS
krusynth commentedon Nov 5, 2014
Propose moving Milestone to
Future.waldoj commentedon Nov 5, 2014
I guess so. :-/