Previous Entry Share Next Entry
Release 0.8.7.4
querki
jducoeur wrote in querki_project
I'm continuing to procrastinate a bit about the new Notifications feature -- it's relatively large and scary (involving at least two new major subsystems), so I'm taking my time on the design. In the meantime, more bug fixes and small enhancements.


_bulleted can now be nested: this is the biggest enhancement, and deals with a problem that has been bothering me for a long time. tl;dr: you can now nest _bulleted expressions, and it does the right thing.

_bulleted is, IMO, one of the most generally useful utility functions in Querki, and I commend it to y'all -- I use it all the time. It simply takes the received values, and renders them as a bullet list. If you don't care about fancy formatting, it's often the easiest way to display your data. It's also one of the simplest functions, and has never involved any actual code: it simply took the values you gave, and passed them into the expression:
""* ____""
Conceptually that's great, but it has always suffered from one *huge* problem: it doesn't nest right.

For example, say that I am inventorying my bookcases, and want to show what is on the shelves. The obvious thing for me to say is something like:
[[Bookcase._instances -> ""[[Name]]: [[Shelves -> ""[[Name]]: [[Contents]]"" -> _bulleted]]"" -> _bulleted]]
That is, I'm nesting a bullet list of shelves inside of a bullet list of bookcases. I would expect to see something vaguely like:
  • Left Bookcase:
    • Top shelf: dishes

    • Middle shelf: glassware

    • Bottom shelf: plastic containers


  • Right Bookcase:
    • Top shelf: science fiction

    • Middle shelf: to be read

    • Bottom shelf: graphic novels

But that's not what you've actually been getting -- the way it's always worked, you simply get a single, flat bullet list like this:
  • Left Bookcase:

  • Top shelf: dishes

  • Middle shelf: glassware

  • Bottom shelf: plastic containers

  • Right Bookcase:

  • Top shelf: science fiction

  • Middle shelf: to be read

  • Bottom shelf: graphic novels

This is barely useful at best. This is a side-effect of the way QText works: like the Markdown it is based on, it has no good way to display sub-bullets.

More generally, this is a problem of composability, in computer-science terms, and it turns out to be rife in Markdown/QText. This basically means that higher-level functions should be able to do their thing without worrying about the details of how the lower-level ones work. In this case, _bulleted should be able to put the entire contents of the received value into a bullet, without having to worry about the contents of that received value. Markdown does terribly on that.

Fortunately, plain old HTML does rather well in terms of composability, and now that we are adding bits of HTML into the mix, we have a solution. So I've whitelisted the ol, ul and li tags (which are the tags for numbered and bullet lists), and rewrote _bulleted. It still "plays fair", and doesn't do anything you can't do (indeed, I did proofs of concept in plain Querki before rewriting _bulleted), and is now defined as:
* ""<ul>[[""<li class="_bullet">
____
</li>""]]
</ul>""
Note the asterisk at the front -- that is the rarely-used but occasionally important marker to say that this Text should receive the *entire* list, rather than just one element at a time. So this wraps the whole list in a <ul> tag, and then the inner expression wraps each element in an <li>tag.

Note that there are some significant changes to the details here. The most important is that the contents of each bullet point will wind up getting properly paragraph-ized, which was not happening before. This should be all to the better, and fixes one long-standing problem, that multi-paragraph contents inside of a bullet would get messed up. (Again, because QText doesn't compose well.) Each bullet now has the _bullet class, and there's been a small CSS tweak so that you get space between paragraphs, but things stay tightly compressed otherwise.

The overall moral of the story is that QText is a helpful shortcut for typing text, but we shouldn't rely on it too much for complex and interesting problems, because it is too dependent on the fine details of how the lines are laid out; this makes composing QText expressions hard at best. For interesting problems, you'll probably want to resort to HTML. Feel free to ask for more tags to be whitelisted.


You can now change your Display Name: Querki users, much like Things, have three identifiers. Your OID is permanent and unchanging. Your handle (which is used in the path to your Spaces) is *fairly* fixed: we might provide ways for you to change it down the road, but by and large it is intended to stick with you. (Very much like a LiveJournal handle.) Your Display Name, OTOH, which is what is usually shown, is whatever the heck you want -- we don't much care what you put there. But until now, there was no way to change it.

This is now fixed: if you go to your profile (via the upper-left Login Menu), there is now a place to change your Display Name. This should work pretty much as you expect it to.

Note that your Display Name as shown in Spaces will not update until you next go to those Spaces. (Suffice it to say, Display Name gets denormalized into the Spaces for efficiency reasons.)


Bugfixes

Querki Explorer's results are now properly client-processed: previously, what you saw in the Explore... page was in its "raw" form, without any of the usual client-side massaging. This meant, among other things, that star Ratings totally didn't display. This is now fixed.

Fixed bugs in _and and _or: in the course of looking into why Recalculate Summaries was showing when it shouldn't (below), I discovered that _and has a long-standing bug: if one of the parameters was the name of a Property that is *not* defined on the received Thing, it would cut off processing and return true. Fixed that (and _or, which turned out to have a similar problem). A missing Property now counts as false, which matches Querki's usual treatment of flags.

Fixed incorrect display of Recalculate Summaries: it turned out that, while the new Recalculate Summaries button was showing on all the User Value Properties that it should have, it was *also* showing up on many inappropriate Properties where it shouldn't have. This was a side-effect of the above-mentioned problem with _and, and is now fixed.

Fixed the number of values shown in _average: the _average function shows both the average value of the ratings, and the number of "votes" that have been made. It turns out that the latter was wrong due to a simple brain-o on my part. This is now fixed.

Fixed display of Summary histogram: due to problems with QText's auto-paragraphization, the histogram was sometimes coming out just plain broken. This is now fixed.

Fixed collection handling of nested texts: while making the above changes to _bulleted, I found a very old bug in how the * "..." operator worked. As mentioned above, this operator means that we pass the entire collection in to the Text literal, instead of one element at a time. However, it turned out that that flag was getting carried down into nested Texts *inside* that one -- which meant that there was no was to then break out the elements. This now works as expected -- inner Texts nested in the outer one revert to usual processing.
Tags:

?

Log in

No account? Create an account