diff --git a/orchestrator/src/client/components/JobHeader.tsx b/orchestrator/src/client/components/JobHeader.tsx index 6437604..caf7f54 100644 --- a/orchestrator/src/client/components/JobHeader.tsx +++ b/orchestrator/src/client/components/JobHeader.tsx @@ -103,31 +103,15 @@ const SponsorBadge: React.FC = ({ score, names, onCheck }) => ); } - // If no score (and no callback), show nothing - if (score == null || score < 50) { + // If no score (and no callback), or error in score, show nothing + if (score == null) { return null; } - // Color tokens based on score - const getScoreTokens = (s: number) => { - if (s >= 90) return { - badge: "border-emerald-500/40 bg-emerald-500/15 text-emerald-300", - label: "Visa Sponsor" - }; - if (s >= 70) return { - badge: "border-amber-500/40 bg-amber-500/15 text-amber-300", - label: "Likely Sponsor" - }; - return { - badge: "border-orange-500/40 bg-orange-500/15 text-orange-300", - label: "Possible Sponsor" - }; - }; - - const tokens = getScoreTokens(score); - const tooltipContent = parsedNames.length > 0 - ? `${score}% match: ${parsedNames.join(", ")}` - : `${score}% match with visa sponsor list`; + const isFound = score >= 95; + const tooltipContent = isFound + ? `Confirmed Visa Sponsor (${score}% match: ${parsedNames.join(", ")})` + : `Sponsor Not Found (${score}% match${parsedNames.length > 0 ? `: ${parsedNames.join(", ")}` : ""})`; return ( @@ -135,16 +119,18 @@ const SponsorBadge: React.FC = ({ score, names, onCheck }) => - - {score}% + -

{tooltipContent}

+

{isFound ? "Found" : "Not Found"}

+

{tooltipContent}

diff --git a/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx b/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx index 1a779b9..1262fd4 100644 --- a/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx +++ b/orchestrator/src/client/pages/orchestrator/JobDetailPanel.test.tsx @@ -31,6 +31,9 @@ vi.mock("../../components", () => ({ DiscoveredPanel: ({ job }: { job: Job | null }) => (
{job?.id ?? "no-job"}
), + JobHeader: () =>
, + FitAssessment: () =>
, + TailoredSummary: () =>
, })); vi.mock("../../components/ReadyPanel", () => ({ diff --git a/orchestrator/src/server/api/routes/jobs.ts b/orchestrator/src/server/api/routes/jobs.ts index 962c9c2..f33e5e5 100644 --- a/orchestrator/src/server/api/routes/jobs.ts +++ b/orchestrator/src/server/api/routes/jobs.ts @@ -160,7 +160,7 @@ jobsRouter.post('/:id/check-sponsor', async (req: Request, res: Response) => { minScore: 50, }); - let sponsorMatchScore: number | null = null; + let sponsorMatchScore = 0; let sponsorMatchNames: string | null = null; if (sponsorResults.length > 0) { @@ -177,7 +177,7 @@ jobsRouter.post('/:id/check-sponsor', async (req: Request, res: Response) => { // Update job with sponsor match info const updatedJob = await jobsRepo.updateJob(job.id, { - sponsorMatchScore: sponsorMatchScore ?? undefined, + sponsorMatchScore: sponsorMatchScore, sponsorMatchNames: sponsorMatchNames ?? undefined, }); diff --git a/orchestrator/src/server/pipeline/orchestrator.ts b/orchestrator/src/server/pipeline/orchestrator.ts index 5b031df..08166e9 100644 --- a/orchestrator/src/server/pipeline/orchestrator.ts +++ b/orchestrator/src/server/pipeline/orchestrator.ts @@ -295,7 +295,7 @@ export async function runPipeline(config: Partial = {}): Promise }); // Calculate sponsor match score using fuzzy search - let sponsorMatchScore: number | undefined; + let sponsorMatchScore = 0; let sponsorMatchNames: string | undefined; if (job.employer) {