Behavior of docextra tabs when a revision is being viewed + more

Hi devs,

I’ve tried to fix XWIKI-14807 The attachments tab does not take into account the document revision and while doing so realized that we need to fix more things.

Current situation before my fix:

  • The docextra tabs don’t modify their display if the current doc being viewed is a revision.

So I’d like us to agree about the following:

  • We want all tabs to handle displaying their content, taking into account if the doc being viewed is the latest version (ie current version) or some past version.
  • We usually want to remove actions since we cannot do an action on a past revision.

Let’s see what it means for the default tabs:

  • For the comments tab, it’s easy: we want to show comments that existed at the time of the revision, and remove the ability to add comments.
  • For the attachment tab, list all attachments that existed at that time and remove all actions (move, delete attachments + upload new attachments). This is what I’ve implemented.
  • For the history tab, I’m not sure. We have 3 options:
    1. don’t display the History tab for a revision. Users need to go to the current version to see the history
    2. display the full history even when viewing a revision (ie what we have today)
    3. only display revisions that existed before the currently viewed revision. In this case we would probably still need to remove the "rollback’ action since it would rollback from the current version and not the viewed version.
  • For the Information tab, I guess we should display the metadata value from that revision + remove all edits. For some information, it may be hard to compute them and for those we could just remove the information.

For each tab, we also need to decide what we display if both a revision and a language parameters are passed. Mayve that can change some of the display.

For extensions contributing a UIX for docextra tab, it’ll need to handle both the rev parameter and the language parameter (we need to add that info to the UIXP doc IMO).

For CR for example, it doesn’t make sense to view CRs for a revision, so we have 2 options:

  1. Don’t display the CR tab when viewing a revision
  2. Display the CR tab but its content is the same whatever the revision being viewed. Similar question to option 1) of the history tab above.

Last, we need to talk about other actions that are currently possible when viewing a revision. Right now it’s still possible to do all the actions you can when on the last revision: edit, create, set notifications, administer page, etc. And when using them, they act on the last revision and not on the displayed revision.

I find this a bit misleading and I would be in favor of removing them in this case, and add a single action button to go back to viewing the last revision.

To be clear we should keep the menu entries that make sense when viewing a revision, for example: View source, Export, view children (if possible), etc. Basically remove all actions that make changes to the document. Current doc is at https://www.xwiki.org/xwiki/bin/view/documentation/xs/user/base/page/view-page/view-history/previous-versions-page/

WDYT about all this?

Thanks