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

Select multiple rows in results to create same annotation #259

Closed
stolpeo opened this issue Nov 29, 2021 · 3 comments
Closed

Select multiple rows in results to create same annotation #259

stolpeo opened this issue Nov 29, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@stolpeo
Copy link
Contributor

stolpeo commented Nov 29, 2021

Is your feature request related to a problem? Please describe.
I would like to assign the same annotation to multiple variants. This can be tedious.

Describe the solution you'd like
After filtering variants it would be nice to be able to select several variants (rows) in order to create the same annotation for multiple variants at the same time.

Describe alternatives you've considered
Do everything manual.

#188

@stolpeo stolpeo added the enhancement New feature or request label Nov 29, 2021
@stolpeo stolpeo added this to the v0.24 milestone Nov 29, 2021
@stolpeo stolpeo self-assigned this Nov 29, 2021
@stolpeo
Copy link
Contributor Author

stolpeo commented Jan 12, 2022

Implementation Proposal

Add a checkbox to each variant/row. On top of the table make a new dropdown named "Multi-Variant Actions" or similar. First and only option for now is "Flag & Comment". This opens a popover (or modal?) just like the already known variant comment and flag popover. When submitting, transfer the information and the selected variants.

  • Option 1: Use Javascript to loop over the variants and submit to the existing SmallVariantCommentSubmitApiView and SmallVariantFlagSubmitApiView.
  • Option 2: Add a new view that loops over the variants and uses itself the existing comment and flag views.

I prefer option 1.

Affected Components

  • VarFish server

Affected Modules/Files

  • variants/templates/variants/filter_result/table.html
  • variants/templates/variants/filter_result/row.html
  • svs/templates/svs/filter_result/row_sv.html
  • varfish/static/js/flags_comments.js
  • variants/views.py (possibly)

Required Architectural Changes

None.

Implementation Sketch

  • Add checkbox to row.html and row_sv.html
  • Add dropdown to table.html with title "Multi-Variant Actions" and one entry: "Flag & Comment"
  • Use popover with template from variant flag & comment when entry is clicked.
  • Get variant coordinates from checked variants.
  • Use Javascript to loop over variant information and submit each to the SmallVariantCommentSubmitApiView and SmallVariantFlagSubmitApiView
  • Load previous flags only when they are the same over all variants. If no, assign a visual sign that they are inconsistent and leave them blank.

@holtgrewe
Copy link
Collaborator

Regarding the design, we should define how to treat conflicting existing annotations. We should at least display a warning to the user that they are editing two or more variants that have differences in flags and will override them. Maybe such a text would be enough for a first implementation. We can always refine later.

The main question that then remains is which flags to select by default, I'd say that we take the variant that appears topmost in the result (by whatever sorting). Variants without any flags are ignored (so the topmost of the variants that already have a flag).

@stolpeo
Copy link
Contributor Author

stolpeo commented Jan 18, 2022

Currently conflicting settings get a warning box. I just missed to update the specification after realizing this.

When conflicting, flags are currently set to the default (i.e. left blank, except for the bookmark flag). I will consider taking the setting of the topmost variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants