Skip to content

Score Set raw/mapped toggle leaves active visualization tooltip text stale #735

@bencap

Description

@bencap

Summary

On the Score Set screen, switching between raw variant strings and mapped variant strings does not immediately update the text in an already-visible histogram and heatmap tooltip. The tooltip only reflects the new coordinate mode after the user hovers over a different bin or otherwise forces the hover tooltip to be redrawn.

Problem

The raw/mapped toggle changes the coordinate mode used by visualization tooltip label generation, but the currently displayed hover tooltip appears to keep its existing DOM content. This creates a misleading state where the visualization is in one coordinate mode while the visible tooltip still shows the previous mode’s HGVS context.

This is especially confusing when raw and mapped HGVS strings differ, because the user can toggle modes and still see the old label until they move to another bin.

Steps to reproduce

  1. Open a Score Set page with variants that have different raw and mapped HGVS labels.
  2. Hover over a histogram bin so the tooltip is visible.
  3. Toggle between raw variants and mapped variants while keeping the tooltip active.
  4. Observe the visible tooltip text.
  5. Move to a different histogram bin or re-trigger hover.
  6. Observe that the tooltip text then updates to the new coordinate mode.

Expected behavior

The currently visible visualization tooltip should update immediately when the raw/mapped coordinate mode changes.

If immediate refresh is not practical, the tooltip should be hidden on coordinate-mode change so stale labels are not displayed.

Observed behavior

The visible tooltip keeps showing the old raw/mapped HGVS label until the user hovers over a different bin or otherwise causes the tooltip to be redrawn.

Proposed behavior

When the Score Set coordinate mode changes, refresh any visible histogram tooltip content using the current tooltip label logic and the current coordinate mode.

This should apply to:

  • Active hover tooltips.
  • Persistent selection tooltips, if one is visible.
  • Histogram tooltips that depend on raw/mapped label precedence.

Acceptance criteria

  • Toggling raw/mapped mode on the Score Set screen immediately updates any visible histogram tooltip text.
  • The user does not need to hover over another bin to see the correct HGVS context.
  • Newly rendered and already-visible tooltips use the same raw/mapped label precedence.
  • Persistent selection tooltips remain correct after coordinate-mode changes.
  • The Variant page histogram behavior remains unchanged and continues to use mapped coordinate context where intended.
  • Existing histogram selection, lock-selection, and external-selection behavior are not regressed.

Implementation notes

The likely issue is in the histogram helper’s tooltip lifecycle rather than the data-fetching layer. The tooltip label getter already has access to coordinate mode, but the helper appears to regenerate hover tooltip HTML only on hover events. Refreshing the histogram updates bin/selection state, but an already-visible hover tooltip can retain its previous DOM content.

A focused fix could take one of two approaches:

  • Add a histogram helper method to refresh currently visible tooltip HTML, then call it from the Score Set histogram component when the coordinates prop changes.
  • Alternatively, hide the active hover tooltip when coordinates changes so stale labels are removed and the next hover shows fresh content.

Refreshing is preferable because it preserves the user’s current hover context without requiring another interaction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: frontendTask implementation touches the frontendtype: bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions