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

feat: resize & focus tracking in view_data #112

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iisakkirotko
Copy link

@iisakkirotko iisakkirotko commented Dec 11, 2024

Pull Request Template

Description

Stores timestamps resized_at and focused_at in view_data. This is useful to track which viewer figures should have their shape set based on.

@maartenbreddels and others I welcome discussion / feedback on the focus portion in particular:

  • Should we also track the last point at which focus entered a view?
  • Is there any need to remove the eventListener from window?

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 42.42%. Comparing base (7b90b9d) to head (5ebab1c).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
bqplot_image_gl/viewlistener.py 0.00% 10 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (7b90b9d) and HEAD (5ebab1c). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (7b90b9d) HEAD (5ebab1c)
5 4
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   50.00%   42.42%   -7.58%     
==========================================
  Files           7        8       +1     
  Lines         140      198      +58     
==========================================
+ Hits           70       84      +14     
- Misses         70      114      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@maartenbreddels maartenbreddels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR!
The only worry I have is that a particular view could also have received the focus event. We could also implement this later on, so we don't just listen to the window focus event, but also the element's focus event.
What do you think?

@mariobuikhuizen
Copy link
Contributor

Why are we storing all views if we only use the last updated view?

@maartenbreddels
Copy link
Collaborator

That is an implementation detail (or particular use case) of glue-jupyter, this is a general widget.

This allows us to track what view is the active one, and resize figures based on that.
@iisakkirotko iisakkirotko force-pushed the feat-resize-focus-tracking branch 2 times, most recently from 73939ba to f983ed0 Compare December 18, 2024 11:48
@iisakkirotko
Copy link
Author

iisakkirotko commented Dec 18, 2024

So I think I managed to track down the issue, which was in a different place than I thought. Looks like the tox scripts that are used to run tests (OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1) seem to be using conda for installing dependencies. However, the conda-forge package for typing_extensions is maintained by a third party (see this comment), and claims to support Python 3.7 even in current versions, while actually support for Python 3.7 was dropped in 4.8.0. This causes conda to resolve an actually incompatible version of the package, which in turn causes the tests to fail. How to solve it... I'll look into :)

@iisakkirotko iisakkirotko force-pushed the feat-resize-focus-tracking branch 2 times, most recently from 7907942 to 6d13145 Compare December 18, 2024 15:08
For some reason, it looks like a version of typing-extensions that's too modern for Python 3.7 is picked otherwise. This could be related to the conda-forge version of typing-extensions having the wrong minimum python version listed, see [this comment](python/typing_extensions#282 (comment)).
@iisakkirotko iisakkirotko force-pushed the feat-resize-focus-tracking branch from 6d13145 to b19fee3 Compare December 18, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants