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

Added shorthand to mark branch points from context menu #6012

Merged
merged 10 commits into from
Feb 4, 2022

Conversation

hotzenklotz
Copy link
Member

I added the option to mark a node as branch point directly from the context menu.

I felt like this was missing. I decided against the option to "remove" as branch point because that cause wK to jump to a different location which I felt was weird... or at least unintuitive when interacting with a single node.

Any not sure if there was an active design decision to not include it, that I am not aware of?

Screenshot 2022-02-02 at 17 41 12

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Place a node
  • Right-click on node to bring up context-menu
  • Select "mark as branch point" option

Issues:


(Please delete unneeded items, merge only when none are left open)

@hotzenklotz hotzenklotz self-assigned this Feb 2, 2022
…nchpoints_shortcut

* 'master' of github.com:scalableminds/webknossos:
  use allDataBlocking and temporary files for explorative download (#6009)
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Great stuff! Code looks perfect. The only thing I'm hesitant about is:

I decided against the option to "remove" as branch point because that cause wK to jump to a different location which I felt was weird... or at least unintuitive when interacting with a single node.

I agree, that it would be unintuitive to use the normal "pop branchpoint" behavior by default, but it also seems weird that a branchpoint cannot be removed from the context menu even though it was created via that menu. I imagine that users might be having a hard time to remove a branchpoint then.

I think, it should be simple to remove a branchpoint from the context menu which does not change the current position. For this, you would need to make setting activeNodeId here conditional: https://github.com/scalableminds/webknossos/blob/master/frontend/javascripts/oxalis/model/reducers/skeletontracing_reducer.js#L602
The condition itself would be contained in the action deleteNodeAction which could be changed to:

// in skeletontracing_actions.js:
export const deleteNodeAction = (
  nodeId?: number,
  treeId?: number,
  jumpToPrevious: boolean = true,
  timestamp: number = Date.now(),
): DeleteNodeAction => ({
  type: "DELETE_NODE",
  nodeId,
  treeId,
  timestamp,
  jumpToPrevious,
});

The third spot which would need to be adapted is probably in skeletontracing_saga.js in centerActiveNode which should do if (action.type == "DELETE_BRANCHPOINT" && !action.jumpToPrevious) return; so that no re-centering is performed.

What do you think?

@hotzenklotz
Copy link
Member Author

I agree that having "unmark as branch point" would be nice as well and good style. However, I think the implementation is not as easy as outlined. The DELETE_BRANCHPOINT action always(!) delete the last branch point for the queue (aka pop). Let's have another look tomorrow.

@philippotto
Copy link
Member

I agree that having "unmark as branch point" would be nice as well and good style. However, I think the implementation is not as easy as outlined. The DELETE_BRANCHPOINT action always(!) delete the last branch point for the queue (aka pop). Let's have another look tomorrow.

Ah, good catch. Then, I assume, we would need a new action with a separate reducer. Let me know if you want to talk about it or whether you want to delegate this.

@hotzenklotz
Copy link
Member Author

@philippotto I added the "unmark as branch point" functionality. Please review / check. Thanks

…nchpoints_shortcut

* 'master' of github.com:scalableminds/webknossos:
  For empty volume tracings, serve header-only zip (#6022)
@philippotto
Copy link
Member

The code looks good 👍 I'd only rename the action from deleteSelectedBranchpoint to deleteBranchpointById, since the first name sounds like the selected ("aka" active) node plays a role for the action.

Also, the CI fails (due to prettier?) currently. When it succeeds, I'll do testing round :)

@hotzenklotz
Copy link
Member Author

@philippotto I applied your PR feedback and renamed the action. CI should also be fixed.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Testing went superbly.

party

@hotzenklotz hotzenklotz enabled auto-merge (squash) February 4, 2022 16:03
@hotzenklotz hotzenklotz merged commit 891820b into master Feb 4, 2022
@hotzenklotz hotzenklotz deleted the branchpoints_shortcut branch February 4, 2022 16:35
hotzenklotz added a commit that referenced this pull request Feb 8, 2022
* 'master' of github.com:scalableminds/webknossos:
  Log legacy route usages (#6024)
  Change GET routes with side effects to POST (#6023)
  More api swagger annotations (#5989)
  add shorthand for deleting trees (#6013)
  Added shorthand to mark branch points from context menu (#6012)
  Map node group context menu to right-click (#6021)
  For empty volume tracings, serve header-only zip (#6022)
  use allDataBlocking and temporary files for explorative download (#6009)
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.

2 participants