Allow configuring LGV trackLabels setting via config #4020
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This creates a configuration setting that allows admins to specify a preferred track label setting for their instance
It uses a 'rarely used' configuration setup where the LinearGenomeView plugin class has a configurationSchema property that provides some 'global config slots'
Therefore we have
configuration.LinearGenomeViewPlugin.trackLabels being a config types.enum('offset','overlapping','hidden')
this is accessible by calling
getConf(session,['LinearGenomeViewPlugin','trackLabels'])
there is a complex interplay between current session state, configuration, and user preference with this setting
one problem that actually currently exists is that visiting share link with e.g. trackLabels hidden would cause your current localStorage preference for lgv-trackLabels to automatically become hidden
this PR changes it so that your localstorage preference only changes when you manually change the track labels setting in the UI (on the lgv.setTrackLabels action)
then, the resulting trackLabels setting is determined from
current session state view.trackLabels ?? localStorage trackLabels setting ?? global configuration trackLabels
This allows session shares to have first order of preference, then user preference, then configuration preference