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 from e5d0c06 to 51b24cc Compare December 18, 2024 08:41
Otherwise we get a typing_extensions version that is too new (support for Python 3.7 was dropped in https://github.com/python/typing_extensions/releases/tag/4.8.0), resulting in a SyntaxError from typing_extensions' `TypedDict`.
@iisakkirotko iisakkirotko force-pushed the feat-resize-focus-tracking branch from 73939ba to f983ed0 Compare December 18, 2024 11:48
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