Skip to content

#3963 - Macro: After removing a monomer from Favorites tab, its tooltip does not disappear and interferes interaction with other monomers#9678

Open
gitquil07 wants to merge 1 commit intomasterfrom
fix-favourite-item-preview
Open

#3963 - Macro: After removing a monomer from Favorites tab, its tooltip does not disappear and interferes interaction with other monomers#9678
gitquil07 wants to merge 1 commit intomasterfrom
fix-favourite-item-preview

Conversation

@gitquil07
Copy link
Copy Markdown
Collaborator

@gitquil07 gitquil07 commented Apr 6, 2026

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

Fix: Library preview persists after unfavoriting from Favorites

Issue: After removing a monomer or RNA preset from Favorites via the star, the library structure preview sometimes stayed visible.

Cause: Preview opens via a 500 ms debounced showPreview in MonomerGroup / RnaPresetGroup. Unfavoriting unmounts the card without a reliable mouseleave, so the usual clear path does not run; a pending debounced call can still fire and restore the preview. Clearing Redux alone does not cancel that debounce (and hidePreview does not cancel the library groups’ debouncer).

Fix: closeLibraryPreview (cancel debounce + showPreview(undefined)) is passed as onStarClick from each group. MonomerItem / RnaPresetItem call onStarClick at the start of addFavorite, before toggleMonomerFavorites / togglePresetFavorites.

Tests: Star click invokes onStarClick in MonomerItem.test.tsx and RnaPresetItem.test.tsx.

Changed: MonomerGroup.tsx, MonomerItem.tsx, RnaPresetGroup.tsx, RnaPresetItem.tsx, RnaPresetItem/types.ts, plus the two tests above.

screen-capture.1.webm

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

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.

Macro: After removing a monomer from Favorites tab, its tooltip does not disappear and interferes interaction with other monomers

1 participant