Jump to content

Abstract Wikipedia/Updates/2023-05-25

From Meta, a Wikimedia project coordination wiki
Abstract Wikipedia Updates Translate

Abstract Wikipedia via mailing list Abstract Wikipedia on IRC Wikifunctions on Telegram Wikifunctions on Mastodon Wikifunctions on Twitter Wikifunctions on Facebook Wikifunctions on YouTube Wikifunctions website Translate

Our new viewing and editing experience is now available

[edit]

Last week, we made another huge step forward to launch. After months of development, we switched the standard viewing and editing experience from the old, never-designed ZObject viewer and editor to the new Default view component.

The default view component begins to highlight the advantages of having individual functions being implemented through the Web. It is difficult to avoid Wikifunctions being compared to decades' worth of work in modern development environments. But with the default component now enabled, it really feels to me that some of the interesting possibilities of collaboratively working on individual functions through a Web interface start to shine through.

The widgets keep relevant information available for you at a glance while you are working on a tester or implementation. You can quickly re-run the tests while updating an implementation, making sure they still pass. And this is just our first version: we expect that as Wikifunctions evolves, as you use it and find what does and doesn't work for you, that we will grow and refine the repertoire of widgets at our disposal. I am very excited about the future of Wikifunctions!

This change is coupled with tons of other changes that were now enabled by using the new components. In this newsletter we will focus on two types of objects where the new user experience is particularly beneficial: testers and implementations.

View of the function "add s to end" in the Wikifunctions Beta

Our examples start with a function called “add s to end”. As you can see on the left hand side, the function takes a string as an input and returns a string. On the right hand side you can see that the function currently has one implementation (called “Add s composition”) and one tester (called “Add s to book”). To give an example, if you enter a string such as “wall” as the input, the function will add an s to the end and return “walls”.

Let’s take a look at the tester:

Default component for the tester "Add s to book" in the Wikifunctions Beta

The tester, as with most objects, now has three columns, with the main content in the middle and additional helpful information and sometimes actions on the left and right column. On smaller screens (like mobile devices), we show the left column's contents first, then the main content, and finally the right column.

In the center we see that this is a tester for the “Add s to end” function. The test is invoked by the call “Add s to end (book)”, i.e. by the function all “add s to end” with the argument “book”. We are using functional syntax here as a shortcut for describing the call. By expanding the call, you can see the function call in more detail. The result validation then says to check with string equality against “books”. So this tester basically says that, by adding “s” to the end of “book”, the system should return “books”.

Expanding and collapsing objects is particularly useful for the editing mode, where the contributor can expand and focus on the parts of the object they are interested in, and get a reasonably compact view of the rest of the object.

The left hand column has two widgets, one “About”, to view and edit the multilingual information of the object, and the other a function explorer, offering a quick overview of the function we are testing. On the right hand side we have a widget offering the list of implementations and whether they pass this tester or not. There's also the JSON syntax representing the object for debugging; don't be alarmed by this, we use it for our convenience while we develop but we plan to remove it from view.

ZObject-Viewer for the tester "Add s to book" in the Wikifunctions Beta
This is the view in the (now deprecated) ZObject-Viewer component of the tester "Add s to book" which tests the function "Add s to end of word", in the Wikifunctions Beta

Here, for comparison, is the previous ZObject viewer. The label box is at the top, not the side, and below we see the tester, first pointing to the function that is being tested, followed by the call and result validation. We see the test results at the bottom in the form of a table, below everything and out of sight.

Default component for the implementation of "Add s composition" in the Wikifunctions Beta
This is the view in Default component of "Add s composition", which is a composition implementing "Add s to end of word", in the Wikifunctions Beta. The composition is collapsed.

The collapsed composition is opened one level in the following screenshot.

Default component for the implementation of "Add s composition" in the Wikifunctions Beta with an expanded composition

This is the new default view for implementations. Again, we have the three column view, with helpful widgets in the side columns. The right hand column now contains a widget with the relevant testers, which also shows that this implementation passes against the tester we saw before, “add s to book”. Whereas every object would have an About widget, each type of object can have different widgets on them as appropriate. For example, we will soon have a Function Evaluator widget in the implementation page, similar to the “Evaluate Function” box we had in the old view.

The center column contains the implementation itself, in this case a composition. Some compositions can become rather long! The function “days in a standard year calendar month” has for example an implementation via composition with functions nested four levels deep. This is where the new default component really shines, as we can compact and expand each of the levels and branches of the composition.

ZObject-Viewer for the implementation of "Add s composition" in the Wikifunctions Beta
This is the view in the (now deprecated) ZObject-Viewer component of "Add s composition", which is a composition implementing "Add s to end of word", in the Wikifunctions Beta

Again, for comparison, here’s the previous viewer for an implementation. We saw the test results at the bottom. Here we also had the evaluate function widget on the right, which will be soon ported over to the new view as well.

Such a big change to the front end, touching almost every content page in the Wikifunctions wiki, has also led to a flurry of bug reports, as a number of things are temporarily not working as intended. Please bear with us as we catch up and fix those. But also, take a moment with us to celebrate this large step forward!

Particular shout outs to Geno as the lead engineer on this task, Allan and Julia for their work, and to Amin for his designs!