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

Prefer annotation zoom over dataset zoom #3992

Merged
merged 10 commits into from
Apr 11, 2019

Conversation

MichaelBuessemeyer
Copy link
Contributor

This PR changes the initialization of tracings and so that the zoom level of annotations is preferred over the zoom set as default by the dataset.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • (just a guess though): Create an explorative tracing and change the zoom level. Now save the state of the tracing. Then remove the whole state (position, zoom and ...) from the url and reload the page. The zoom level should be the same as before.

Issues:


Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Good job finding the cause of this subtle bug. 👍
I made a suggestion for a more generic solution :)

@@ -122,7 +122,13 @@ export async function initialize(
// There is no need to reinstantiate the DataLayers if the dataset didn't change.
if (initialFetch) {
initializationInformation = initializeDataLayerInstances();
if (tracing != null) Store.dispatch(setZoomStepAction(getSomeServerTracing(tracing).zoomLevel));
if (tracing != null) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest not moving the code here, but rather to keep it in the determineDefaultState function, because you would expect it there. This line just sets "any" zoomstep, because other steps early in the initialization need a valid zoomstep.
I'll add a suggestion in the determineDefaultState function.

Copy link
Member

Choose a reason for hiding this comment

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

So just to make it clear, I'd revert the changes in this file and apply the suggested fix in the model_initialization.js

if (urlState.zoomStep != null) {
({ zoomStep } = urlState);
}
const { zoomStep } = urlState;
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest handling the zoomstep case the same way as the position and rotation, this should fix the bug as well:

let zoomStep = datasetConfiguration.zoom;
if (tracing != null) {
  zoomStep = getSomeServerTracing(tracing).zoomLevel;
}
if (urlState.zoomStep != null) {	
  ({ zoomStep } = urlState);	
}

(untested)

@MichaelBuessemeyer
Copy link
Contributor Author

@daniel-wer Thanks for your feedback and solution 👍 . I applied your feedback. As I can not reproduce the bug, I don't know a way how to test whether these changes fix the bug.

From a logical perspective (looking at the code changes) I'd say that this PR fixes the bug.
So I'd suggest to merge these changes and further investigate if the bug occurs again. Is that alright Daniel?

@daniel-wer daniel-wer changed the base branch from master to 19.03.2 April 8, 2019 16:40
@daniel-wer daniel-wer changed the base branch from 19.03.2 to master April 8, 2019 16:40
@daniel-wer
Copy link
Member

@MichaelBuessemeyer Yes, sounds good :)

@MichaelBuessemeyer MichaelBuessemeyer merged commit eeb2051 into master Apr 11, 2019
hotzenklotz added a commit that referenced this pull request Apr 25, 2019
* master: (43 commits)
  update screenshots (#4038)
  docker: don't set sbt/ivy cache (#4034)
  Slow down brush size change for small sizes (#4012)
  voulme tool bar now depends only on the active tool (#4029)
  Allow user to adapt GPU memory consumption to allow for better quality (#4015)
  Updates the Docs (#4020)
  hiding pricing and features in iframe (#4019)
  Fix sitemap for publication detail view (#4024)
  Add sitemap.xml (#4006)
  Allow empty trees  (#4010)
  Prefer annotation zoom over dataset zoom (#3992)
  Add details view for publications (#3994)
  remove enzyme test (#3997)
  Tensorflow segmentation (#3461)
  ensure that max zoom step is not exceeded when changing viewport area (#3996)
  allow isosurfaces for hybrid tracings when setting window.allowIsosurfaces (#3998)
  re-fetch buckets if fetching them failed (#3999)
  Only re-compute bounding sphere of skeletons if something changed (#3995)
  Fix dropdown login padding (#3988)
  Persist tree visibility (#3942)
  ...
@philippotto philippotto deleted the prefer-annotation-zoom branch May 20, 2019 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotation zoom is overridden by dataset zoom
3 participants