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

Change track selector togglebutton to normal button #1442

Merged
merged 5 commits into from
Nov 30, 2020

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Nov 13, 2020

This code has been a tricky thing to maintain properly since it pokes deeply into the state of the drawerwidget, so I propose removing it. Alternatively we could refactor to extract this, but another area of the code (the "Select tracks" button) removed the toggle state already.

fixes #1411
fixes #1499

@cmdcolin
Copy link
Collaborator Author

Another random redesign proposal added here...

localhost_3000__config=test_data%2Fconfig_demo json session=local-4F_ic2etM

Add the literal text "open track selector" always on this panel, just in case people become very lost trying to open the track selector?

@rbuels
Copy link
Contributor

rbuels commented Nov 13, 2020

what if we added isAssociatedWith(thing: any): boolean to the API of widget
this would be a view with parameters on the MST model of the widget

and the default implementation of it is () => false

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 14, 2020

Note that there is no BaseWidgetModel, so we can't assume isAssociatedWith is on the API necessarily unless we want to crash for this purpose, and so the expression that is used in many places in the code looks like

              isSessionModelWithWidgets(session) &&  session.visibleWidget?.isAssociatedWith?.(self.id),

It is fairly cumbersome, but is a one liner that we can implement

@cmdcolin
Copy link
Collaborator Author

Refer to https://github.com/GMOD/jbrowse-components/compare/isassociatedwith for diff with master for this change

Base automatically changed from new_track_selector_icon to master November 16, 2020 19:07
@cmdcolin cmdcolin marked this pull request as draft November 19, 2020 03:00
@cmdcolin
Copy link
Collaborator Author

Any thought on whether we could merge this PR as is?
I think that the setting of the disabled state seems to have been obsoleted by #1354

The alternative isAssociatedWith stuff isn't super elegant so codewise I basically prefer this unless it's desirable to keep the disabled state

@rbuels rbuels marked this pull request as ready for review November 25, 2020 20:04
@rbuels
Copy link
Contributor

rbuels commented Nov 25, 2020

Can you confirm this fixes both #1411 and #1499?

@cmdcolin cmdcolin force-pushed the remove_toggle_trackselector_menu branch from 39e1db4 to 68786c1 Compare November 25, 2020 20:30
@cmdcolin
Copy link
Collaborator Author

Yep, fixes both

@cmdcolin
Copy link
Collaborator Author

The original screenshot here proposed having the literal text "Open track selector" visible in the header but I removed that for a little more brevity for now

@rbuels rbuels added the bug Something isn't working label Nov 25, 2020
@codecov
Copy link

codecov bot commented Nov 25, 2020

Codecov Report

Merging #1442 (4a06dd5) into master (34eddf1) will increase coverage by 0.00%.
The diff coverage is 20.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1442   +/-   ##
=======================================
  Coverage   59.47%   59.48%           
=======================================
  Files         435      435           
  Lines       19547    19512   -35     
  Branches     4581     4552   -29     
=======================================
- Hits        11625    11606   -19     
+ Misses       7623     7607   -16     
  Partials      299      299           
Impacted Files Coverage Δ
...tplot-view/src/DotplotView/components/Controls.tsx 42.85% <ø> (-4.52%) ⬇️
plugins/dotplot-view/src/DotplotView/model.ts 46.51% <ø> (+0.22%) ⬆️
...omparative-view/src/LinearComparativeView/model.ts 10.00% <ø> (+0.52%) ⬆️
...me-view/src/LinearGenomeView/components/Header.tsx 78.84% <ø> (-1.86%) ⬇️
...s/linear-genome-view/src/LinearGenomeView/index.ts 83.72% <ø> (-0.19%) ⬇️
...roducts/jbrowse-desktop/src/sessionModelFactory.ts 1.68% <0.00%> (+0.02%) ⬆️
products/jbrowse-web/src/sessionModelFactory.ts 62.50% <0.00%> (+0.64%) ⬆️
...r-view/src/CircularView/components/CircularView.js 89.47% <100.00%> (-0.65%) ⬇️
...ins/wiggle/src/LinearWiggleDisplay/models/model.ts 82.88% <0.00%> (+0.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34eddf1...4a06dd5. Read the comment docs.

@rbuels rbuels merged commit 628a349 into master Nov 30, 2020
@cmdcolin cmdcolin deleted the remove_toggle_trackselector_menu branch December 1, 2020 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crashes when closing linear vs. ref view with track open Error on closing linear synteny view
2 participants