Previously, search only covered topic titles and markdown. This adds
tags to it as well, and will make it easier to add other things in the
future since there's now a custom function instead of using the built-in
one that only supports text columns.
mypy 0.640 has made it so that it's no longer necessary to annotate the
return type for __init__ methods, since it's always None. The only time
it's necessary now is if the method doesn't have any arguments, since
this shows that the method should still be type-checked.
Previously, there were a number of issues coming up repeatedly related
to unexpected behavior of nested lists and similar cases. This is
because we're trying to use lists for their semantic value occasionally
(such as for lists of topics inside a particular group), but the default
styles (including the ones from Spectre.css) have set them up
specifically for text-based lists.
This commit addresses this by changing the base ol/ul styles back to
something very neutral (no margins or marker for list items), and then
adding a specific "placeholder class" that can be extended in places
that will have text-based lists, like inside comment or topic text.
Something strange is going on with this package - after no updates for 2
years it's suddenly had two new versions released without having its
changelog updated, and the new versions don't seem to work properly. You
can no longer import it as "publicsuffix" like you used to be able to,
and it appears that the newest version (2.20180921.2) no longer even
downloads the publicsuffix file, it just uses the one included in the
package.
Bleach is in the middle of being updated to a significant new version
that seems to have quite a few changes (and will probably be a good
update overall that will fix some issues on Tildes), however right now
there are a few things still off with it and it's not safe for me to
update to it yet.
Updates the Black code-formatter to its newest version and applies it.
They made some small changes to how it handles numeric literals that
affected a few files - both always forcing a "0." prefix on float values
instead of allowing an implicit "0" to be there, as well as only adding
underscore separators if the number has at least 6 digits.
We're always using lowercase for all ltree usages (group paths, topic
tags), so it's best to just have the Ltree field do this conversion.
This fixes some minor issues like tag-filtering not working if the
casing of the tag was wrong.
A few other changes needed to be made as part of this, in places where I
was inadvertently passing an Ltree value into the Ltree field, instead
of a string.
Deleted comments weren't collapsing properly, since this wasn't
attaching the classes even if the comments were collapsed by one of the
CommentTree processes.
Uncollapsing the new comments' parents wasn't working correctly if there
were several new replies in a chain. Because it's working from the
"leaf" comments back up towards the root, doing a continue when a
comment's state had already been set would cause uncollapsing parents to
fail - the deepest comment would uncollapse its parent, then its parent
would get skipped. If the parent was also new, this would mean that
*its* parent didn't get uncollapsed, even though it should have been.
The ago library doesn't handle datetimes correctly if they have any
timezone except the system's localtime. This can be worked around by
calculating a timedelta and passing that instead of a datetime. This
commit updates the descriptive_timedelta() function to do that.
I've also registered an issue on the library, but I don't know if it's
maintained any more:
https://bitbucket.org/russellballestrini/ago/issues/3
Previously, TopicListingSchema was being used for things that weren't
listings of topics. So this creates a more generic
PaginatedListingSchema and makes TopicListingSchema a subclass of it
that adds the additional fields it needs.
This has said that pagination is "coming soon" for quite a while. This
is a bit messy in a few ways, but should do the job for now.
PaginatedQuery/PaginatedResults might be good to refactor a little in
the future to make this kind of thing simpler.
This adds a trigger to the scraper_results table which will add rabbitmq
messages whenever a scrape finishes, as well as a consumer that picks up
these messages, and uses Embedly data to download (and resize if
necessary) the favicons from any sites that are scraped. These are
downloaded into the input folder for the site-icons-spriter, so it
should be able to use these to generate spritesheets.
* Enables wrapping when the buttons will go offscreen
* Turns on minimum touch size
* Adds a "..." on the labels that require a reason
* Moves the info about the cooldown on Exemplary into the prompt
Both the initialize_db script and Alembic need to import all
DatabaseModel subclasses so that DatabaseModel.metadata has all the
models attached. Previously this wasn't being done properly, and the
intialize_db script wasn't creating the scraper_result table since it
hadn't been imported.
This commit creates a dedicated module to import all of those classes,
so that both those locations can simply import * from it instead of
needing to import all the models individually. This still isn't great
overall, but it should be less prone to mistakes at least.
Solarized's green color is pretty awful, not really attractive for
Exemplary comments. This switches Exemplary to blue, Joke to green, and
Offtopic to cyan. It also rearranges the order a bit so that the colors
in the labeling menu go in a progression that looks right.
Since the production version is using a default label weight of 0.5,
previously two users would have had to label the same comment Exemplary
for it to actually activate. This will probably be fairly uncommon so we
most likely don't want it to work that way. This reduces it to 0.5 so
that one label will trigger it, but it would probably be better to
specifically set it to the default label weight if that's feasible
somehow.
This is a bit of a hacky way of doing it in a few aspects and definitely
still needs some work, but it's a reasonable start. Specifically, a
major miss is that there's no way to remove an Exemplary label unless
you currently have one available. This should definitely be fixed, but
I'm not sure what might be the best approach yet.
This adds an "exemplary" comment tag which has a few special behaviors:
* Requires a reason, which is visible (anonymously) to the tagged
comment's author.
* Highlights the comment's left side in green
* Acts as a multiplier to the comment's voting
I think we'll still want to add a cooldown or something similar on using
this tag, but this covers the basic functionality for it.
Using orange had a bit of a "this is a bad thing" implication to it (and
was hard to tell apart from the red of Malice). It also makes a bit more
sense to have the more-negative tags (Noise and Malice) to the right.
No functionality impact yet, but changes these two tags into a single
one. The alembic migration is a bit tricky to deal with the potential
constraint violation if a user had tagged a comment with both "flame"
and "troll".
Previously, topic lists filtered down to a tag were using "descendant
of", so for example a listing based around the "ask" tag would show
topics that have the exact tag "ask" as well as any sub-tags, such as
"ask.survey". However, it wouldn't show a hypothetical "example.ask"
tag, where the "ask" was at the end.
This commit updates the method used to utilize lqueries to search for
tags that either start or end with the specified one (which includes
exact full matches as well).
Some (mostly minor) adjustments to the syntax highlighting:
* Take advantage of SCSS nesting
* Switch to using a <code> tag instead of a <div> (requires creating a
custom Pygments formatter class)
* Change "syntax_" prefix to "syntax-" for consistency
* Refactor Bleach attribute-checking function a bit and drop unnecessary
one (the "language-" class gets dropped before sanitization)