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

Adds a way to preserve user-preferred mesh grid state #1460

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

mockoocy
Copy link

Fixes a bug / bad UX in which caused mesh grid to became unhidden after certain operations like DataCollection or Phase change.

The steps to reproduce the bugs were as following:

  • mount a sample
  • open draw_grid control
  • draw a few grids
  • make some of them hidden
  • right click on canvas, press Data Collection button
  • run the task
    After the task was done, each of the grids was shown again.
    It's also worth adding that in the demo beamline many of the motors seem to not be mocked, so the behavior can't be observed.

The reason for this behavior was further described in this Pull request mxcube/mxcubecore#1044 for mxcubecore. This PR will be marked as draft until the mxcubecore one is merged.

The fix writes to state set by user to Shape.user_state attribute on the mxcubecore side.
When the data collection or phase change is finished, then the user-preferred state is restored by setting Shape.state to be equal to Shape.user_state.

@mockoocy
Copy link
Author

mockoocy commented Oct 18, 2024

Turns out the same issue happens for the zoom and focus controls. Will also try to fix it for these in this PR.

@fabcor-maxiv
Copy link
Contributor

Turns out the same issue happens for the zoom and focus controls. Will also try to fix it for these in this PR.

@mockoocy Note that there was work on focus and zoom controls very recently: #1457. I do not know if it is related or not.

@mockoocy
Copy link
Author

added some changes;
now the UI has some indicator that specific grid is being hidden (it appears with a darker background)
I have also changed HWR.beamline.sample_view.add_shape_from_mpos function, also when updating shapes there are optionally more arguments passed to it, so that shape and user_shape are not changed when grids is being redrawn sometimes.

@marcus-oscarsson
Copy link
Member

Thanks @mockoocy, do you happen to have a screenshot of the changes ?

@mockoocy
Copy link
Author

Thanks @mockoocy, do you happen to have a screenshot of the changes ?

image

@elmjag
Copy link
Contributor

elmjag commented Oct 24, 2024

@marcus-oscarsson I think we have different ideas how this mesh hidding/un-hidding is suppose to work.

Like what is the actual desired behavior. Perhaps we can discuss this in a video meeting? I'm at least a bit confused right now.

@mockoocy mockoocy force-pushed the pm-fix-preserve-mesh-grid-state branch from dc91738 to 0a68c99 Compare October 24, 2024 08:43
@marcus-oscarsson
Copy link
Member

marcus-oscarsson commented Oct 24, 2024

@elmjag sure, we can have a quick chat if you like. How about tomorrow ? Otherwise I think the current proposal is fine maybe the color could be a bit more fun (other than dark gray :) ) and what do you think about a text perhaps under the hide button (saying "hidden by user" and perhaps "out of view" when hidden automatically) ?

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.

4 participants