diff --git a/README.md b/README.md index 7f7a91b..86740c8 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ and apply with a résumé tailored to every job. ![Postgres](https://img.shields.io/badge/Postgres_·_Prisma-336791?style=for-the-badge&logo=postgresql&logoColor=white) ![Status](https://img.shields.io/badge/Status-Pre--launch-FFB020?style=for-the-badge) -[Features](#-features) · [Architecture](#-architecture) · [Tech stack](#-tech-stack) · [Run locally](#-run-locally) · [Roadmap](#-roadmap) · [Decision records](#-decision-records) +[Features](#-features) · [Gallery](#-gallery) · [Architecture](#-architecture) · [Tech stack](#-tech-stack) · [Run locally](#-run-locally) · [Roadmap](#-roadmap) · [Decision records](#-decision-records)
-SkillGraph landing page +SkillGraph landing page @@ -44,7 +44,8 @@ and apply with a résumé tailored to every job. - **A full résumé tailored to each job,** rebuilt from your uploaded résumé. It never invents employers, projects, numbers or skills. - **Auto-submit (opt-in)** through the employer's own Greenhouse or Lever API, for employers who connect their hiring system to SkillGraph. If a form asks something only you can answer, it waits for you. - **Browser extension** for LinkedIn, Naukri, Glassdoor and Superset ([`extension/`](extension/README.md)). It checks the job against your filters, tailors the résumé and fills the application form in your own browser. You press Submit. -- **10-dimension fit evaluation** for any job link or pasted description, plus a STAR story bank and salary-negotiation scripts that use placeholders instead of invented facts. +- **10-dimension fit evaluation** for any job link or pasted description, with one click to tailor your résumé to it, plus a STAR story bank and salary-negotiation scripts that use placeholders instead of invented facts. +- **A clear pipeline:** every application shows whether it was submitted for you, via the extension or by you, and why one wasn't auto-submitted (e.g. "the form asks your expected CTC"). - **Never** logs in to job sites from our servers and never stores your passwords, cookies or session tokens for them. ### 📝 Résumé builder @@ -284,13 +285,64 @@ CI runs the typecheck, lint, unit tests and Postgres integration tests on every ## 🖼 Gallery -

- Student dashboard - OpenClaw agent -

-

- 7-day sprint -

+Screenshots use fictional demo data. + +### Student + + + + + + + + + + + + + + +
Student dashboard
Dashboard — skills, open gaps, this week's sprint, and a Today row with attendance, next class, next round and unread notices
Market intelligence
Market intelligence — skill demand from this week's postings and the real change from last week
7-day sprint
7-day sprint — a resource, task and checkpoint for each day, with progress saved per day
Résumé builder
Résumé builder — drafts tailored to a job description, AI Enhance per section, ATS score and PDF export
Benchmark
Benchmark — your readiness against students targeting the same role
Academics
Academics — attendance per course, with how many classes to attend or how many you can still miss
+ +### OpenClaw + + + + + +
OpenClaw agent
OpenClaw — filters, opt-in auto-submit and the pipeline: graded matches, tailored résumés, and how each application was submitted (for you, via the extension, or by you)
+ +### Placement workflow + + + + + + + + + + + + + + + + + +
Campus job board
Campus job board — eligibility, CTC and stipend, apply-by countdowns, and "Mark applied" for other portals
Job details
Job details — the hiring process, with where you stand in each round
Job tracker
Job tracker — every application, round by round
Participation
Participation — confirm or decline rounds, and check in with the venue code
Placement calendar
Calendar — rounds by week, month or agenda
Notice board
Notices — placement-cell announcements with read state
Drive chats
Drive chats — one group chat per drive for applicants and the placement cell
+ +### Placement cell + + + + + + + + + +
Placement cell dashboard
Placement cell dashboard — students, readiness, active jobs and placements
Job postings
Job postings — drives, CSV import from other placement portals, and applications
Cohort analytics
Cohort analytics — the college's readiness and skill gaps
--- diff --git a/docs/screenshots/academics.webp b/docs/screenshots/academics.webp new file mode 100644 index 0000000..8ed69e3 Binary files /dev/null and b/docs/screenshots/academics.webp differ diff --git a/docs/screenshots/benchmark.webp b/docs/screenshots/benchmark.webp new file mode 100644 index 0000000..b3ccc34 Binary files /dev/null and b/docs/screenshots/benchmark.webp differ diff --git a/docs/screenshots/calendar.webp b/docs/screenshots/calendar.webp new file mode 100644 index 0000000..e087b5e Binary files /dev/null and b/docs/screenshots/calendar.webp differ diff --git a/docs/screenshots/chat.webp b/docs/screenshots/chat.webp new file mode 100644 index 0000000..53f0ecb Binary files /dev/null and b/docs/screenshots/chat.webp differ diff --git a/docs/screenshots/dashboard.webp b/docs/screenshots/dashboard.webp new file mode 100644 index 0000000..0a04426 Binary files /dev/null and b/docs/screenshots/dashboard.webp differ diff --git a/docs/screenshots/faculty-analytics.webp b/docs/screenshots/faculty-analytics.webp new file mode 100644 index 0000000..ce3605f Binary files /dev/null and b/docs/screenshots/faculty-analytics.webp differ diff --git a/docs/screenshots/faculty-dashboard.webp b/docs/screenshots/faculty-dashboard.webp new file mode 100644 index 0000000..931efd8 Binary files /dev/null and b/docs/screenshots/faculty-dashboard.webp differ diff --git a/docs/screenshots/faculty-jobs.webp b/docs/screenshots/faculty-jobs.webp new file mode 100644 index 0000000..5f44f67 Binary files /dev/null and b/docs/screenshots/faculty-jobs.webp differ diff --git a/docs/screenshots/jobdetail.webp b/docs/screenshots/jobdetail.webp new file mode 100644 index 0000000..3579d32 Binary files /dev/null and b/docs/screenshots/jobdetail.webp differ diff --git a/docs/screenshots/jobs.webp b/docs/screenshots/jobs.webp new file mode 100644 index 0000000..d950baa Binary files /dev/null and b/docs/screenshots/jobs.webp differ diff --git a/docs/screenshots/landing.webp b/docs/screenshots/landing.webp new file mode 100644 index 0000000..ac051ab Binary files /dev/null and b/docs/screenshots/landing.webp differ diff --git a/docs/screenshots/notices.webp b/docs/screenshots/notices.webp new file mode 100644 index 0000000..37002bd Binary files /dev/null and b/docs/screenshots/notices.webp differ diff --git a/docs/screenshots/openclaw.webp b/docs/screenshots/openclaw.webp new file mode 100644 index 0000000..716774c Binary files /dev/null and b/docs/screenshots/openclaw.webp differ diff --git a/docs/screenshots/participation.webp b/docs/screenshots/participation.webp new file mode 100644 index 0000000..bbafd84 Binary files /dev/null and b/docs/screenshots/participation.webp differ diff --git a/docs/screenshots/resume.webp b/docs/screenshots/resume.webp new file mode 100644 index 0000000..a87ba1a Binary files /dev/null and b/docs/screenshots/resume.webp differ diff --git a/docs/screenshots/skillgap.webp b/docs/screenshots/skillgap.webp new file mode 100644 index 0000000..b27f677 Binary files /dev/null and b/docs/screenshots/skillgap.webp differ diff --git a/docs/screenshots/sprint.webp b/docs/screenshots/sprint.webp new file mode 100644 index 0000000..4d27dc0 Binary files /dev/null and b/docs/screenshots/sprint.webp differ diff --git a/docs/screenshots/tracker.webp b/docs/screenshots/tracker.webp new file mode 100644 index 0000000..15df8cc Binary files /dev/null and b/docs/screenshots/tracker.webp differ diff --git a/skillgraph-web/app/(app)/market/page.tsx b/skillgraph-web/app/(app)/market/page.tsx index 54ed7a2..8651138 100644 --- a/skillgraph-web/app/(app)/market/page.tsx +++ b/skillgraph-web/app/(app)/market/page.tsx @@ -6,7 +6,7 @@ import DashboardLayout from "@/components/DashboardLayout"; import PageTransition from "@/components/PageTransition"; import { Button } from "@/components/ui/button"; -interface SkillItem { skill: string; count: number } +interface SkillItem { skill: string; count: number; change: number | null } interface MarketData { topSkills: SkillItem[]; role: string; totalJobsAnalyzed: number; week: number; lastUpdated: string } const roles = ['All Roles', 'Industrial AI Engineer', 'Data Analyst', 'ML Engineer', 'DevOps Engineer', 'Full Stack Dev']; @@ -89,7 +89,7 @@ export default function MarketPage() { return ( -

Real-time skill demand index and job market insights.

+

Skill demand from this week's job postings, live job search and salary estimates.

{lookupError && activeTab !== 'Skill Demand' && (

{lookupError}

@@ -124,19 +124,19 @@ export default function MarketPage() {
- RankTickerDemandΔ ChangeTrend + RankTickerDemandΔ vs last weekTrend
{loading ? ( -
Loading job details…
+
Loading skill demand…
) : data?.topSkills?.length === 0 ? (
No demand data for this role yet.
) : ( data?.topSkills?.map(({ skill, count }, i) => { const demandPct = Math.min(100, Math.round((count / maxCount) * 100)); - // Mock change and trend for UI continuity since real API doesn't have it - const mockChange = i % 3 === 0 ? -2 : i % 2 === 0 ? 0 : 5 + i; - const mockTrend = mockChange > 0 ? "up" : mockChange < 0 ? "down" : "flat"; + // Percentage-point change in the share of postings; null until there are two weeks of data + const change = typeof data.topSkills[i].change === "number" ? data.topSkills[i].change : null; + const trend = change === null || change === 0 ? "flat" : change > 0 ? "up" : "down"; return (
@@ -149,11 +149,11 @@ export default function MarketPage() { {count}
0 ? "text-success" : mockChange < 0 ? "text-destructive" : "text-muted-foreground" + change !== null && change > 0 ? "text-success" : change !== null && change < 0 ? "text-destructive" : "text-muted-foreground" }`}> - {mockChange > 0 ? "+" : ""}{mockChange}% + {change === null ? "—" : `${change > 0 ? "+" : ""}${change} pts`} - +
); }) diff --git a/skillgraph-web/app/(app)/openclaw/page.tsx b/skillgraph-web/app/(app)/openclaw/page.tsx index 8b56dfe..6369e91 100644 --- a/skillgraph-web/app/(app)/openclaw/page.tsx +++ b/skillgraph-web/app/(app)/openclaw/page.tsx @@ -34,6 +34,7 @@ const csv = (s: string) => s.split(",").map(x => x.trim()).filter(Boolean); interface AppStats { total: number; preparedToday: number; + handledToday?: number; readyToApply: number; avgMatchScore: number; } @@ -87,7 +88,7 @@ export default function OpenClawPage() { useEffect(() => { loadData(); // Poll for updates every 15 seconds to reflect background agent applications - const interval = setInterval(loadData, 15000); + const interval = setInterval(() => { if (!document.hidden) loadData(); }, 15000); return () => clearInterval(interval); }, [loadData]); @@ -178,7 +179,7 @@ export default function OpenClawPage() {
= {} + for (const job of prevJobs) { + for (const skill of (job.requiredSkills as string[]) || []) prevFreq[skill] = (prevFreq[skill] || 0) + 1 + } + const share = (count: number, total: number) => (total > 0 ? (count / total) * 100 : 0) + const topSkills = Object.entries(skillFreq) .sort(([, a], [, b]) => b - a) .slice(0, 20) - .map(([skill, count]) => ({ skill, count })) + .map(([skill, count]) => ({ + skill, + count, + // Percentage points; null when there is no earlier week to compare with + change: prevJobs.length > 0 ? Math.round(share(count, jobs.length) - share(prevFreq[skill] ?? 0, prevJobs.length)) : null, + })) const lastScraped = await prisma.jobPosting.findFirst({ orderBy: { scrapedAt: 'desc' }, diff --git a/skillgraph-web/app/api/openclaw/applications/[id]/route.ts b/skillgraph-web/app/api/openclaw/applications/[id]/route.ts index 1c4fc13..62c8b21 100644 --- a/skillgraph-web/app/api/openclaw/applications/[id]/route.ts +++ b/skillgraph-web/app/api/openclaw/applications/[id]/route.ts @@ -21,7 +21,7 @@ export async function PATCH( if (!parsed.success) return badRequest(`status must be one of: ${USER_SETTABLE_STATUSES.join(', ')}`) const { id } = await params - const existing = await prisma.openClawApplication.findUnique({ where: { id }, select: { userId: true } }) + const existing = await prisma.openClawApplication.findUnique({ where: { id }, select: { userId: true, status: true, submittedVia: true } }) if (!existing || existing.userId !== userId) { return NextResponse.json({ error: 'Application not found' }, { status: 404 }) } @@ -30,8 +30,10 @@ export async function PATCH( where: { id }, data: { status: parsed.data.status, - // appliedAt marks when the student actually applied - ...(parsed.data.status === 'Applied' ? { appliedAt: new Date() } : {}), + // appliedAt marks when the student actually applied; the student submitted it themselves + ...(parsed.data.status === 'Applied' && existing.status !== 'Applied' + ? { appliedAt: new Date(), submittedVia: existing.submittedVia ?? 'manual' } + : {}), }, }) return ok({ application: updated }) diff --git a/skillgraph-web/app/api/openclaw/applications/[id]/tailor/route.ts b/skillgraph-web/app/api/openclaw/applications/[id]/tailor/route.ts new file mode 100644 index 0000000..e9d866f --- /dev/null +++ b/skillgraph-web/app/api/openclaw/applications/[id]/tailor/route.ts @@ -0,0 +1,41 @@ +export const dynamic = 'force-dynamic' +export const maxDuration = 60 +import { NextRequest, NextResponse } from 'next/server' +import { auth } from '@/auth' +import { prisma } from '@/lib/prisma' +import { ok, unauthorized, badRequest, serverError, aiFailure } from '@/lib/api' +import { createTailoredResume, NoResumeSource } from '@/lib/resume/tailor' + +// POST /api/openclaw/applications/:id/tailor — build a résumé tailored to this job (for jobs the +// student evaluated themselves; the agent and the extension tailor automatically) +export async function POST(_req: NextRequest, { params }: { params: Promise<{ id: string }> }) { + try { + const session = await auth() + if (!session?.user?.id) return unauthorized() + const { id } = await params + const app = await prisma.openClawApplication.findFirst({ + where: { id, userId: session.user.id }, + include: { listing: true }, + }) + if (!app) return NextResponse.json({ error: 'Application not found' }, { status: 404 }) + + const { listing } = app + const resume = await createTailoredResume( + session.user.id, + { company: listing.company, role: listing.role, jdText: listing.jdText, sourceUrl: listing.sourceUrl }, + app.matchScore ?? undefined, + ) + const updated = await prisma.openClawApplication.update({ + where: { id }, + data: { resumeVersionId: resume.resumeVersionId, ...(app.status === 'Pending' ? { status: 'ReadyToApply' } : {}) }, + select: { id: true, status: true, resumeVersionId: true }, + }) + return ok({ application: updated }) + } catch (err) { + if (err instanceof NoResumeSource) return badRequest('Upload your résumé first, so the tailored version uses your real experience.') + const failure = aiFailure(err) + if (failure) return failure + console.error('[openclaw/applications/:id/tailor]', err) + return serverError() + } +} diff --git a/skillgraph-web/app/api/openclaw/applications/route.ts b/skillgraph-web/app/api/openclaw/applications/route.ts index da09bbd..c800130 100644 --- a/skillgraph-web/app/api/openclaw/applications/route.ts +++ b/skillgraph-web/app/api/openclaw/applications/route.ts @@ -1,55 +1,43 @@ -import { NextResponse } from 'next/server' import { auth } from '@/auth' import { prisma } from '@/lib/prisma' +import { ok, unauthorized, serverError } from '@/lib/api' -// GET — list user's OpenClaw auto-applications with listing details +// GET /api/openclaw/applications — the student's OpenClaw pipeline with listings, evaluations and stats export async function GET() { - const session = await auth() - if (!session?.user) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) + try { + const session = await auth() + if (!session?.user?.id) return unauthorized() - const applications = await prisma.openClawApplication.findMany({ - where: { userId: session.user.id }, - orderBy: { appliedAt: 'desc' }, - take: 50, - }) + const rows = await prisma.openClawApplication.findMany({ + where: { userId: session.user.id }, + orderBy: { appliedAt: 'desc' }, + take: 50, + include: { listing: true }, + }) + const evals = await prisma.evaluationResult.findMany({ where: { applicationId: { in: rows.map(a => a.id) } } }) + const evalMap = new Map(evals.map(e => [e.applicationId, e])) + const applications = rows.map(({ listing, ...app }) => ({ ...app, Listing: listing, EvaluationResult: evalMap.get(app.id) ?? null })) - // Fetch listing details for each application - const listingIds = applications.map(a => a.listingId) - const listings = await prisma.openClawListing.findMany({ - where: { id: { in: listingIds } }, - }) - const listingMap = new Map(listings.map(l => [l.id, l])) + // Matches the agent's daily limit (lib/openclaw/agent.ts): prepared, or submitted for the student, today + const todayStart = new Date() + todayStart.setHours(0, 0, 0, 0) + const today = rows.filter(a => a.appliedAt >= todayStart) + const preparedToday = today.filter(a => a.status === 'ReadyToApply').length + const submittedToday = today.filter(a => a.status === 'Applied' && a.submittedVia === 'ats_api').length - // Fetch EvaluationResults for each application - const appIds = applications.map(a => a.id) - const evals = await prisma.evaluationResult.findMany({ - where: { applicationId: { in: appIds } }, - }) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const evalMap = new Map(evals.map((e: any) => [e.applicationId, e])) - - const enriched = applications.map(app => ({ - ...app, - Listing: listingMap.get(app.listingId) ?? null, - EvaluationResult: evalMap.get(app.id) ?? null, - })) - - // Summary stats - const todayStart = new Date() - todayStart.setHours(0, 0, 0, 0) - // The agent's daily limit counts applications it prepared today - const preparedToday = applications.filter(a => a.status === 'ReadyToApply' && new Date(a.appliedAt) >= todayStart).length - const readyToApply = applications.filter(a => a.status === 'ReadyToApply').length - - return NextResponse.json({ - applications: enriched, - stats: { - total: applications.length, - preparedToday, - readyToApply, - avgMatchScore: applications.length > 0 - ? Math.round(applications.reduce((s, a) => s + (a.matchScore ?? 0), 0) / applications.length) - : 0, - }, - }) + return ok({ + applications, + stats: { + total: rows.length, + preparedToday, + submittedToday, + handledToday: preparedToday + submittedToday, + readyToApply: rows.filter(a => a.status === 'ReadyToApply').length, + avgMatchScore: rows.length > 0 ? Math.round(rows.reduce((s, a) => s + (a.matchScore ?? 0), 0) / rows.length) : 0, + }, + }) + } catch (err) { + console.error('[openclaw/applications GET]', err) + return serverError() + } } diff --git a/skillgraph-web/components/openclaw/AgentStatusCard.tsx b/skillgraph-web/components/openclaw/AgentStatusCard.tsx index f39153d..cdd9331 100644 --- a/skillgraph-web/components/openclaw/AgentStatusCard.tsx +++ b/skillgraph-web/components/openclaw/AgentStatusCard.tsx @@ -73,7 +73,7 @@ export default function AgentStatusCard({
{readyToApply}
Ready to apply
-
{preparedToday} / {dailyLimit} prepared today
+
{preparedToday} / {dailyLimit} prepared or submitted today
= { - Applied: { icon: , color: "text-green-500" }, +const STATUS_STYLE: Record = { Pending: { icon: , color: "text-yellow-500" }, ReadyToApply: { icon: , color: "text-primary" }, - Failed: { icon: , color: "text-destructive" }, - Matched: { icon: , color: "text-primary" }, + Applied: { icon: , color: "text-green-500" }, + Shortlisted: { icon: , color: "text-green-400" }, + Interviewing: { icon: , color: "text-green-400" }, + Offer: { icon: , color: "text-green-300" }, + Rejected: { icon: , color: "text-destructive" }, + Failed: { icon: , color: "text-muted-foreground" }, + UnableToApply: { icon: , color: "text-muted-foreground" }, +}; +const DEFAULT_STYLE = { icon: , color: "text-muted-foreground" }; + +const GRADE_COLORS: Record = { + A: "bg-green-500/20 text-green-500", + B: "bg-cyan-500/20 text-cyan-500", + C: "bg-yellow-500/20 text-yellow-500", + D: "bg-orange-500/20 text-orange-500", + F: "bg-red-500/20 text-red-500", }; export default function ApplicationFeed({ applications }: ApplicationFeedProps) { @@ -40,7 +56,8 @@ export default function ApplicationFeed({ applications }: ApplicationFeedProps)

- No applications yet. Save your preferences and activate OpenClaw — it will prepare tailored résumés for strong matches for you to review and submit. + No applications yet. Save your filters and switch OpenClaw on: it tailors a résumé for each strong match, and submits + for you where the employer allows it and you turned on auto-submit.

); @@ -49,102 +66,90 @@ export default function ApplicationFeed({ applications }: ApplicationFeedProps) return (
-

Recent Activity

+

Recent activity

{applications.map((app) => { - const { icon, color } = statusConfig[app.status] ?? statusConfig.Applied; - const listing = (app as any).Listing ?? (app as any).listing; + const { icon, color } = STATUS_STYLE[app.status] ?? DEFAULT_STYLE; + const listing = app.Listing ?? app.listing ?? null; + const { evaluation, advice, notSubmittedReason } = parseTailoringNotes(app.tailoringNotes); + const via = app.status === "Applied" ? submittedViaLabel(app.submittedVia) : null; return (
-
+

{listing?.sourceUrl ? ( - {listing?.role ?? "Unknown Role"} + {listing.role} ) : ( - listing?.role ?? "Unknown Role" + listing?.role ?? "Unknown role" )}

- {icon} {app.status} + {icon} {statusLabel(app.status)} + {via && ( + + {via} + + )}

- {listing?.company ?? "—"} · {listing?.location ?? "Remote"} · {listing?.ctcBand ?? "CTC undisclosed"} · {listing?.platform ?? ""} + {[listing?.company, listing?.location, listing?.ctcBand ?? "CTC not disclosed", listing?.platform].filter(Boolean).join(" · ")}

{listing?.jdText && ( -

"{listing.jdText}"

+

{listing.jdText}

)} - {(() => { - if (!app.tailoringNotes) return null; - let parsed: any = null; - try { parsed = JSON.parse(app.tailoringNotes); } catch { return null; } - - if (!parsed?.grade) return ( -
Auto-tailored: {app.tailoringNotes}
- ); - - const GRADE_COLORS: Record = { - A: 'bg-green-500/20 text-green-500', - B: 'bg-cyan-500/20 text-cyan-500', - C: 'bg-yellow-500/20 text-yellow-500', - D: 'bg-orange-500/20 text-orange-500', - F: 'bg-red-500/20 text-red-500', - } - return ( -
-
- - Grade {parsed.grade} - - - {parsed.recommendation} - -
- {parsed.keyStrengths?.[0] && ( -

✓ {parsed.keyStrengths[0]}

- )} - {parsed.keyWeaknesses?.[0] && ( -

✗ {parsed.keyWeaknesses[0]}

+ {evaluation?.grade && ( +
+
+ + Grade {evaluation.grade} + + {evaluation.recommendation && ( + {recommendationLabel(evaluation.recommendation)} )}
- ); - })()} + {evaluation.keyStrengths?.[0] &&

✓ {evaluation.keyStrengths[0]}

} + {evaluation.keyWeaknesses?.[0] &&

✗ {evaluation.keyWeaknesses[0]}

} +
+ )} + {advice && ( +

+ What to emphasise: {advice} +

+ )} + {notSubmittedReason && ( +

+ Not submitted for you: {notSubmittedReason} +

+ )}
{app.matchScore != null && ( = 80 ? "text-green-500" : app.matchScore >= 50 ? "text-primary" : "text-muted-foreground"}`}> - {app.matchScore}% + {Math.round(app.matchScore)}% )}

- {new Date(app.appliedAt).toLocaleDateString("en-IN", { day: "numeric", month: "short" })} + {new Date(app.appliedAt).toLocaleDateString("en-IN", { day: "numeric", month: "short", timeZone: "Asia/Kolkata" })}

- {listing?.sourceUrl && ( - - View - - )} - {app.resumeVersionId && app.status !== "Pending" && ( - - 📄 Download CV - - )} +
+ {listing?.sourceUrl && ( + + View + + )} + {app.resumeVersionId && ( + + Tailored résumé + + )} +
diff --git a/skillgraph-web/components/openclaw/PipelineDashboard.tsx b/skillgraph-web/components/openclaw/PipelineDashboard.tsx index 2781a1b..139d294 100644 --- a/skillgraph-web/components/openclaw/PipelineDashboard.tsx +++ b/skillgraph-web/components/openclaw/PipelineDashboard.tsx @@ -4,6 +4,7 @@ import { useEffect, useState, useCallback } from 'react' import { Terminal, Plus, ChevronRight, BarChart2 } from 'lucide-react' import { Button } from '@/components/ui/button' import NegotiationModal from './NegotiationModal' +import { statusLabel, recommendationLabel, submittedViaLabel, parseTailoringNotes } from './labels' interface Application { id: string @@ -29,6 +30,7 @@ interface Application { } tailoringNotes?: string | null resumeVersionId?: string | null + submittedVia?: string | null } const GRADE_COLORS: Record = { @@ -55,13 +57,6 @@ const STATUS_COLORS: Record = { Duplicate: 'text-zinc-500', } -const STATUS_LABELS: Record = { - Pending: 'Evaluated', - ReadyToApply: 'Ready to apply', - UnableToApply: 'Not submitted', - Failed: 'Not submitted', -} - // Statuses where the student still has to apply on the employer's site const AWAITING_STUDENT = ['Pending', 'ReadyToApply'] @@ -75,12 +70,21 @@ export default function PipelineDashboard() { const [selected, setSelected] = useState(null) const [negListing, setNegListing] = useState<{ id: string; company: string; role: string } | null>(null) const [submitMsg, setSubmitMsg] = useState('') + const [tailoring, setTailoring] = useState(null) + const [loadError, setLoadError] = useState('') const loadApps = useCallback(async () => { - const res = await fetch('/api/openclaw/applications') - const data = await res.json() - setApplications(data.applications ?? []) - setLoading(false) + try { + const res = await fetch('/api/openclaw/applications') + const data = await res.json().catch(() => ({})) + if (!res.ok) throw new Error(data.error) + setApplications(data.applications ?? []) + setLoadError('') + } catch (err) { + setLoadError((err as Error).message || 'Could not load your pipeline. Retrying…') + } finally { + setLoading(false) + } }, []) useEffect(() => { @@ -133,15 +137,37 @@ export default function PipelineDashboard() { } const markApplied = async (appId: string) => { - await fetch(`/api/openclaw/applications/${appId}`, { + const res = await fetch(`/api/openclaw/applications/${appId}`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ status: 'Applied' }), - }) + }).catch(() => null) + if (!res?.ok) { + setSubmitMsg('✗ Could not update the application. Try again.') + return + } loadApps() setSelected(null) } + // A résumé tailored to a job the student evaluated themselves + const tailor = async (appId: string) => { + setTailoring(appId) + setSubmitMsg('') + try { + const res = await fetch(`/api/openclaw/applications/${appId}/tailor`, { method: 'POST' }) + const data = await res.json().catch(() => ({})) + if (!res.ok) throw new Error(data.error) + setSubmitMsg('✓ Résumé tailored to this job. Download it with the CV button.') + setSelected(s => (s && s.id === appId ? { ...s, ...data.application } : s)) + loadApps() + } catch (err) { + setSubmitMsg(`✗ ${(err as Error).message || 'Could not tailor the résumé. Try again.'}`) + } finally { + setTailoring(null) + } + } + const calculateGrade = (s: number) => { if (s >= 85) return 'A' if (s >= 70) return 'B' @@ -224,37 +250,36 @@ export default function PipelineDashboard() { OpenClaw evaluates and prepares. You submit on the employer’s site (the browser extension can fill the form), unless you turned on auto-submit and the employer is connected to SkillGraph.

+ {loadError &&

{loadError}

} {submitMsg &&

{submitMsg}

} {/* Pipeline Table */}
{/* Table Header */} -
+
GradeCompanyRoleScoreStatusAction
{/* Rows */}
{loading ? ( -
INITIALIZING PIPELINE...
+
Loading your pipeline…
) : applications.length === 0 ? ( -
NO ENTRIES — ADD A JOB LINK OR DESCRIPTION TO BEGIN
+
Nothing here yet. Add a job link or paste a job description above.
) : ( applications.map(app => { let parsedEvals = app.EvaluationResult - if (!parsedEvals && app.tailoringNotes) { - try { - const notes = JSON.parse(app.tailoringNotes) - parsedEvals = { - grade: notes.grade || '?', - totalScore: notes.matchScore || app.matchScore || 0, - recommendation: notes.recommendation || '', - keyStrengths: notes.keyStrengths || [], - keyWeaknesses: notes.keyWeaknesses || [], - negotiationLeverage: '', - dimensions: {} - } - } catch(e) {} + const notes = parseTailoringNotes(app.tailoringNotes).evaluation + if (!parsedEvals && notes) { + parsedEvals = { + grade: notes.grade || '?', + totalScore: notes.matchScore || app.matchScore || 0, + recommendation: notes.recommendation || '', + keyStrengths: notes.keyStrengths || [], + keyWeaknesses: notes.keyWeaknesses || [], + negotiationLeverage: '', + dimensions: {} + } } const score = parsedEvals?.totalScore ?? app.matchScore ?? 0 @@ -269,7 +294,7 @@ export default function PipelineDashboard() { return (
setSelected({ ...app, EvaluationResult: parsedEvals, Listing: listing })} > {grade} @@ -280,9 +305,15 @@ export default function PipelineDashboard() { title={status === 'UnableToApply' || status === 'Failed' ? 'Created by the retired auto-apply agent — apply on the posting yourself' : status} className={`text-xs font-semibold cursor-help ${STATUS_COLORS[status] ?? 'text-zinc-400'}`} > - {STATUS_LABELS[status] ?? status} + {statusLabel(status)} + {status === 'Applied' && submittedViaLabel(app.submittedVia) && ( + {submittedViaLabel(app.submittedVia)} + )}
e.stopPropagation()}> + {AWAITING_STUDENT.includes(status) && !app.resumeVersionId && ( + + )} {AWAITING_STUDENT.includes(status) && ( )} @@ -337,7 +368,7 @@ export default function PipelineDashboard() { <>

Recommendation

-

{selected.EvaluationResult.recommendation}

+

{recommendationLabel(selected.EvaluationResult.recommendation)}

@@ -381,15 +412,41 @@ export default function PipelineDashboard() { )} - {!selected.EvaluationResult && selected.tailoringNotes && ( -
-

What to emphasise

-

{selected.tailoringNotes}

-
+ {(() => { + const { advice, notSubmittedReason } = parseTailoringNotes(selected.tailoringNotes) + return ( + <> + {advice && ( +
+

What to emphasise

+

{advice}

+
+ )} + {notSubmittedReason && ( +
+

Why it wasn’t submitted for you

+

{notSubmittedReason}

+
+ )} + + ) + })()} + + {selected.status === 'Applied' && submittedViaLabel(selected.submittedVia) && ( +

Applied · {submittedViaLabel(selected.submittedVia)}

)} {AWAITING_STUDENT.includes(selected.status) && (
+ {selected.resumeVersionId ? ( + + ) : ( + + )} {selected.Listing?.sourceUrl && (