Team blog: Developers

You can now edit descriptions, or keep them in sync with Wikidata

When you have a review subject like Les Misérables, it’s good to have additional metadata. Are you talking about the book by Victor Hugo? One of the many film and TV adaptations? The musical? In future we’re planning to add metadata that’s useful for specific domains (e.g., opening times for restaurants, or publisher info for books), but for now, we’ve added support for a short text description.

Wikidata, which we support as a source for selecting review subjects, already has these descriptions for many items. For example, it describes the book “Nutshell” (reviews) as the “17th novel by English author and screenwriter Ian McEwan”. When you review an item via Wikidata, this description (in all available language) is automatically imported. We’ve now also added these descriptions to all reviews that had a Wikidata URL associated with them, and they will be updated automatically every 24 hours.

An automatically updated description looks like this:

Screenshot of automatically imported description

For reviews that are not associated with a Wikidata item, you can add or edit the description after writing a review.


Translating our FAQ and Terms of Use

In addition to the user interface, it is now also possible to translate our FAQ and Terms of Use via translatewiki.net. This is done through the “page translation” interface. To get started, see the “Content pages” section on this page. Note that you have to be a translatewiki.net translator — see our introductory blog post for more information. Confused? Find us in our chatroom and we’ll try to help.

For these long texts, we will manually import translations when they are completed, and less frequently synchronize smaller updates.

Big thanks to Nemo bis for helping to get this set up, and as always, thanks to all translators. :-)


Mailing list is back up

Our discussion list is online again. To participate, simply subscribe.

If you’re unfamiliar with mailing lists, think of it like a web forum, but through email. You can also post through the web interface if you prefer.

We intend to use the list primarily for long-form discussion about policies, community development, and so on.

Why was the list down? We migrated from the Mailman 2 series to the Mailman 3 series of the software. It adds features like the web interface for posting, searchable archives, social logins, and much more, making the experience much more comparable to modern forum software.


Review anything from Wikidata

You can now review anything that has an entry on Wikidata, Wikimedia’s universal database of concepts. That means almost anything that has a Wikipedia entry, as well as lots of things that don’t — e.g., scientific papers, or individual episodes of webcomics. All you need to do is select the “Search Wikidata” function when starting a new review, like so:

Example of a Wikidata search

We’re excluding some Wikimedia-specific stuff from the search results — if you get a “no relevant results” message, that’s why.

Of course, when you select a Wikidata item, you don’t have to manually add a label or description. They’ll be imported from Wikidata in all supported languages. In future we’ll import additional properties, as well, and keep them in sync with the Wikidata source.

If you don’t have JavaScript enabled, the search feature won’t show up, but Wikidata URLs will still be treated magically: labels and descriptions will be fetched on our end.

This feature is brand new, and there are certainly going to be some issues with it. If you find one, please report it. :-)


Labeling things

When you review something by picking a URL, you have to give a name to the thing you review — the title of a book, the name of a product, and so on. Before today, you had to do this in an extra step after writing a review. Now you can do it from the “New review” form using the “label” field. It will be automatically completed for you if we already know something about that URL, like so:

Screenshot of URL completion

In future, we’ll support finding things to review by picking them from sources like Wikidata and OpenStreetMap, and may also do other things to fetch information automatically from known sites like Amazon.com. For now, this should already take a little friction out of the process.

Note that this change requires JavaScript — without JavaScript, you’ll get the same user experience as before the change.


Spoilers are no fun

We’ve had support for spoiler warnings in reviews and other content for a while, but the new rich-text editor did not support them. It does now. Here’s what it looks like in the editor:

Animation of spoiler warning in RTE

This is possible thanks to the high level of hackability of our editor component, ProseMirror. There are still a few kinks to work out (as always), but given that spoilers ruin the fun for everyone, it’s good to have the first version out!


Supporting distraction-free writing

Writing requires focus, which is why I’m a big fan of distraction-free editors (see my review of Typora, for example). In that spirit, I’ve added support for full-screen editing to lib.reviews. Here’s what it looks like (if your browser window is tiny).

Animated GIF showing full screen editing UI

Note that technically this is full-window editing rather than full-screen editing. This is intentional. My assumption is that in most cases, users will still want to have easy access to their other tabs and windows. But you’re in control: if you want to get rid of everything else, just switch the browser into full-screen mode, as well (F11 in Firefox or Chrome).

This mode should also help with larger reviews with lots of images that benefit from the additional screen real estate.


User preferences without clutter?

I’m not a big fan of classic user preference dialogs where you have to hunt a million sections for the thing you care about. Where it’s possible to do it intuitively, I prefer to integrate preferences into the part of the application they regulate, where the user is likely to look for them.

In this vein, I just added a little pushpin widget to load the rich-text editor by default. Here’s what it looks like:

User preference switcher animation

Under the hood, it makes an API call to toggle the preference. This means it’s a real preference, not stored in your browser. Any new review or other long form text field you write or edit will be loaded in rich text until you click the pushpin again. Is it intuitive? I don’t know — feel free to comment on the relevant bug if you think it can be improved. But I do like that it doesn’t make me go hunting in a “user preferences” section.

Speaking of clutter, I also find it important to prune features that no longer make sense. Accordingly, we’ll be removing the “live preview” feature soon, since it’s made largely obsolete by the rich-text editor. If you disagree, speak up on the bug :-).


Rich-text editor is now live

I just deployed the initial release of the new rich-text editor for all large text fields on the site (reviews, blog posts, team descriptions, bios). If you have JavaScript enabled, you should see the mode-switcher below the relevant text fields. Here’s what it looks like in action:

Animated RTE example

This editor is powered by ProseMirror, which is more a toolkit for building editors than a drop-in solution. We’ve hacked it to serve the purposes of this site. Features include:

  • You can switch back and forth between markdown and rich-text, and edit in either representation. (Most markdown editing tools only render a preview.)

  • When in rich-text mode, you can use markdown shortcuts such as >, *, 1., # at the beginning of a line to get quotes, bullet point lists, numbered lists, or headlines.

  • Want a bigger editor? In browsers that support it, you can drag-increase the size of the markdown editor. When you switch to rich-text, the new height will be preserved. In future, we may implement a proper full-screen mode.

  • All UI messages can be translated via translatewiki.net (become a translator).

ProseMirror itself is still in early development (watch out for this bug with trailing spaces), and I’m sure there are problems in the integration as well. Please don’t hesitate to report bugs!

We’ll continue to chip away at related issue, and will also start turning our attention to other shiny features such as

  • metadata for review subjects

  • import of items from Wikidata

  • API, API, API!


Coming soon: A new editor

Some new users have requested a nicer way to write reviews, so I’ve decided to give the editing UI some love before moving on to some other high priority tasks. I’m currently working on integrating ProseMirror, which is an open source rich-text editor library.

ProseMirror is extremely modular – it’s basically a “build your own editor” kind of deal. The downside is that it takes longer to build something; the upside is that it’s possible to build advanced functionality and to customize the UI more easily.

Markdown is not going anywhere. One of the PM examples demonstrates the side-by-side use of markdown and rich-text editing. The goal is to create a similar user experience for lib.reviews. This way, users will be able to choose the editing environment they prefer on a case-by-case basis.


 Older blog posts