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

Persist tree visibility #3942

Merged
merged 36 commits into from
Apr 8, 2019
Merged

Persist tree visibility #3942

merged 36 commits into from
Apr 8, 2019

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Mar 25, 2019

Remaining Todo

  • backend: implement updateTreeVisibility update action
  • frontend: send above action
  • [ ] frontend: apply update tree group visibility action in skeleton.js
  • frontend: clean up code (+ fix flow)
  • frontend: write tests? :S

URL of deployed dev instance (used for testing):

Steps to test:

  • open a skeleton (or hybrid) tracing
  • create a few trees and groups
  • toggle the visibility of some trees and groups
  • save & reload
  • the visibilities should be as before

Issues:


  • Updated changelog
  • Needs datastore update after deployment
  • Ready for review

@philippotto
Copy link
Member Author

@youri-k Could you add an extra "toggleTreeUpdateAction" instead of re-using the "updateTreeGroup" action? Due to how we are doing the compactation of the actions in the front-end, this would really help :)

@youri-k
Copy link
Contributor

youri-k commented Mar 28, 2019

@philippotto The route should work. I'm currently doing further testing.

@philippotto philippotto requested a review from daniel-wer March 28, 2019 17:35
@philippotto philippotto marked this pull request as ready for review March 28, 2019 17:42
@philippotto
Copy link
Member Author

@daniel-wer I think you can already review this PR if you feel like it. I'll add some tests in the mean time :)

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.

You solved this complicated issue very well in this PR! I especially like that you pointed out the compactToggleActions function for the high-level understanding in a comment. The function is extremely readable and makes it easy to understand what's happening 👍

I'll go on and test now :)

@daniel-wer
Copy link
Member

daniel-wer commented Apr 2, 2019

I encountered some issues during testing:

  • When loading a tracing that was created before this PR, all trees are invisible (at least that's shown in the trees tab), but they are shown in the viewports anyways. I think that's two issues:
    • The isVisible default for tracings that existed before this PR seems to be false but should be true.
    • Trees with isVisible set to false, are still shown in the viewports when loading the tracing.
  • When toggling a group that contains an empty group in its subtree (among other groups and trees), the following error is thrown:
TypeError: Cannot read property 'isVisible' of undefined
    at eval (VM8089 compact_toggle_actions.js:115)
    at arrayAggregator (VM7013 lodash.js:497)
    at Function.eval [as partition] (VM7013 lodash.js:4829)
    at isCommonAncestorToggler (VM8089 compact_toggle_actions.js:115)
    at compactToggleActions (VM8089 compact_toggle_actions.js:169)
    at compactUpdateActions (VM8088 compact_update_actions.js:135)
    at saveTracingTypeAsync (VM8084 save_saga.js:277)
    at saveTracingTypeAsync.next (<anonymous>)
    at next (VM7995 proc.js:321)
    at currCb (VM7995 proc.js:398)
  • Import the attached NML in a skeletontracing:
    • All trees are visible and selected. Reload the page, now all trees are invisible.
    • Now toggle all trees to be visible again. Reload the page, now only the trees in the root group are visible, but not those in the groups.

tree-visibility-test.zip

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.

I'll approve once the mentioned issues are resolved :)

@philippotto
Copy link
Member Author

philippotto commented Apr 4, 2019

Thanks for the thorough testing and your feedback! In the meantime, I added some tests and extracted the defaultState into an own module, as discussed.

@youri-k Here's the backend todo list, we just discussed:

  • ensure that trees created before this PR, get the isVisible=true property
  • when creating a new tree (manually or via frontend NML upload), that tree needs to get the isVisible attribute
  • double-check backend NML upload behavior

@philippotto
Copy link
Member Author

philippotto commented Apr 4, 2019

backend:

  • toggling a tree group should work for hierarchical groups

@philippotto philippotto requested a review from fm3 April 5, 2019 08:56
@philippotto
Copy link
Member Author

The PR should be ready for another round of review, @daniel-wer.
@fm3, can you have a look at the back end code?

  • When toggling a group that contains an empty group in its subtree (among other groups and trees), the following error is thrown:

I couldn't reproduce this. Maybe this was unintentionally fixed in the meantime? Can you please try to reproduce this again to ensure that I didn't miss anything? :)

Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Backend LGTM, added a comment regarding a possible minor refactoring

}

childIter(Seq(rootGroup))
}
Copy link
Member

Choose a reason for hiding this comment

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

I think it should be possible to do this in one function (without the nested childIter), just start the match etc. directly on rootGroup. Also, I would then just call it group instead of rootGroup/currentGroup. (Since this is not actually used for the root group case of the tracings)

@@ -63,7 +63,7 @@ case class UpdateTreeSkeletonAction(id: Int,
branchPoints = branchPoints.map(convertBranchPoint),
comments = comments.map(convertComment),
name = name,
groupId = groupId
groupId = groupId,
Copy link
Member

Choose a reason for hiding this comment

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

is there a special reason for this change?

@philippotto philippotto requested a review from daniel-wer April 8, 2019 08:12
@daniel-wer
Copy link
Member

I couldn't reproduce this. Maybe this was unintentionally fixed in the meantime? Can you please try to reproduce this again to ensure that I didn't miss anything? :)

I can still reproduce this. Try toggling the root group in this tracing: https://persisttreevisibility.webknossos.xyz/annotations/Explorational/5cab0f9b0100001c00084973#612,702,502,0,2.000,176

Apart from that, this is looking all good! 👍

@philippotto
Copy link
Member Author

I couldn't reproduce this. Maybe this was unintentionally fixed in the meantime? Can you please try to reproduce this again to ensure that I didn't miss anything? :)

I can still reproduce this. Try toggling the root group in this tracing: https://persisttreevisibility.webknossos.xyz/annotations/Explorational/5cab0f9b0100001c00084973#612,702,502,0,2.000,176

Ah, thanks for the repro 👍 I fixed it now :)

@philippotto philippotto merged commit f7a29d2 into master Apr 8, 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 persist-tree-visibility 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist tree visibility across page refreshes
4 participants