fix(web): stop presenting an unscored case as a failed analysis, and four smaller things
From clicking through the redesigned UI: - scoring a case without a model registry painted a red failure across a case that had in fact analysed fine. It is now a quiet note saying the model term contributes 0, because scoring is an optional fourth of the rank, not the analysis. - the MLflow default moves to port 5001. On macOS, AirPlay Receiver owns 5000, which is why the registry answered "403" rather than refusing the connection; docker-compose publishes 5001 to match. - a funnel step that kept nothing drew a visible bar. Zero now draws zero. - "1 candidates". - the funnel's fixed grid columns forced a horizontal scrollbar on the report. The report also lists the top undecided candidates now: the first thing anyone opens has no decisions in it, and "Shortlisted (0)" alone said nothing about what the tool found. Tests: api 77, web 32; ruff, mypy, svelte-check clean.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { api, type Candidate, type CandidatePage, type Case, type Job, type VariantDetail } from '$lib/api';
|
||||
import { poll } from '$lib/poll';
|
||||
import { formatElapsed, latestStep } from '$lib/progress';
|
||||
import { plural } from '$lib/candidates';
|
||||
import CandidateRow from '$lib/components/CandidateRow.svelte';
|
||||
import Funnel from '$lib/components/Funnel.svelte';
|
||||
import VariantPanel from '$lib/components/VariantPanel.svelte';
|
||||
@@ -22,6 +23,7 @@
|
||||
let busy = $state(false);
|
||||
let scoring = $state(false);
|
||||
let error = $state<string | null>(null);
|
||||
let scoreNote = $state<string | null>(null);
|
||||
let now = $state(Date.now());
|
||||
let stopPolling: (() => void) | null = null;
|
||||
|
||||
@@ -82,8 +84,10 @@
|
||||
scoring = true;
|
||||
try {
|
||||
await api.score(data.caseId);
|
||||
scoreNote = null;
|
||||
} catch (e) {
|
||||
error = `Scoring failed: ${(e as Error).message}`;
|
||||
// Scoring is optional: without a model the rank simply loses one of its four terms.
|
||||
scoreNote = (e as Error).message;
|
||||
} finally {
|
||||
scoring = false;
|
||||
}
|
||||
@@ -138,6 +142,9 @@
|
||||
</div>
|
||||
|
||||
{#if error}<p role="alert">{error}</p>{/if}
|
||||
{#if scoreNote}
|
||||
<p class="note">Variants are unscored, so the model term contributes 0 to every rank. {scoreNote}</p>
|
||||
{/if}
|
||||
|
||||
{#if running}
|
||||
<p class="progress" aria-live="polite">
|
||||
@@ -177,7 +184,7 @@
|
||||
|
||||
<div class="triage">
|
||||
<div class="candidates">
|
||||
<p class="muted">{page.total} candidates ranked by phenotype fit, rarity, consequence and model score</p>
|
||||
<p class="muted">{plural(page.total, 'candidate')} ranked by phenotype fit, rarity, consequence and model score</p>
|
||||
{#each page.items as candidate, i (candidate.variant.id)}
|
||||
<CandidateRow
|
||||
{candidate}
|
||||
|
||||
@@ -57,6 +57,16 @@
|
||||
<p class="muted">Nothing shortlisted yet.</p>
|
||||
{/each}
|
||||
|
||||
{#if report.top.length}
|
||||
<h2>Top candidates, not yet decided ({report.top.length})</h2>
|
||||
{#each report.top as item (item.variant.id)}
|
||||
<div class="reportitem">
|
||||
<h3>{item.variant.gene ?? 'intergenic'} <span class="coord">{item.variant.chrom}:{item.variant.pos} {item.variant.ref}>{item.variant.alt}</span></h3>
|
||||
<Chips chips={evidenceChips(item, termCount)} />
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
{#if report.dismissed.length}
|
||||
<h2>Dismissed ({report.dismissed.length})</h2>
|
||||
<ul class="dismissed">
|
||||
|
||||
Reference in New Issue
Block a user