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

Add ability to customize About dialog with callbacks and optionally hide links to data #3230

Merged
merged 17 commits into from
Oct 18, 2022

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Sep 29, 2022

Adds a formatAbout config subschema similar to formatDetails

formatAbout can be applied per track or at the entire jbrowse config level (so you can add hideUris to the entire jbrowse config)

  • The formatAbout subschema has a hideUris slot to hide the rendering of "UriLocation" objects in the about dialog. Note that the hideUris results in the "Copy config" button getting hidden too, since copying to text would reveal this type of hidden info...

  • The formatAbout subschema also has a config slot to add arbitrary jexl callbacks to the display of the config snapshot in the about dialog

Possible fix for #3213

Rider change: makes a getTrackName utility function that computes the track name (the logic for making the "reference sequence track name" was duplicated in several places)

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Sep 29, 2022
@cmdcolin cmdcolin changed the title Add ability to customize About dialog with callbacks, and add ability to hide uri's Add ability to customize About dialog with callbacks and hide links to data Sep 29, 2022
@cmdcolin cmdcolin removed the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Sep 29, 2022
@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Sep 29, 2022
@cmdcolin cmdcolin removed the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Sep 29, 2022
@cmdcolin cmdcolin changed the title Add ability to customize About dialog with callbacks and hide links to data Add ability to customize About dialog with callbacks and optionally hide links to data Sep 29, 2022
@cmdcolin cmdcolin added the enhancement New feature or request label Sep 29, 2022
@rbuels
Copy link
Contributor

rbuels commented Sep 29, 2022 via email

@cmdcolin cmdcolin force-pushed the util_gettrackname branch 3 times, most recently from 24ddad7 to 0c4c87d Compare September 29, 2022 21:55
@cmdcolin
Copy link
Collaborator Author

Added "Core-customizeAbout" extension point that receives a conf object to customize the contents

@cmdcolin
Copy link
Collaborator Author

could be interesting to allow track types or plugins to customize the entirety of the about component, similar to how widgets can be swapped out perhaps

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #3230 (c0d6609) into main (c234d2e) will increase coverage by 0.05%.
The diff coverage is 68.83%.

@@            Coverage Diff             @@
##             main    #3230      +/-   ##
==========================================
+ Coverage   59.52%   59.58%   +0.05%     
==========================================
  Files         676      676              
  Lines       28807    28817      +10     
  Branches     7041     7047       +6     
==========================================
+ Hits        17148    17170      +22     
+ Misses      11385    11370      -15     
- Partials      274      277       +3     
Impacted Files Coverage Δ
packages/core/configuration/configurationSlot.ts 63.63% <ø> (ø)
.../pluggableElementTypes/models/BaseDisplayModel.tsx 76.19% <ø> (ø)
...ore/pluggableElementTypes/models/BaseTrackModel.ts 34.93% <ø> (ø)
...re/pluggableElementTypes/models/baseTrackConfig.ts 58.33% <0.00%> (ø)
...eupDisplay/components/LinearPileupDisplayBlurb.tsx 77.77% <ø> (ø)
...lugins/alignments/src/LinearPileupDisplay/model.ts 66.94% <ø> (ø)
...c/BaseChordDisplay/models/BaseChordDisplayModel.ts 74.46% <ø> (ø)
...onfigurationEditorWidget/components/SlotEditor.tsx 66.66% <ø> (ø)
...onnectionWidget/components/AddConnectionWidget.tsx 87.80% <ø> (ø)
...t/src/AddTrackWidget/components/AddTrackWidget.tsx 90.90% <ø> (ø)
... and 40 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@carolinebridge
Copy link
Contributor

Just curious -- what does the change to getEnv do for us?

@cmdcolin
Copy link
Collaborator Author

that was indeed a rider change added to this, but it gives us better typescript (getEnv is returning an any type before, and with this change, we import getEnv from @jbrowse/core/util and it gives us a {pluginManager: PluginManager})

@cmdcolin cmdcolin force-pushed the util_gettrackname branch 3 times, most recently from 17b933e to ada36fd Compare October 12, 2022 21:30
@cmdcolin cmdcolin marked this pull request as draft October 12, 2022 21:47
@cmdcolin
Copy link
Collaborator Author

putting this in draft till some things like #3262 can be resolved.

@cmdcolin cmdcolin force-pushed the util_gettrackname branch 4 times, most recently from 30e6174 to 67ad97d Compare October 14, 2022 16:49
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 14, 2022

this is now enhanced with a couple more extension points that let you do some relatively crazy things including

a) completely replacing the contents of any widget by responding to Core-replaceWidget
b) completely replacing the contents of the about dialog with Core-replaceAbout
c) adding extra about panels to the about dialog with Core-extraAboutPanel
d) adding extra feature detail panels to the feature details with Core-extraFeaturePanel

in addition, there are the about panel config options for

formatAbout:{ 
hideUris:boolean, 
config: "jexl:callback to customize any of the config display" 
}

this PR is rebased off of #3266 and has examples of doing these things in our volvox config

@cmdcolin cmdcolin marked this pull request as ready for review October 14, 2022 19:21
@cmdcolin cmdcolin force-pushed the util_gettrackname branch 2 times, most recently from f42e908 to 7af4235 Compare October 17, 2022 18:10
@cmdcolin
Copy link
Collaborator Author

this pr should be ready

Note that this PR now adds a number of new extension points including the ability to add custom react components to the feature details widget and "about track" dialog, or completely replace them with a custom component (the ability to replace the widget can replace ANY widget)

new extension point names

Core-extraFeaturePanel
Core-extraAboutPanel
Core-replaceWidget
Core-replaceAbout
Core-customizeAbout

they are documented in the api_guide

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Oct 18, 2022

tentatively fixes #2034

@cmdcolin
Copy link
Collaborator Author

maybe go ahead with a merge, examples of these extension points are in various volvox tracks

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.

None yet

3 participants