ويكيبيديا مجردة/تحديثات/2023-05-25
▶ | آخر أخبار ويكيبيديا المجردة | ◀ |
تجربة العرض والتحرير الجديدة متاحة الآن
في الأسبوع الماضي، اتخذنا خطوة كبيرة أخرى إلى الأمام لإطلاقها. بعد أشهر من التطوير، حولنا تجربة العرض والتحرير القياسية من عارض ومحرر ZObject القديم غير المصمم مطلقًا إلى مكون العرض الافتراضي الجديد.
يبدأ مكون العرض الافتراضي في إبراز مزايا وجود وظائف فردية تُنفذ عبر الويب. من الصعب تجنب مقارنة Wikifunctions بعقود من العمل في بيئات التطوير الحديثة. ولكن مع تمكين المكون الافتراضي الآن، أشعر حقًا أن بعض الاحتمالات المثيرة للاهتمام للعمل التعاوني على الوظائف الفردية من خلال واجهة الويب تبدأ في الظهور.
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.
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:
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.
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.
The collapsed composition is opened one level in the following screenshot.
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.
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!