-
Notifications
You must be signed in to change notification settings - Fork 64
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
Adds session model reference to view in focus #3831
Conversation
Note: omitted work on bookmarks discussed in July 26th backlog grooming to make this PR more on-topic. What's been done here doesn't actually violate the current behaviour of the bookmarks. |
Solicited feedback:
|
Codecov Report
@@ Coverage Diff @@
## main #3831 +/- ##
==========================================
+ Coverage 64.35% 64.40% +0.04%
==========================================
Files 998 999 +1
Lines 29656 29722 +66
Branches 7116 7137 +21
==========================================
+ Hits 19084 19141 +57
- Misses 10411 10419 +8
- Partials 161 162 +1
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
document.removeEventListener('mousedown', handleSelectView) | ||
document.removeEventListener('keydown', handleSelectView) | ||
} | ||
}, [ref, view]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is likely unneeded to put ref in dependency array https://epicreact.dev/why-you-shouldnt-put-refs-in-a-dependency-array/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included it in the dependency array because of a lint warning: 76:6 warning React Hook useEffect has missing dependencies: 'ref'. Either include it or remove the dependency array react-hooks/exhaustive-deps
Which that article does mention:
The reason we get the warning there when we didn't get it within the component is because ESLint is pretty limited in its ability to trace what you're doing with your JavaScript. So the React plugin for ESLint can't know that cbRef is actually a ref. So just to be safe, it warns you.
Luckily, as we just learned, including it in the dependency array doesn't make any difference anyway, so just include it!
Let me know if maybe I'm reading that wrong.
technically there is the concept of "subviews", so a synteny view contains two linear genome view's each with their own track selectors. the concept of the focused view in this case may not work because it only looks at session.views |
…olors infocus view secondary.light palette, and outfocus view secondary.dark
@cmdcolin the lint issue is that the focus mixin had to be added to both react linear genome view and circular view to satisfy the changes to the AbstractSessionModel to include the new properties for focus on the session -- the linter wants app-core to be added to their dependencies but I don't want to needlessly inflate those projects. Thoughts? |
probably don't want to add app-core to the embedded widgets the abstractsessionmodel can make those properties optional to satisfy this, or a abstractsessionmodel subtype "SessionModelWithFocusedView" could be created (there are several types like this in core) |
i think it looks great at https://jbrowse.org/code/jb2/add-focus-view/?session=share-jty6tZYS58&password=GvT5P could probably merge? any reason why the dimensions have changed in some of the snaps? |
Trying to diagnose the snaps now, no idea what's causing it >:( |
plugins/linear-genome-view/src/LinearGenomeView/components/LinearGenomeView.tsx
Outdated
Show resolved
Hide resolved
merged post v2.6.3 release, can do a little usability testing on it via main :) |
Resolves #2174
rootsession model property "focusedViewId" that permits reference to the view in focus