Skip to content

Conversation

@bencap
Copy link
Collaborator

@bencap bencap commented Nov 27, 2025

This pull request enhances the VariantScreen.vue component by adding a feature to download annotations for the selected variant. It introduces a new SplitButton in the header, allowing users to choose from multiple annotation types to download as JSON files. The implementation includes new computed properties and a method for fetching and downloading the annotation data, as well as UI improvements for better usability.

Feature: Download Variant Annotations

  • Added a SplitButton to the variant header that enables users to download different types of annotations (clinical evidence, functional impact statement, study result) for the currently selected variant. The button dynamically updates its options based on the available data for the active variant. [1] [2] [3]

Implementation Details

  • Introduced a new computed property annotatedVariantDownloadOptions to generate the download menu options based on the active variant's data.
  • Added the fetchVariantAnnotations method, which retrieves the requested annotation from the API and triggers a JSON file download in the browser. Error handling is included to notify the user if the download fails.

UI and Code Quality Improvements

  • Refactored the header layout by grouping the title and download button in a flex row for improved alignment and spacing. [1] [2]
  • Cleaned up the code by removing unnecessary console logs and improving the logic for determining the allele title when multiple variants are present. [1] [2]

@bencap bencap linked an issue Nov 27, 2025 that may be closed by this pull request
@bencap bencap requested a review from sallybg November 27, 2025 04:14
Copy link
Contributor

@sallybg sallybg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! One thought is whether we want to provide a more detailed error message if the annotation can't be downloaded due to a missing mapped variant in the database. I think it can be confusing to get a "not found" error message and not know whether it's your browser, your login information, or if we're simply missing the info on our side. (Hopefully we won't be missing data on our side, but it could happen since we allow publication with mapping errors.) Or maybe we could consider not showing or greying out the button if there is no mapped variant available for the selected variant, but maybe that's more confusing.

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.

Export a mapped variant from the variant page

3 participants