Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring LGV trackLabels setting via config #4020

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

cmdcolin
Copy link
Collaborator

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

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 26, 2023
@cmdcolin cmdcolin changed the title Allow setting preferred trackLabels via config Allow configuring LGV trackLabels setting via config Oct 26, 2023
@cmdcolin cmdcolin removed the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 26, 2023
@cmdcolin
Copy link
Collaborator Author

related to request on mailing list

@cmdcolin cmdcolin force-pushed the allow_tracklabels_config branch from 734c2a6 to f14701a Compare October 26, 2023 19:47
@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Oct 26, 2023
@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Oct 27, 2023
@cmdcolin cmdcolin force-pushed the allow_tracklabels_config branch from f2779c7 to 48edc9d Compare October 27, 2023 15:21
@cmdcolin
Copy link
Collaborator Author

we could potentially add extra options saying whether the view state is even used, whether local storage settings are even used, etc. but i think this should give a relatively good default behavior

@cmdcolin cmdcolin merged commit eff3680 into main Oct 27, 2023
@cmdcolin cmdcolin deleted the allow_tracklabels_config branch October 27, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant