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

Variant item selection/deselection #459

Merged
merged 16 commits into from
Aug 8, 2024

Conversation

orlinmalkja
Copy link
Contributor

In this PR I add the following features:

  • selecting one variant item highlights with blue its respective annotated text
  • if the variant item is deselected the last from its 'variant annotation group', only then we dehighlight the annotated text
  • selecting/deselecting a variant item adds/removes the witness chip incrementally

@orlinmalkja orlinmalkja self-assigned this Aug 7, 2024
src/components/annotations/AnnotationVariantItem.vue Outdated Show resolved Hide resolved
src/components/annotations/AnnotationVariantItem.vue Outdated Show resolved Hide resolved
@@ -233,6 +233,71 @@ export function removeIcon(annotation) {
}
}

export function addWitness(selector, witness, witnessColor, variantItemsSelected, variantItemsColors) {
const targetHtmlEl = document.querySelector(selector)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Avoid using document at root of your DOM manipulations. Try to use at least #text-content. Actually we need to find a way to select from the right text panel. But this is yet to come.

src/utils/annotations.js Outdated Show resolved Hide resolved
src/utils/annotations.js Outdated Show resolved Hide resolved
@orlinmalkja orlinmalkja merged commit 69ee315 into main-variants Aug 8, 2024
2 checks passed
@orlinmalkja orlinmalkja deleted the variant-item-selection- branch August 8, 2024 12:47
paulpestov pushed a commit that referenced this pull request Aug 21, 2024
* feat: style better the "chip"

* feat: add border color for each of the different ‘chips’

* feat: split up the variant items

* feat: select only one variant item

* feat: select a variant item and toggle accordingly

* feat: add the 'witnesses chips' in the text

* feat: remove 'witnesses chips' in other tabs

we select a few variant items -> chips are shown in the text.
When we switch the annotation tab i.e to 'Motifs' then the chips should not be shown in the text anymore

* feat: remove the witnesses in the text

for each variant item we deselect, we remove the 'witness chip' from the text

* chore: change the icon names in the config

* style: fix linting

* refactor: remove 'isText' from AnnotationVariantItem

* refactor: use watch to initialize 'variantItemsSelection'

* refactor: access 'target' from the text Panel html element

* refactor: keep the same text of witness served from the backend

* style: minor

* refactor: access the witnesses span from the text panel html el

---------

Co-authored-by: malkja <[email protected]>
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.

2 participants