Skip to content

Pulling fix/empty-gene-link into develop#1002

Open
github-actions[bot] wants to merge 2 commits into
developfrom
fix/empty-gene-link
Open

Pulling fix/empty-gene-link into develop#1002
github-actions[bot] wants to merge 2 commits into
developfrom
fix/empty-gene-link

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

No description provided.

The GenesDisplay component is simplified by removing the conditional
rendering of an empty fragment when the genes array is empty. The
component now always renders a fragment containing the mapped LinkTag
components. This change reduces the complexity of the component and
improves readability.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 10, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

…e a name

The StrainDetailsCard component now checks if the genes exist and have a name before displaying them. This prevents the component from rendering empty or undefined gene names, improving the user experience.
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Mar 11, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.16%. Comparing base (bd3e6c0) to head (56f1d66).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1002   +/-   ##
========================================
  Coverage    90.16%   90.16%           
========================================
  Files          316      316           
  Lines        18893    18894    +1     
  Branches       800      799    -1     
========================================
+ Hits         17035    17036    +1     
  Misses        1855     1855           
  Partials         3        3           
Files with missing lines Coverage Δ
packages/ui-dsc/src/catalog/GenesDisplay.tsx 100.00% <100.00%> (ø)
packages/ui-dsc/src/catalog/StrainDetailsCard.tsx 97.54% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent rendering “empty” gene links in the strain details UI by filtering out genes with empty name values before displaying them.

Changes:

  • Filter genes in StrainDetailsCard to exclude entries with empty name, and render GenesDisplay only for non-empty results.
  • Simplify GenesDisplay to always render the mapped LinkTag list (removing the explicit empty-array early return).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/ui-dsc/src/catalog/StrainDetailsCard.tsx Filters out empty gene names and avoids rendering GenesDisplay for an empty post-filter list.
packages/ui-dsc/src/catalog/GenesDisplay.tsx Simplifies rendering to a direct map over genes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 121 to +131
content: pipe(
genes,
OfromNullable,
Omap((g) => <GenesDisplay genes={g} />),
OgetOrElse(() => <></>),
OgetOrElse(
() => [] as NonNullable<NonNullable<StrainQuery["strain"]>["genes"]>,
),
Afilter(({ name }) => !isEmpty(name)),
Amatch(
() => <></>,
(g) => <GenesDisplay genes={g} />,
),
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The new behavior that filters out genes with empty name values changes what is rendered for the "Associated Gene(s)" row. There is existing test coverage for StrainDetailsCard, but it doesn't appear to cover this rendering logic; adding a test case where data.genes contains an empty-name gene would help prevent regressions (and ensures the empty link bug stays fixed).

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +16
{genes.map((gene) => (
<LinkTag key={gene.name} item={gene.name} route="gene" />
))}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

GenesDisplay will render a LinkTag even when gene.name is an empty string, which produces an empty/invalid link (e.g. href="/gene/" and title="View gene "). Since GenesDisplay is used in multiple places (not all of which filter names), consider filtering out genes with empty names inside GenesDisplay (or inside LinkTag) so this is handled consistently across the app.

Suggested change
{genes.map((gene) => (
<LinkTag key={gene.name} item={gene.name} route="gene" />
))}
{genes
.filter((gene) => gene.name && gene.name.trim() !== "")
.map((gene) => (
<LinkTag key={gene.name} item={gene.name} route="gene" />
))}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants