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

Fix variants bugs #1 #484

Merged
merged 17 commits into from
Oct 16, 2024
Merged

Fix variants bugs #1 #484

merged 17 commits into from
Oct 16, 2024

Conversation

orlinmalkja
Copy link
Contributor

No description provided.

@orlinmalkja orlinmalkja self-assigned this Oct 14, 2024
src/components/annotations/variants/VariantsTopBar.vue Outdated Show resolved Hide resolved
@@ -61,10 +61,12 @@ onBeforeUnmount(() => unsubscribe())

function allocateWitnessColorInVariantItem() {
const colors = {}
annotationStore.witnesses.forEach((witness, i) => {
if(annotationStore.witnesses?.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use "early return" pattern, since wrapping an "if" around some code is kind of ugly

src/stores/annotations.ts Show resolved Hide resolved
src/stores/annotations.ts Outdated Show resolved Hide resolved

if (!target) {
if (!target || target.getAttribute('data-annotation-level') < 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We identified today that this wasn't really the issue of the bug. So this is not needed anymore I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, true.

src/utils/annotations.js Outdated Show resolved Hide resolved
let witnessesHtmlEl = parentEl.children[indexOfTarget-1]
witnessesHtmlEl.appendChild(witHtml)
}
}

function createWitnessesHtml(witHtml, parentEl, targetHtmlEl) {
const witnessesHtmlEl = document.createElement("span");
witnessesHtmlEl.classList.add('witnesses')
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can omit the words"witnessesHtml" if those are already in your function name (btw this applies also for classes or components). Call it "resultEl" or just "el", it will be fine.

@orlinmalkja
Copy link
Contributor Author

For now, I am done with this PR. Please continue reviewing.

@orlinmalkja
Copy link
Contributor Author

@paulpestov from my side I am done with this PR. Please continue reviewing.

@orlinmalkja orlinmalkja merged commit 14263e5 into main-variants Oct 16, 2024
2 checks passed
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