Skip to content

#7781 - Inconsistency in fragment selection hover behavior between Micro and Macro modes#9661

Merged
AlexeyGirin merged 5 commits intomasterfrom
7781-fix-inconsistency-selection-hover-behavior-between-Micro-and-Macro-modes
Apr 6, 2026
Merged

#7781 - Inconsistency in fragment selection hover behavior between Micro and Macro modes#9661
AlexeyGirin merged 5 commits intomasterfrom
7781-fix-inconsistency-selection-hover-behavior-between-Micro-and-Macro-modes

Conversation

@DmirtyUsov
Copy link
Copy Markdown
Collaborator

@DmirtyUsov DmirtyUsov commented Apr 3, 2026

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

Structure Selected Tool

State Molecules Macromolecules
1 Not-Selected Image Image
2 Hover Image image
3 Hover + Click Image image
4 Selected Image Image
5 Selected + Hover Image image

Changed in AtomRenderer.ts redrawHover()

On hover start: if the atom is also selected, changes the selection circle fill from #57FF8F (bright green) to #CCFFDD (light mint) — the same color Molecules uses for hover+selected
On hover end: restores the selection circle fill back to #57FF8F
This makes the selected+hovered state in Macromolecules visually match Molecules (teal outline with light mint fill), without changing rendering order or adding new elements.

Added redrawHover() override to BondRenderer.ts

On hover start: if the bond is also selected, changes its selection fill from #57ff8f (bright green) → #CCFFDD (light mint)
On hover end: restores it back to #57ff8f
This matches the same pattern applied to AtomRenderer for the selected+hovered state.

Added to constants.ts

export const SELECTION_COLOR = '#57FF8F';
export const SELECTION_HOVERED_COLOR = '#CCFFDD';

Replaced magic strings in 12 files:

File Was
AtomRenderer.ts '#57FF8F' / '#CCFFDD'
BondRenderer.ts '#57ff8f' / '#CCFFDD'
BaseMonomerRenderer.ts '#57FF8F'
FlexModePolymerBondRenderer.ts '#57FF8F' / '#CCFFDD'
SnakeModePolymerBondRenderer.ts '#57FF8F' / '#CCFFDD'
PolymerBondSequenceRenderer.ts '#57FF8F'
BaseSequenceItemRenderer.ts '#57FF8F'
RxnArrowRenderer.ts '#57ff8f'
MultitailArrowRenderer.ts '#57ff8f'
MonomerToAtomBondRenderer.ts '#57ff8f'
RxnPlusRenderer.ts '#57ff8f'
options.ts '#57FF8F' / '#CCFFDD'

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

fixes #7781

@DmirtyUsov DmirtyUsov requested review from rrodionov91 and svvald April 3, 2026 10:47
@DmirtyUsov DmirtyUsov marked this pull request as ready for review April 3, 2026 10:48
@AlexeyGirin AlexeyGirin merged commit 7c00b9e into master Apr 6, 2026
14 of 15 checks passed
@AlexeyGirin AlexeyGirin deleted the 7781-fix-inconsistency-selection-hover-behavior-between-Micro-and-Macro-modes branch April 6, 2026 10:14
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.

Inconsistency in fragment selection hover behavior between Micro and Macro modes

3 participants