Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
feat(myjobs): add a Match button to unscored jobs, show the company logo on job details
Khuram Niaz0fcfe23176eb
diff --git a/__tests__/JobCard.spec.tsx b/__tests__/JobCard.spec.tsxindex 750fb05..837fb27 100644--- a/__tests__/JobCard.spec.tsx+++ b/__tests__/JobCard.spec.tsx@@ -66,13 +66,16 @@ describe("JobCard", () => {expect(screen.getByText("Not applied")).toBeInTheDocument();});- it("renders the match score, or an empty ring when there is none", () => {+ it("renders the match score, or a Match button when there is none", () => {const { unmount } = renderCard(makeJob({ matchScore: 87 }));expect(screen.getByText("87%")).toBeInTheDocument();unmount();renderCard(makeJob({ matchScore: null }));- expect(screen.getByTitle("No match score")).toBeInTheDocument();+ expect(screen.getByRole("link", { name: /match/i })).toHaveAttribute(+ "href",+ "/dashboard/myjobs/job-1?tab=match&match=1",+ );});it("shows a Dismissed badge for dismissed discovered jobs", () => {diff --git a/__tests__/JobDetails.spec.tsx b/__tests__/JobDetails.spec.tsxindex 2ff13a6..67aa3a1 100644--- a/__tests__/JobDetails.spec.tsx+++ b/__tests__/JobDetails.spec.tsx@@ -412,3 +412,55 @@ describe("JobDetails cover letter action", () => {);});});++describe("JobDetails – auto-match from the jobs list", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ chat.approvalPending = false;+ chat.clear.mockResolvedValue(undefined);+ searchParams = new URLSearchParams();+ });++ it("runs the match and drops the flag when arriving with ?match=1", async () => {+ searchParams = new URLSearchParams("tab=match&match=1");+ render(<JobDetails {...baseProps} job={makeJob()} />);+ await act(async () => {});++ expect(chat.open).toHaveBeenCalled();+ const sent = chat.sendMessage.mock.calls[0][0];+ expect(sent.parts[0].text).toMatch(/match/i);+ expect(router.replace).toHaveBeenCalledWith("?tab=match", { scroll: false });+ });++ it("runs no match when the flag is absent", async () => {+ searchParams = new URLSearchParams("tab=match");+ render(<JobDetails {...baseProps} job={makeJob()} />);+ await act(async () => {});++ expect(chat.sendMessage).not.toHaveBeenCalled();+ });++ // The chat refreshes the route once the match is saved; a second run would+ // burn another LLM call and overwrite the result.+ it("runs the match only once across re-renders", async () => {+ searchParams = new URLSearchParams("tab=match&match=1");+ const { rerender } = render(<JobDetails {...baseProps} job={makeJob()} />);+ await act(async () => {});+ rerender(<JobDetails {...baseProps} job={makeJob({ matchScore: 80 })} />);+ await act(async () => {});++ expect(chat.sendMessage).toHaveBeenCalledTimes(1);+ });++ it("asks before clearing a conversation with a pending approval", async () => {+ chat.approvalPending = true;+ searchParams = new URLSearchParams("tab=match&match=1");+ render(<JobDetails {...baseProps} job={makeJob()} />);+ await act(async () => {});++ expect(+ screen.getByText(/clear the assistant conversation/i),+ ).toBeInTheDocument();+ expect(chat.sendMessage).not.toHaveBeenCalled();+ });+});diff --git a/__tests__/MyJobsTable.spec.tsx b/__tests__/MyJobsTable.spec.tsxindex 875ab30..1d0e2b0 100644--- a/__tests__/MyJobsTable.spec.tsx+++ b/__tests__/MyJobsTable.spec.tsx@@ -97,7 +97,7 @@ describe("MyJobsTable", () => {expect(screen.getByText("Applied")).toBeInTheDocument();});- it("renders a match score when present, and a dash otherwise", () => {+ it("renders a match score when present, and a Match button otherwise", () => {const { rerender } = renderTable([makeJob({ matchScore: 87 })]);expect(screen.getByText("87%")).toBeInTheDocument();@@ -111,7 +111,10 @@ describe("MyJobsTable", () => {onAddNote={vi.fn()}/>,);- expect(screen.getByText("-")).toBeInTheDocument();+ expect(screen.getByRole("link", { name: /match/i })).toHaveAttribute(+ "href",+ "/dashboard/myjobs/job-1?tab=match&match=1",+ );});it("shows a notes count badge only when the job has notes", () => {diff --git a/src/components/myjobs/CompanyLogo.tsx b/src/components/myjobs/CompanyLogo.tsxnew file mode 100644index 0000000..892a6c1--- /dev/null+++ b/src/components/myjobs/CompanyLogo.tsx@@ -0,0 +1,25 @@+"use client";+import { cn } from "@/lib/utils";++// Falls back to the app mark both when the company has no logo and when the+// stored URL 404s; onerror is cleared first so a broken fallback can't loop.+export function CompanyLogo({+ logoUrl,+ className,+}: {+ logoUrl?: string | null;+ className?: string;+}) {+ return (+ // eslint-disable-next-line @next/next/no-img-element+ <img+ alt="Company logo"+ className={cn("rounded-md object-cover", className)}+ src={logoUrl || "/images/jobsync-logo.svg"}+ onError={(e) => {+ e.currentTarget.onerror = null;+ e.currentTarget.src = "/images/jobsync-logo.svg";+ }}+ />+ );+}diff --git a/src/components/myjobs/JobCard.tsx b/src/components/myjobs/JobCard.tsxindex 6b29442..eb77b84 100644--- a/src/components/myjobs/JobCard.tsx+++ b/src/components/myjobs/JobCard.tsx@@ -7,6 +7,8 @@ import { CircularScore } from "@/components/CircularScore";import { JobResponse, JobStatus } from "@/models/job.model";import { JobStatusBadge } from "./JobStatusBadge";import { JobActionsMenu } from "./JobActionsMenu";+import { MatchJobButton } from "./MatchJobButton";+import { CompanyLogo } from "./CompanyLogo";type JobCardProps = {job: JobResponse;@@ -30,15 +32,9 @@ export function JobCard({return (<div className="flex flex-col gap-3 rounded-lg border bg-card p-4"><div className="flex items-start gap-3">- {/* eslint-disable-next-line @next/next/no-img-element */}- <img- alt="Company logo"- className="h-10 w-10 min-w-10 rounded-md object-cover"- src={job.Company?.logoUrl || "/images/jobsync-logo.svg"}- onError={(e) => {- e.currentTarget.onerror = null;- e.currentTarget.src = "/images/jobsync-logo.svg";- }}+ <CompanyLogo+ logoUrl={job.Company?.logoUrl}+ className="h-10 w-10 min-w-10"/><div className="min-w-0 flex-1"><div className="flex items-center gap-1.5">@@ -65,12 +61,7 @@ export function JobCard({{job.matchScore != null ? (<CircularScore score={job.matchScore} size="sm" animate={false} />) : (- <div- title="No match score"- className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full border-4 border-muted text-xs text-muted-foreground"- >- –- </div>+ <MatchJobButton jobId={job.id} />)}</div>diff --git a/src/components/myjobs/JobDetails.tsx b/src/components/myjobs/JobDetails.tsxindex 7924a63..f5e3d19 100644--- a/src/components/myjobs/JobDetails.tsx+++ b/src/components/myjobs/JobDetails.tsx@@ -38,6 +38,7 @@ import { JobDetailsHeader } from "./job-details/JobDetailsHeader";import { JobSummaryCard } from "./job-details/JobSummaryCard";import { JobTabEmptyState } from "./job-details/JobTabEmptyState";import { CoverLetterTab } from "./job-details/CoverLetterTab";+import { useAutoMatch } from "./job-details/useAutoMatch";const JOB_DETAIL_TABS = ["description", "match", "letter", "notes"] as const;@@ -123,6 +124,8 @@ function JobDetails({const onCoverLetter = () =>requestChat(`Write a cover letter for ${jobLabel}`);+ useAutoMatch(onMatch);+const coverLetterBlockedReason =job.descriptionCompleteness === "title-only"? "Add a job description first"diff --git a/src/components/myjobs/MatchJobButton.tsx b/src/components/myjobs/MatchJobButton.tsxnew file mode 100644index 0000000..fb2012c--- /dev/null+++ b/src/components/myjobs/MatchJobButton.tsx@@ -0,0 +1,17 @@+"use client";+import Link from "next/link";+import { Sparkles } from "lucide-react";+import { Button } from "../ui/button";++// Shown in place of the score when a job has none. The match flag is read by+// useAutoMatch on the details page, which fires the AI match on arrival.+export function MatchJobButton({ jobId }: { jobId: string }) {+ return (+ <Button asChild size="sm" variant="outline" className="shrink-0">+ <Link href={`/dashboard/myjobs/${jobId}?tab=match&match=1`}>+ <Sparkles className="h-3.5 w-3.5 mr-1" />+ Match+ </Link>+ </Button>+ );+}diff --git a/src/components/myjobs/MyJobsTable.tsx b/src/components/myjobs/MyJobsTable.tsxindex 0e67091..b7d9a2a 100644--- a/src/components/myjobs/MyJobsTable.tsx+++ b/src/components/myjobs/MyJobsTable.tsx@@ -18,6 +18,8 @@ import { CircularScore } from "@/components/CircularScore";import { JobStatusBadgeMenu } from "./JobStatusBadgeMenu";import { TooltipProvider } from "../ui/tooltip";import { JobActionsMenu } from "./JobActionsMenu";+import { MatchJobButton } from "./MatchJobButton";+import { CompanyLogo } from "./CompanyLogo";type MyJobsTableProps = {jobs: JobResponse[];@@ -57,7 +59,7 @@ function MyJobsTable({<TableHead>Company</TableHead><TableHead className="hidden md:table-cell">Location</TableHead><TableHead>Status</TableHead>- <TableHead className="hidden md:table-cell">Match</TableHead>+ <TableHead className="hidden md:table-cell text-center">Match</TableHead><TableHead className="hidden md:table-cell">Source</TableHead><TableHead><span className="sr-only">Actions</span>@@ -69,15 +71,9 @@ function MyJobsTable({return (<TableRow key={job.id}><TableCell className="hidden sm:table-cell">- {/* eslint-disable-next-line @next/next/no-img-element */}- <img- alt="Company logo"- className="rounded-md object-cover h-8 w-8 min-w-8"- src={job.Company?.logoUrl || "/images/jobsync-logo.svg"}- onError={(e) => {- e.currentTarget.onerror = null;- e.currentTarget.src = "/images/jobsync-logo.svg";- }}+ <CompanyLogo+ logoUrl={job.Company?.logoUrl}+ className="h-8 w-8 min-w-8"/></TableCell><TableCell className="hidden md:table-cell w-[120px] whitespace-nowrap">@@ -112,11 +108,16 @@ function MyJobsTable({className="w-[110px] whitespace-nowrap justify-center"/></TableCell>- <TableCell className="hidden md:table-cell">+ <TableCell className="hidden md:table-cell text-center">{job.matchScore != null ? (- <CircularScore score={job.matchScore} size="sm" animate={false} />+ <CircularScore+ score={job.matchScore}+ size="sm"+ animate={false}+ className="mx-auto"+ />) : (- <span className="text-muted-foreground">-</span>+ <MatchJobButton jobId={job.id} />)}</TableCell><TableCell className="hidden md:table-cell">diff --git a/src/components/myjobs/job-details/JobDetailsHeader.tsx b/src/components/myjobs/job-details/JobDetailsHeader.tsxindex 6164133..c1a2d67 100644--- a/src/components/myjobs/job-details/JobDetailsHeader.tsx+++ b/src/components/myjobs/job-details/JobDetailsHeader.tsx@@ -32,6 +32,7 @@ import {getJobTypeLabel,getWorkplaceTypeLabel,} from "@/models/job.model";+import { CompanyLogo } from "../CompanyLogo";type JobDetailsHeaderProps = {job: JobResponse;@@ -75,6 +76,10 @@ export function JobDetailsHeader({<Button title="Go Back" variant="ghost" size="icon" onClick={onBack}><ArrowLeft className="h-4 w-4" /></Button>+ <CompanyLogo+ logoUrl={job.Company?.logoUrl}+ className="h-10 w-10 min-w-10"+ /><div className="flex-1 min-w-0"><h1 className="text-2xl font-bold">{job.JobTitle?.label}</h1><p className="text-muted-foreground">{subtitle}</p>diff --git a/src/components/myjobs/job-details/useAutoMatch.ts b/src/components/myjobs/job-details/useAutoMatch.tsnew file mode 100644index 0000000..ffc21c8--- /dev/null+++ b/src/components/myjobs/job-details/useAutoMatch.ts@@ -0,0 +1,19 @@+import { useEffect, useRef } from "react";+import { useRouter, useSearchParams } from "next/navigation";++// Armed by the Match button on the jobs list. The flag is dropped on the first+// run so the router.refresh() the chat fires after saving the match — or any+// other re-render — cannot start a second one.+export function useAutoMatch(onMatch: () => void) {+ const router = useRouter();+ const searchParams = useSearchParams();+ const armed = searchParams.get("match") === "1";+ const firedRef = useRef(false);++ useEffect(() => {+ if (!armed || firedRef.current) return;+ firedRef.current = true;+ router.replace("?tab=match", { scroll: false });+ onMatch();+ }, [armed, onMatch, router]);+}diff --git a/wiki/jobs.md b/wiki/jobs.mdindex 8a72f65..0b9f796 100644--- a/wiki/jobs.md+++ b/wiki/jobs.md@@ -53,6 +53,12 @@ The Jobs card header has three tools. The **search box** matches on job text. ThThe list also has a view toggle for table or card layout, and a reload button that refetches without a full page refresh.+## How do I run an AI match from the jobs list?++A job that has no AI match score shows a **Match** button where its score would be — in the Match column in table view, and in the top-right corner of the card in card view. Clicking it opens that job's details page on the **AI Match** tab and starts the match straight away, so you do not have to open the job and click again. The match itself runs in the assistant panel exactly as it does from the job's own **Match with AI** button; when it finishes, the analysis is already on the tab in front of you.++Jobs that already have a score show the score instead. To re-run a match on one of those, open the job and use **Match with AI** in its header.+## How do I export my jobs to CSV?Click **Export** in the Jobs card header. Your jobs download as a CSV file named `jobsync-YYYY-MM-DD.csv`. The export covers your jobs, not the reference lists behind them — for a complete, restorable copy of everything including resumes, tasks and activities, use **Settings → Data** instead.