Skip to content

Do not render variant detail links for variants without valid ClinGen allele IDs #686

Description

@bencap

Summary

Some variant records do not have a valid ClinGen allele ID, but the UI can still render a "View variant details" link for them. When the underlying ID value is a placeholder such as NA, the generated link points to /variants/NA, which cannot load a meaningful variant detail page.

Problem

Score-set visualizations render variant detail links from clingen_allele_id values. The current checks only verify that the value is truthy before generating a link. Placeholder values such as NA are truthy, so they produce broken links like /variants/NA.

This is confusing because the UI presents the link as a valid path to variant details even though no valid ClinGen allele identifier exists.

Steps to reproduce

  1. Open a score set visualization containing variants whose clingen_allele_id is missing or represented as NA.
  2. Hover or interact with the chart tooltip/details area that includes variant actions.
  3. Observe that a "View variant details" link may be rendered.
  4. Click the link.

Observed behavior

The link navigates to /variants/NA or another invalid variant detail route derived from a non-ID placeholder.

Expected behavior

The UI should not render a variant detail link unless the variant has a valid ClinGen allele identifier supported by the variant detail route.

Proposed behavior

Validate the identifier before rendering variant detail links. Placeholder or missing values such as NA, empty strings, null, or undefined should not produce links.

Acceptance criteria

  • Score-set histogram tooltips do not render "View variant details" when clingen_allele_id is missing or set to NA.
  • Score-set heatmap tooltips do not render "View variant details" when clingen_allele_id is missing or set to NA.
  • Valid ClinGen allele identifiers still render working variant detail links.
  • No /variants/NA links are generated from score-set visualization UI.
  • If related route redirects depend on a clingenAlleleId, they only redirect when the resolved ID is valid.

Implementation notes

Consider adding a small shared helper near the existing MaveMD ClinGen allele ID regex so components can consistently check whether an identifier is valid before creating links. Use that helper in score-set histogram and heatmap tooltip generation, and consider using it in any route redirect or search result path that constructs a variant detail route from a potentially nullable or placeholder ID.

Keep the behavior change limited to suppressing invalid links; do not redesign the variant detail page or chart tooltips as part of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions