Skip to content

#6429 - Selection works wrong for line symbol and for phosphate#9680

Open
bekaChaduneli wants to merge 1 commit intomasterfrom
6429-selection-works-wrong-for-line-symbol
Open

#6429 - Selection works wrong for line symbol and for phosphate#9680
bekaChaduneli wants to merge 1 commit intomasterfrom
6429-selection-works-wrong-for-line-symbol

Conversation

@bekaChaduneli
Copy link
Copy Markdown
Collaborator

How the feature works? / How did you fix the issue?

Fixed unintended selection highlight appearing on blank space blocks below line (-) and P symbols in Sequence Layout Mode.

Root cause:

In a two-stranded chain (e.g., loaded via HELM with RNA1,RNA2,2:pair-2:pair), each rendered position is backed by a twoStrandedNode containing both a sense and an antisense slot. When clicking a sense node such as a BackBoneSequenceNode (-), its underlying monomer's selected flag is set to true. The antisense slot for that position is rendered as an EmptySequenceNode — but because it shares the same monomer, this.node.monomer.selected was also true, causing drawSelection() to call appendSelection() and inject a green <rect fill="#57FF8F"> into the empty placeholder below.

Changes made:

BaseSequenceItemRenderer.ts

  • drawSelection() — Added an early-return guard: if this.node is an instance of EmptySequenceNode or BackBoneSequenceNode, removeSelection() is called immediately and the method returns, preventing any selection rectangle from being appended to structural placeholder nodes.

Visual states after the fix:

Node type Selected monomer Selection rect drawn
MonomerSequenceNode / Nucleotide etc. true ✅ Yes
BackBoneSequenceNode (-) true (shared) ❌ No
EmptySequenceNode (blank antisense slot) true (shared) ❌ No

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

@bekaChaduneli bekaChaduneli self-assigned this Apr 6, 2026
@bekaChaduneli bekaChaduneli linked an issue Apr 6, 2026 that may be closed by this pull request
@AlexeyGirin AlexeyGirin changed the title #6429 - Fix: Selection works wrong for line symbol and for phosphate #6429 - Selection works wrong for line symbol and for phosphate Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selection works wrong for line symbol and for phosphate

1 participant