User:Jeblad/Adaptible portlets

At Norwegian (bokmål) Wikipedia there is a few experiments on portlets with adaptible menu entries as gadgets. The idea is to adapt the entries to the users actual needs, and not attempting to find some small common denominator for all users. After a couple of iterations it was pretty clear that the present organization of the sidebar was not optimal.

Algorithm
A page is part of some context. Either it is linked to from a page, it is part of a category, or it is within a namespace. After several iterations it seems like the best approach is to use the namespaces as context. This will map navigation to portal, project to wikipedia (which also has an alias project), and so forth. A portlet help would be added too.

There would also be some more specialized portals like the language box, but that would act a little bit different and is better dropped in this discussion.

When the user visits a page it will be added to one of several maintained lists of pages, each list follows one context. Initially the page is just added to the front of the list, with a page visit of one, and as more items are added the older items propagates down the list. Finally they reach the end of the list, or rather the array has reached its maximum length, and they drops off. If a page is revisited before it reaches the end of the list it is removed from the current position and reattached to the front of the list and the visit counter is incremented by one.

The handling of the list as such is a least recently used algorithm, the oldest entries are discarded.

When the the portlet menu for a specific context is built the present visits page list is sorted and the highest ranking items that are not already listed in the portlet are added.

The construction of the menu from the list is a most frequently used algorithm (see also least frequently used), the most frequently used entries from the list are used for the menu and the other ones are "discarded".

Initially there should be a base set of items. This will be used if there are no other known entries that should be added to the list. Typically this would be used for any anonymous users, and it will also be used for logged in users when there are no previous known page history for the given context. These entries will be overridden by the user as he visits pages.

Some pages would also be of so much interest to the user that he want to pin the entries in the portlet. This is not the same as a watched page although it is very similar. The algorithm as such is not dependant on how this is done, but it seems that either drag and drop (dragged from the lower part of the portlet to a higher part) or a clickable item attached to the menu entry is the most obvious way to set something as pinned in the portlet.

A special case exist when the user visits an non-existing page. If this happens the page will be removed from the list of tracked pages.

It seems like there should be a navigational page for for each portlet, and probably this should be reachable from the title of the portlet. This interferes with collapsing/expanding the portlet in Vector, but perhaps the arrow part is sufficient clickable area.