Open manics opened 3 years ago
A few additional comments primarily coming from the IDR use case. It would be useful to also include other drivers for this functionality:
If we're happy for this to be client-side web-only then OMERO.web could take an inline javascript function that does the transformation, e.g.
omero.web.display.tree.sortfunction="function(s){var a=/(\w+)-\w+\/(\w+)/.exec(s); return a[1]+'-' + a[2];}"
This function would be run on every container name to create the sort key in the browser view only. The advantage of this is there should be no performance hit since there's no need to check for annotations, it's all on the client side, and you've got full flexibility to do whatever transformations you want.
Looking at the configuration and reading the description, it seems that we are moving towards preference that people have requested for a while e.g. I want to the first 10 images in that dataset and hide the rest etc. If we introduce a config option this will need to be as generic as possible and tackle other problem that just the IDR issue mentioned above. The suggested map will also be visible so a way of hiding it will be required
Summary: I will refrain from introducing a config without more scoping of the preferences.
What I understood so far:
Ad 1. I would say the workflow of adding the KVPs in order to reorder the containers is very hard to discover. Also, to add these KVPs in the correct manner for a tree which is constantly in flux as new containers are appearing and disappearing (normal lab routine of importing new images, deleting, renaming and reordering the containers) is a task which the user will not conteplate for data which are in flux imho. The only usecase would be the "public group" or similar, where the data are already more "stable" aka IDR.
Ad 2. I do not see a way from the webclient UI to specify a namespace. If scripting/CLI is the only way to go here, this will push the usage of such feature to negligible levels. The cost/benefit ratio is not favorable in this case, as going into ClI for the sake of having a different UI ordering will be perceived as "not worth it" by most users.
Ad 3. This is suggested as a way to help users to understand the ordering. But imho there would be many cases where the exact opposite effect would be achieved - as the concept of ordering per item using KVPs is completely non-familiar to most of users, they will be doubly confused (both by the ordering and by the KVP) instead of connecting the two (KVPs govern ordering).
Ad 4. There is some benefit in having each user define their own ordering, but these usecases will be in an unfavorable ratio to the number of cses where the users will be confused by the feature (and the per-person ordering on top of it).
In summary, I would guess that without a UI feature with something like sort by
context menu option on each item, not much usage will be achievable outside of IDR.
Another option along the lines of an annotation per dataset would be an annotation on the view. The interaction I'm imaging is eventually allowing someone to drag-and-drop the elements of the tree to have them ordered differently. Having the annotation on each individual entry might make it difficult to rationalize that drag-n-drop as opposed to one list. There are still synchronization issues which would need working out.
The ordering of top-level containers in the OMERO.web Left-hand tree can be modified using
omero.client.ui.tree.type_order
to not separate Projects and Screens. This is currently used in the IDR to ensure studies are ordered by number irrespective of whether they are Screens or Projects.This does not allow more fine-grained ordering, for example
Would be displayed in alphanumeric order as
Possible solution
Add an optional annotation on each container that is used as the sorting key. The default value of the key would be the container name.
E.g. using MapAnnotations (name-value pairs) in namespace
openmicroscopy.org/client/display
(to allow for further display customisation)Project idr0002/ExperimentB MapAnnotation:
Screen idr0002/ScreenA MapAnnotation:
Screen idr0002/ScreenC MapAnnotation:
idr0001/ExperimentA
(default name)idr0002-1
(container-order-key)idr0002-2
(container-order-key)idr0002-3
(container-order-key)idr0003/ScreenA
(default name)If
omero.client.ui.tree.type_order=false
the containers would be ordered bysort-key