diff --git a/__tests__/extension-save-job-route.test.ts b/__tests__/extension-save-job-route.test.ts index ff8d48c..c84ae60 100644 --- a/__tests__/extension-save-job-route.test.ts +++ b/__tests__/extension-save-job-route.test.ts @@ -100,7 +100,7 @@ describe('POST /api/extension/save-job', () => { expect(json.ok).toBe(true); expect(json.job_id).toMatch(/^[0-9a-f-]{36}$/); expect(json.queue_id).toBe('queue-1'); - expect(json.redirect_url).toBe('/dashboard'); + expect(json.redirect_url).toBe('/jobs/queue'); }); it('reuses an existing tracked job and refreshes its queue entry', async () => { diff --git a/__tests__/production-smoke.test.ts b/__tests__/production-smoke.test.ts index 2d5028f..a0c3fde 100644 --- a/__tests__/production-smoke.test.ts +++ b/__tests__/production-smoke.test.ts @@ -37,9 +37,7 @@ describe('production smoke harness', () => { if (url.endsWith('/jobs')) return new Response('

Jobs

'); if (url.endsWith('/history')) return new Response('

History

'); if (url.endsWith('/resume-builder')) - return new Response( - '

Resume Builder

Achievements & sources

Extra experience

' - ); + return new Response('

Resume Builder

'); if (url.endsWith('/pricing')) return new Response('

Tokens

'); if (url.endsWith('/proof')) { return new Response('

TrueHire proof project

Candidate proof profile

'); @@ -111,9 +109,7 @@ describe('production smoke harness', () => { if (url.endsWith('/jobs')) return new Response('

Jobs

'); if (url.endsWith('/history')) return new Response('

History

'); if (url.endsWith('/resume-builder')) - return new Response( - '

Resume Builder

Achievements & sources

Extra experience

' - ); + return new Response('

Resume Builder

'); if (url.endsWith('/pricing')) return new Response('

Tokens

'); if (url.endsWith('/proof')) { return new Response('

TrueHire proof project

Candidate proof profile

'); @@ -198,8 +194,7 @@ describe('production smoke harness', () => { '/history': '

History

', '/pricing': '

Tokens

', '/proof': '

TrueHire proof project

Candidate proof profile

', - '/resume-builder': - '

Resume Builder

Achievements & sources

Extra experience

', + '/resume-builder': '

Resume Builder

', '/settings': '

Feature availability

Chrome extension

', }[path] ?? '

Unexpected route

' ); diff --git a/docs/product/surfaces.md b/docs/product/surfaces.md index 68b5525..6d361b9 100644 --- a/docs/product/surfaces.md +++ b/docs/product/surfaces.md @@ -34,15 +34,20 @@ when a route is added or removed. | Route | Purpose | | --- | --- | -| `/resume-builder` | Continuous master-resume outline: edit original facts, pin points, add roles/projects, manage achievements/sources and extra experience. | +| `/resume-builder` | Master résumé outline for editing experience, projects, education, and points to include when tailoring. | +| `/resume-builder/evidence` | Achievements, sources, and extra experience. | +| `/resume-builder/profile` | Signed-in career records, application answers, and archived profiles. | +| `/resume-builder/generate` | Signed-in résumé generation for a general profile or specific job. | | `/dashboard` | Compatibility alias for the Jobs workspace. | | `/editor/[id]` | Markdown resume editor with live preview (CodeMirror). Autosaves drafts to localStorage. | | `/tailor/[jobId]` | Job description → AI tailor → document preview, explained changes and editable diff. Signed-in generation: 1 token. | | `/cover-letter/[jobId]` | Cover letter generation with company research. 1 token. | | `/interview-prep/[jobId]` | STAR+R story generation. | -| `/evidence` | Compatibility redirect to `/resume-builder#sources`; the existing evidence bank retains D1/localStorage persistence. | -| `/stash` | Compatibility redirect to `/resume-builder#extra-experience`; the existing extra-content pool is preserved. | -| `/jobs` | Job intake, application tracking and analytics. Job discovery and reviewed application preparation are available here. | +| `/evidence` | Compatibility redirect to `/resume-builder/evidence#sources`. | +| `/stash` | Compatibility redirect to `/resume-builder/evidence#extra-experience`. | +| `/jobs` | Job intake, application tracking, and analytics. | +| `/jobs/discover` | LinkedIn search, ATS search tips, and recent roles from the observed feed. | +| `/jobs/queue` | Review-first application preparation, follow-ups, and recruiter replies. | | `/history` | Past job records and saved tailored résumé versions, with options to reopen or download the exact version. | | `/settings` | Account-menu settings: AI provider config and apply-agent readiness. | diff --git a/e2e/ats-job-flow.spec.ts b/e2e/ats-job-flow.spec.ts index 7cdfa74..3017876 100644 --- a/e2e/ats-job-flow.spec.ts +++ b/e2e/ats-job-flow.spec.ts @@ -174,10 +174,26 @@ test('Always include selections persist with the base resume and education stays */ test.describe('Job search tips', () => { - test('search tips panel is visible and expandable on dashboard', async ({ page }) => { + test('search tips live on the Find jobs page, with the workspace navigation intact', async ({ + page, + }) => { await page.goto('/dashboard'); - await page.getByText('Find more jobs', { exact: true }).click(); + const navigation = page.getByRole('navigation', { name: 'Jobs sections' }); + await expect(page.getByRole('heading', { name: 'Jobs', exact: true })).toBeVisible(); + await expect(page.getByLabel('Role or keywords')).toHaveCount(0); + await expect(page.getByText('Application queue', { exact: true })).toHaveCount(0); + await navigation.getByRole('link', { name: 'Find jobs', exact: true }).click(); + await expect(page).toHaveURL(/\/jobs\/discover$/); + await expect(navigation.getByRole('link', { name: 'Find jobs', exact: true })).toHaveAttribute( + 'aria-current', + 'page' + ); + await expect( + page + .getByRole('navigation', { name: 'Primary', exact: true }) + .getByRole('link', { name: 'Jobs', exact: true }) + ).toHaveAttribute('aria-current', 'page'); // The tips panel should be present const tipsButton = page.getByRole('button', { @@ -199,8 +215,7 @@ test.describe('Job search tips', () => { }); test('builds a Google query preview and open link', async ({ page }) => { - await page.goto('/dashboard'); - await page.getByText('Find more jobs', { exact: true }).click(); + await page.goto('/jobs/discover'); const tipsButton = page.getByRole('button', { name: /find less-competitive jobs on ats boards/i, @@ -225,8 +240,7 @@ test.describe('Job search tips', () => { }); test('toggling boards updates the query', async ({ page }) => { - await page.goto('/dashboard'); - await page.getByText('Find more jobs', { exact: true }).click(); + await page.goto('/jobs/discover'); const tipsButton = page.getByRole('button', { name: /find less-competitive jobs on ats boards/i, @@ -551,7 +565,11 @@ test.describe('Apply-agent queue receipts (guest mode)', () => { }); await page.reload(); - await page.getByText('Application preparation & follow-ups', { exact: true }).click(); + await page + .getByRole('navigation', { name: 'Jobs sections' }) + .getByRole('link', { name: 'Apply queue', exact: true }) + .click(); + await expect(page).toHaveURL(/\/jobs\/queue$/); await expect(page.getByText('Application queue', { exact: true })).toBeVisible(); await expect(page.getByText(/ReceiptCo · Tailored materials/i)).toBeVisible(); await page.getByRole('button', { name: 'Mark submitted' }).click(); @@ -582,10 +600,10 @@ test.describe('Apply-agent queue receipts (guest mode)', () => { }); }); -test.describe('Dashboard discover section copy', () => { - test('mentions ATS boards in the discover section', async ({ page }) => { - await page.goto('/dashboard'); - await page.getByText('Find more jobs', { exact: true }).click(); +test.describe('Find jobs', () => { + test('old observed feed URLs open Find jobs', async ({ page }) => { + await page.goto('/jobs?page=2'); + await expect(page).toHaveURL(/\/jobs\/discover\?page=2$/); await expect(page.getByText(/Ashby, Greenhouse, Lever/i)).toBeVisible(); }); }); diff --git a/e2e/resume-builder.spec.ts b/e2e/resume-builder.spec.ts index 9384800..f8a53cb 100644 --- a/e2e/resume-builder.spec.ts +++ b/e2e/resume-builder.spec.ts @@ -38,8 +38,24 @@ test('Outline edits, pins and added projects survive reload and legacy links ope .fill('TypeScript · https://example.org/console'); await projects.getByLabel('Achievement 1', { exact: true }).fill('Released an API console.'); await projects.getByRole('button', { name: 'Add to master' }).click(); + const builderSections = page.getByRole('navigation', { name: 'Resume Builder sections' }); + await builderSections.getByRole('link', { name: 'Evidence', exact: true }).click(); + await expect(page).toHaveURL(/\/resume-builder$/); + await expect(page.getByRole('status')).toContainText('Save your changes before leaving'); + const unexpectedNavigation = expect( + page.waitForURL(/\/resume-builder\/evidence/, { timeout: 750 }) + ).rejects.toThrow('Timeout'); + await page.evaluate(() => { + window.location.hash = 'sources'; + }); + await unexpectedNavigation; + await expect(page).toHaveURL(/\/resume-builder#sources$/); + await expect(page.getByRole('heading', { name: 'Achievements & sources' })).toHaveCount(0); await page.getByRole('button', { name: 'Save', exact: true }).click(); await expect(page.getByRole('status').filter({ hasText: 'Saved' })).toBeVisible(); + await page.evaluate(() => { + window.history.replaceState(null, '', window.location.pathname + window.location.search); + }); await page.reload(); await expect( page.getByRole('checkbox', { name: 'Always include: Built accessible React screens.' }) @@ -72,12 +88,20 @@ test('Outline edits, pins and added projects survive reload and legacy links ope .getByRole('link', { name: 'Resume Builder', exact: true }) .click(); await expect(page.getByRole('heading', { name: 'Resume Builder', exact: true })).toBeVisible(); + await builderSections.getByRole('link', { name: 'Evidence', exact: true }).click(); + await expect(page).toHaveURL(/resume-builder\/evidence\?resume=outline-master/); + await expect(page.getByRole('heading', { name: 'Achievements & sources' })).toBeVisible(); + await expect(page.getByRole('button', { name: 'Save', exact: true })).toHaveCount(0); + await builderSections.getByRole('link', { name: 'Master résumé', exact: true }).click(); + await expect(page.getByLabel('Master resume')).toHaveValue('outline-master'); await page.goto('/evidence'); - await page.waitForURL(/resume-builder#sources/); + await page.waitForURL(/resume-builder\/evidence#sources/); await expect(page.getByRole('heading', { name: 'Achievements & sources' })).toBeVisible(); await page.goto('/stash'); - await page.waitForURL(/resume-builder#extra-experience/); + await page.waitForURL(/resume-builder\/evidence#extra-experience/); await expect(page.getByRole('heading', { name: 'Extra experience' })).toBeVisible(); + await page.goto('/resume-builder?resume=outline-master#sources'); + await expect(page).toHaveURL(/resume-builder\/evidence\?resume=outline-master#sources/); await page.goto('/jobs'); await expect(page.getByRole('heading', { name: 'Jobs', exact: true })).toBeVisible(); const nav = page.getByRole('navigation', { name: 'Primary', exact: true }); diff --git a/package.json b/package.json index 40d00db..322fd9b 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "@codemirror/view": "^6.43.6", "@mozilla/readability": "^0.6.0", "@radix-ui/react-avatar": "1.2.7", - "@radix-ui/react-checkbox": "1.3.12", "@radix-ui/react-dialog": "1.2.0", "@radix-ui/react-dropdown-menu": "2.1.25", "@radix-ui/react-label": "2.1.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 030a69f..62e4a41 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,9 +69,6 @@ importers: '@radix-ui/react-avatar': specifier: 1.2.7 version: 1.2.7(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@radix-ui/react-checkbox': - specifier: 1.3.12 - version: 1.3.12(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) '@radix-ui/react-dialog': specifier: 1.2.0 version: 1.2.0(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) @@ -2554,19 +2551,6 @@ packages: '@types/react-dom': optional: true - '@radix-ui/react-checkbox@1.3.12': - resolution: {integrity: sha512-gNOS2lLrpQxNLWHhCX0sayfVRiyB5gQp7nQIzpl+PM1Hkab52utsKtD27alAr78uqhpvX51kwqDp71hM5hNSwg==} - peerDependencies: - '@types/react': '*' - '@types/react-dom': '*' - react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc - peerDependenciesMeta: - '@types/react': - optional: true - '@types/react-dom': - optional: true - '@radix-ui/react-collapsible@1.1.20': resolution: {integrity: sha512-mcGesGplBnzN2sbvJETzpCNfSMyPnb29q1GRLU+Ib7bJrpIG2ywmRoh2V5VbA2uNvKikKUlVbAPks7JDjz4A8Q==} peerDependencies: @@ -9349,21 +9333,6 @@ snapshots: '@types/react': 19.3.0 '@types/react-dom': 19.3.0(@types/react@19.3.0) - '@radix-ui/react-checkbox@1.3.12(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': - dependencies: - '@radix-ui/primitive': 1.1.7 - '@radix-ui/react-compose-refs': 1.1.5(@types/react@19.2.17)(react@19.2.8) - '@radix-ui/react-context': 1.2.2(@types/react@19.2.17)(react@19.2.8) - '@radix-ui/react-presence': 1.1.11(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@radix-ui/react-primitive': 2.1.11(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8) - '@radix-ui/react-use-controllable-state': 1.2.6(@types/react@19.2.17)(react@19.2.8) - '@radix-ui/react-use-size': 1.1.5(@types/react@19.2.17)(react@19.2.8) - react: 19.2.8 - react-dom: 19.2.8(react@19.2.8) - optionalDependencies: - '@types/react': 19.2.17 - '@types/react-dom': 19.2.3(@types/react@19.2.17) - '@radix-ui/react-collapsible@1.1.20(@types/react-dom@19.2.3(@types/react@19.2.17))(@types/react@19.2.17)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)': dependencies: '@radix-ui/primitive': 1.1.7 diff --git a/public-readability-policy.mjs b/public-readability-policy.mjs index c54aa9c..a89087d 100644 --- a/public-readability-policy.mjs +++ b/public-readability-policy.mjs @@ -6,6 +6,7 @@ export const privatePaths = [ '/api/', '/dashboard', '/jobs', + '/history', '/evidence', '/resume-builder', '/editor', diff --git a/scripts/production-smoke.mjs b/scripts/production-smoke.mjs index e72a508..d9764ee 100644 --- a/scripts/production-smoke.mjs +++ b/scripts/production-smoke.mjs @@ -40,7 +40,7 @@ export function buildSmokeChecks({ hasSessionCookie = false } = {}) { method: 'GET', path: '/resume-builder', expectStatus: 200, - requiredText: ['Resume Builder', 'Achievements & sources', 'Extra experience'], + requiredText: ['id="resume-builder-master-heading"'], }, { name: 'pricing', diff --git a/scripts/verify-deploy-routes.mjs b/scripts/verify-deploy-routes.mjs index 5ae9a94..7f7f6e1 100644 --- a/scripts/verify-deploy-routes.mjs +++ b/scripts/verify-deploy-routes.mjs @@ -8,12 +8,17 @@ import { join } from 'node:path'; export const REQUIRED_DEPLOY_ROUTES = [ '/', '/jobs', + '/jobs/discover', + '/jobs/queue', '/history', '/proof', '/pricing', '/settings', '/dashboard', '/resume-builder', + '/resume-builder/evidence', + '/resume-builder/profile', + '/resume-builder/generate', '/api/jobs/search', '/api/mcp', '/api/resume', diff --git a/src/__tests__/resume-builder.test.tsx b/src/__tests__/resume-builder.test.tsx index 0d03dfc..eafc4a8 100644 --- a/src/__tests__/resume-builder.test.tsx +++ b/src/__tests__/resume-builder.test.tsx @@ -97,6 +97,18 @@ it('opens a newly requested master when creation navigates within the builder pa expect(screen.getByRole('heading', { name: 'Grace' })).toBeVisible(); }); +it('restores a nondefault guest master when returning from a workspace subpage', () => { + const other = { ...resume, id: 'r2', name: 'Other', source: source.replace('Ada', 'Grace') }; + vi.mocked(localListResumes).mockReturnValue([resume, other]); + render(); + expect(screen.getByLabelText('Master resume')).toHaveValue('r2'); + expect(screen.getByRole('heading', { name: 'Grace' })).toBeVisible(); + expect(screen.getByRole('link', { name: 'Evidence' })).toHaveAttribute( + 'href', + '/resume-builder/evidence?resume=r2' + ); +}); + it('shows readable details and cancels a focused edit without changing the imported master', () => { render(); expect(screen.queryByLabelText('Full name')).not.toBeInTheDocument(); diff --git a/src/app/api/extension/save-job/route.ts b/src/app/api/extension/save-job/route.ts index 1e9bc91..11036fc 100644 --- a/src/app/api/extension/save-job/route.ts +++ b/src/app/api/extension/save-job/route.ts @@ -62,7 +62,7 @@ export async function POST(req: NextRequest) { job_id: jobId, queue_id: queueId, existing, - redirect_url: shouldQueue ? '/dashboard' : `/tailor/${jobId}`, + redirect_url: shouldQueue ? '/jobs/queue' : `/tailor/${jobId}`, }, { status: existing ? 200 : 201, headers } ); diff --git a/src/app/application-utilities.css b/src/app/application-utilities.css index 4f491b1..7158566 100644 --- a/src/app/application-utilities.css +++ b/src/app/application-utilities.css @@ -7,4 +7,4 @@ } @source "../"; -@source "../../node_modules/@saas-maker/ui/src/components/{badge,button,input,table,tabs,textarea,toggle,toggle-group}.tsx"; +@source "../../node_modules/@saas-maker/ui/src/components/{badge,button,card,checkbox,input,label,skeleton,table,tabs,textarea,toggle,toggle-group}.tsx"; diff --git a/src/app/evidence/page.tsx b/src/app/evidence/page.tsx index 0a1b434..0e3a471 100644 --- a/src/app/evidence/page.tsx +++ b/src/app/evidence/page.tsx @@ -1,5 +1,5 @@ import { redirect } from 'next/navigation'; export default function LegacyPage() { - redirect('/resume-builder#sources'); + redirect('/resume-builder/evidence#sources'); } diff --git a/src/app/history/page.tsx b/src/app/history/page.tsx index bd192ee..0cb3e15 100644 --- a/src/app/history/page.tsx +++ b/src/app/history/page.tsx @@ -15,7 +15,7 @@ export default async function HistoryPage() { return ( ; +}) { + const resumes = await listResumes(); + return ( + } + serverResumes={resumes} + serverJobs={[]} + /> + ); +} diff --git a/src/app/jobs/page.tsx b/src/app/jobs/page.tsx index a105da3..e0a5848 100644 --- a/src/app/jobs/page.tsx +++ b/src/app/jobs/page.tsx @@ -1,67 +1,24 @@ -export const dynamic = 'force-dynamic'; -export const metadata = { title: 'Jobs' }; - -import ObservedJobs from '@/components/observed-jobs'; +import { redirect } from 'next/navigation'; import { Dashboard } from '@/components/dashboard'; -import { - listApplicationPackets, - listApplicationQueue, - listApplicationReceipts, -} from '@/lib/actions/apply-agent-actions'; -import { listFitScores } from '@/lib/actions/fit-score-action'; -import { listJobDiscoveryAlerts } from '@/lib/actions/job-discovery-actions'; import { listJobApplications } from '@/lib/actions/job-actions'; -import { listProfileAnswers } from '@/lib/actions/profile-answer-actions'; -import { - getReplyRoutingAddress, - listRecruiterReplyEvents, -} from '@/lib/actions/recruiter-reply-actions'; import { listResumes } from '@/lib/actions/resume-actions'; import { listResumeHistory } from '@/lib/actions/resume-history-actions'; +export const dynamic = 'force-dynamic'; +export const metadata = { title: 'Jobs' }; + export default async function JobsPage({ searchParams, }: { searchParams: Promise<{ page?: string | string[] }>; }) { - const [ - resumes, - jobs, - applicationQueue, - applicationReceipts, - applicationPackets, - profileAnswers, - jobDiscoveryAlerts, - replyRoutingAddress, - recruiterReplyEvents, - history, - ] = await Promise.all([ + const params = await searchParams; + const legacyFeedPage = Array.isArray(params.page) ? params.page[0] : params.page; + if (legacyFeedPage) redirect(`/jobs/discover?page=${encodeURIComponent(legacyFeedPage)}`); + const [resumes, jobs, history] = await Promise.all([ listResumes(), listJobApplications(), - listApplicationQueue(), - listApplicationReceipts(), - listApplicationPackets(), - listProfileAnswers(), - listJobDiscoveryAlerts(), - getReplyRoutingAddress(), - listRecruiterReplyEvents(), listResumeHistory(), ]); - const fitScores = await listFitScores(jobs.map((j) => j.id)); - return ( - } - serverResumes={resumes} - serverJobs={jobs} - serverFitScores={fitScores} - serverApplicationQueue={applicationQueue} - serverApplicationReceipts={applicationReceipts} - serverApplicationPackets={applicationPackets} - serverProfileAnswers={profileAnswers} - serverJobDiscoveryAlerts={jobDiscoveryAlerts} - serverReplyRoutingAddress={replyRoutingAddress} - serverRecruiterReplyEvents={recruiterReplyEvents} - serverHistory={history} - /> - ); + return ; } diff --git a/src/app/jobs/queue/page.tsx b/src/app/jobs/queue/page.tsx new file mode 100644 index 0000000..3829b2f --- /dev/null +++ b/src/app/jobs/queue/page.tsx @@ -0,0 +1,52 @@ +import { Dashboard } from '@/components/dashboard'; +import { + listApplicationPackets, + listApplicationQueue, + listApplicationReceipts, +} from '@/lib/actions/apply-agent-actions'; +import { listFitScores } from '@/lib/actions/fit-score-action'; +import { listJobDiscoveryAlerts } from '@/lib/actions/job-discovery-actions'; +import { listJobApplications } from '@/lib/actions/job-actions'; +import { listProfileAnswers } from '@/lib/actions/profile-answer-actions'; +import { + getReplyRoutingAddress, + listRecruiterReplyEvents, +} from '@/lib/actions/recruiter-reply-actions'; +import { listResumes } from '@/lib/actions/resume-actions'; +import { listResumeHistory } from '@/lib/actions/resume-history-actions'; + +export const dynamic = 'force-dynamic'; +export const metadata = { title: 'Apply queue' }; + +export default async function ApplyQueuePage() { + const [resumes, jobs, queue, receipts, packets, answers, alerts, address, replies, history] = + await Promise.all([ + listResumes(), + listJobApplications(), + listApplicationQueue(), + listApplicationReceipts(), + listApplicationPackets(), + listProfileAnswers(), + listJobDiscoveryAlerts(), + getReplyRoutingAddress(), + listRecruiterReplyEvents(), + listResumeHistory(), + ]); + const fitScores = await listFitScores(jobs.map((job) => job.id)); + return ( + + ); +} diff --git a/src/app/proof/page.tsx b/src/app/proof/page.tsx index cf81bed..8026f45 100644 --- a/src/app/proof/page.tsx +++ b/src/app/proof/page.tsx @@ -13,7 +13,7 @@ export const metadata: Metadata = { alternates: { canonical: 'https://rolepatch.com/proof' }, }; export default async function ProofPage() { - if (await getCurrentUserId()) redirect('/resume-builder#sources'); + if (await getCurrentUserId()) redirect('/resume-builder/evidence#sources'); const entries = await listAchievementEvidence(); return ( ; +}) { + const [evidence, stash, params] = await Promise.all([ + listAchievementEvidence(), + listStashEntries(), + searchParams, + ]); + return ( + + ); +} diff --git a/src/app/resume-builder/generate/page.tsx b/src/app/resume-builder/generate/page.tsx new file mode 100644 index 0000000..3da355d --- /dev/null +++ b/src/app/resume-builder/generate/page.tsx @@ -0,0 +1,20 @@ +import { ResumeBuilder } from '@/components/resume-builder'; +import { listResumes } from '@/lib/actions/resume-actions'; + +export const dynamic = 'force-dynamic'; +export const metadata = { title: 'Generate a résumé' }; + +export default async function GeneratePage({ + searchParams, +}: { + searchParams: Promise<{ resume?: string | string[] }>; +}) { + const [resumes, params] = await Promise.all([listResumes(), searchParams]); + return ( + + ); +} diff --git a/src/app/resume-builder/page.tsx b/src/app/resume-builder/page.tsx index a9be45d..3dbcc18 100644 --- a/src/app/resume-builder/page.tsx +++ b/src/app/resume-builder/page.tsx @@ -1,7 +1,5 @@ import { ResumeBuilder } from '@/components/resume-builder'; -import { listAchievementEvidence } from '@/lib/actions/achievement-evidence-actions'; import { listResumes } from '@/lib/actions/resume-actions'; -import { listStashEntries } from '@/lib/actions/stash-actions'; export const dynamic = 'force-dynamic'; export const metadata = { title: 'Resume Builder' }; @@ -9,20 +7,13 @@ export const metadata = { title: 'Resume Builder' }; export default async function ResumeBuilderPage({ searchParams, }: { - searchParams: Promise<{ resume?: string }>; + searchParams: Promise<{ resume?: string | string[] }>; }) { - const [resumes, evidence, stash, params] = await Promise.all([ - listResumes(), - listAchievementEvidence(), - listStashEntries(), - searchParams, - ]); + const [resumes, params] = await Promise.all([listResumes(), searchParams]); return ( ); } diff --git a/src/app/resume-builder/profile/page.tsx b/src/app/resume-builder/profile/page.tsx new file mode 100644 index 0000000..f9b8079 --- /dev/null +++ b/src/app/resume-builder/profile/page.tsx @@ -0,0 +1,20 @@ +import { ResumeBuilder } from '@/components/resume-builder'; +import { listResumes } from '@/lib/actions/resume-actions'; + +export const dynamic = 'force-dynamic'; +export const metadata = { title: 'Career profile' }; + +export default async function ProfilePage({ + searchParams, +}: { + searchParams: Promise<{ resume?: string | string[] }>; +}) { + const [resumes, params] = await Promise.all([listResumes(), searchParams]); + return ( + + ); +} diff --git a/src/app/stash/page.tsx b/src/app/stash/page.tsx index a7efe2e..7fd01f4 100644 --- a/src/app/stash/page.tsx +++ b/src/app/stash/page.tsx @@ -1,5 +1,5 @@ import { redirect } from 'next/navigation'; export default function LegacyPage() { - redirect('/resume-builder#extra-experience'); + redirect('/resume-builder/evidence#extra-experience'); } diff --git a/src/components/archived-career-profiles.tsx b/src/components/archived-career-profiles.tsx index 390d93d..ab9ddce 100644 --- a/src/components/archived-career-profiles.tsx +++ b/src/components/archived-career-profiles.tsx @@ -1,7 +1,7 @@ 'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; -import { Button } from '@/components/ui/button'; +import { Button } from '@saas-maker/ui/components/button'; import { callCareer } from '@/lib/actions/career-records'; export function ArchivedCareerProfiles() { diff --git a/src/components/career-profile-panel.tsx b/src/components/career-profile-panel.tsx index a3fe8bb..43ccf82 100644 --- a/src/components/career-profile-panel.tsx +++ b/src/components/career-profile-panel.tsx @@ -2,9 +2,9 @@ import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Textarea } from '@/components/ui/textarea'; +import { Button } from '@saas-maker/ui/components/button'; +import { Input } from '@saas-maker/ui/components/input'; +import { Textarea } from '@saas-maker/ui/components/textarea'; import { CareerRecordEditor, type RecordDraft } from '@/components/career-record-editor'; import { callCareer } from '@/lib/actions/career-records'; import { @@ -23,7 +23,7 @@ export function CareerProfilePanel({ profileId }: { profileId: string }) { className="min-w-0 space-y-4 rounded-xl border bg-card p-4 md:p-6" >

- Career profile + Profile details

Keep career facts, approved wording and source links for future applications. diff --git a/src/components/career-resume-studio.tsx b/src/components/career-resume-studio.tsx index 1413669..3e2c6a0 100644 --- a/src/components/career-resume-studio.tsx +++ b/src/components/career-resume-studio.tsx @@ -1,9 +1,9 @@ 'use client'; import { useCallback, useEffect, useRef, useState } from 'react'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Textarea } from '@/components/ui/textarea'; +import { Button } from '@saas-maker/ui/components/button'; +import { Input } from '@saas-maker/ui/components/input'; +import { Textarea } from '@saas-maker/ui/components/textarea'; import { callCareerResume } from '@/lib/actions/career-resume'; type Response = Awaited>; @@ -140,12 +140,9 @@ function Studio({ profileId }: { profileId: string }) { className="space-y-5 rounded-xl border bg-card p-4 sm:p-6" >

-

- Generate a resume -

-

- Use this profile for a general resume, or add a job description to tailor it. -

+

+ Résumé options +

& { jd_text?: string }; +const jobsPages = { + tracker: { + href: '/jobs', + label: 'Tracker', + title: 'Jobs', + description: 'Track your applications and see how they’re progressing.', + }, + discover: { + href: '/jobs/discover', + label: 'Find jobs', + title: 'Find jobs', + description: + 'Search LinkedIn, browse recent roles, or add a URL from Ashby, Greenhouse, Lever, or another job board.', + }, + queue: { + href: '/jobs/queue', + label: 'Apply queue', + title: 'Apply queue', + description: 'Prepare applications for review and manage your follow-ups.', + }, +} as const; + +type JobsView = keyof typeof jobsPages; + interface DashboardProps { - historyOnly?: boolean; + view?: JobsView | 'history'; serverHistory?: TailoredResume[]; serverResumes: Resume[]; serverJobs: JobApplication[]; @@ -222,25 +247,30 @@ function timeAgo(unixSeconds: number): string { }); } -function DashboardHeader({ isGuest, resumes }: { isGuest: boolean; resumes: Resume[] }) { +function DashboardHeader({ view, resumes }: { view: JobsView; resumes: Resume[] }) { + const { href, title, description } = jobsPages[view]; return ( -
-
-

- Jobs -

-

- {isGuest - ? 'Add a job, review your tailored resume, and track your application. Guest work stays in this browser.' - : 'Add a job, review your tailored resume, and track your application.'} -

+
+
+
+

+ {title} +

+

{description}

+
+ {view !== 'queue' && ( + masterResumeReadiness(r.source).ready) + .map((r) => ({ id: r.id, name: r.name }))} + /> + )}
- masterResumeReadiness(r.source).ready) - .map((r) => ({ id: r.id, name: r.name }))} - /> -
+ + ); } @@ -274,7 +304,7 @@ function DashboardLoading({ historyOnly }: { historyOnly: boolean }) { export function Dashboard(props: DashboardProps) { const { - historyOnly = false, + view = 'tracker', serverResumes, serverJobs, serverFitScores, @@ -288,6 +318,7 @@ export function Dashboard(props: DashboardProps) { serverRecruiterReplyEvents = [], serverHistory = [], } = props; + const historyOnly = view === 'history'; const { isGuest, isPending: authPending } = useAuth(); const [localDataReady, setLocalDataReady] = useState(false); const dataPending = authPending || (isGuest && !localDataReady); @@ -337,7 +368,7 @@ export function Dashboard(props: DashboardProps) { setJobs(localListJobs()); setHistory(localListResumeHistory()); setApplicationReceipts(localListApplicationReceipts()); - if (!historyOnly) { + if (view === 'queue') { setApplicationQueue(localListApplicationQueue()); setApplicationPackets(localListApplicationPackets()); setProfileAnswers(localListProfileAnswers()); @@ -346,7 +377,7 @@ export function Dashboard(props: DashboardProps) { setLocalDataReady(true); /* eslint-enable react-hooks/set-state-in-effect */ } - }, [authPending, historyOnly, isGuest]); + }, [authPending, view, isGuest]); // Capture a stable "now" for alerts (client-only to avoid impure render) useEffect(() => { @@ -707,24 +738,14 @@ export function Dashboard(props: DashboardProps) { }; }, [activeDetailsJob]); - if (dataPending) { - return ( -
- - {!historyOnly && } - -
- ); - } - return (
+ {!historyOnly && } + {dataPending && } - {!historyOnly && ( + {!dataPending && view === 'tracker' && ( <> - - {/* Alerts — interviews this week, overdue follow-ups */} {(alerts.interviewsThisWeek > 0 || alerts.overdueFollowUps > 0) && (
@@ -783,7 +804,7 @@ export function Dashboard(props: DashboardProps) { )} - {historyOnly && ( + {!dataPending && historyOnly && (
@@ -927,80 +948,57 @@ export function Dashboard(props: DashboardProps) {
)} - {!historyOnly && ( + {!dataPending && view === 'discover' && ( <> -
- Find more jobs - {/* Stats bar — only show when there are jobs */} - {/* Discover jobs section */} -
-
-
- -
-
-

Discover jobs

-

- Search LinkedIn or paste any ATS job URL — Ashby, Greenhouse, Lever, and more -

-
-
- ({ id: r.id, name: r.name, source: r.source }))} - onQueueDiscoveredJob={handleQueueDiscoveredJob} - /> -
- -
-
- - {browseContent} -
-
- - Application preparation & follow-ups - -
- - - {!isGuest && ( - - )} +
+ ({ id: r.id, name: r.name, source: r.source }))} + onQueueDiscoveredJob={handleQueueDiscoveredJob} + /> + +
+ {browseContent} + + )} - -
-
+ {!dataPending && view === 'queue' && ( + <> + + + {!isGuest && ( + + )} )} - {detailsInitial && activeDetailsJob && ( + {!dataPending && detailsInitial && activeDetailsJob && ( -
+ +
+ + setQuery(e.target.value)} + placeholder="python engineer, staff PM, ..." + /> +
+
+ + setLocation(e.target.value)} + placeholder="San Francisco, Remote, ..." + /> +
+ + +
+ +
+ + +
+ + Quick searches + + {QUICK_SEARCHES.map((search) => ( + + ))} +
+ +

Active searches @@ -752,83 +825,6 @@ export function JobDiscovery({ resumes, onQueueDiscoveredJob }: JobDiscoveryProp

)} -
-
- - setQuery(e.target.value)} - placeholder="python engineer, staff PM, ..." - className="input-base" - /> -
-
- - setLocation(e.target.value)} - placeholder="San Francisco, Remote, ..." - className="input-base" - /> -
- - -
- -
-
- -
- - Quick searches - - {QUICK_SEARCHES.map((search) => ( - - ))} -
- {resumes.length > 1 && (
+ + + + ); + } + return ( + <> + {masterPicker} + onSaved(resume.id, source)} + /> + + ); +} + +function MasterResumePicker({ + resumes, + selected, + dirty, + onSelect, +}: { + resumes: Resume[]; + selected: string; + dirty: boolean; + onSelect: (id: string) => void; +}) { + if (resumes.length === 0) return null; + return ( +
+ + + {dirty && ( +

+ Save your changes before switching resumes. +

)} - {!isGuest && !isPending && resume && ( -
- - -
+
+ ); +} + +function CareerWorkspaceContent({ + view, + resumeId, + masterPicker, + isGuest, + isPending, +}: { + view: 'profile' | 'generate'; + resumeId?: string; + masterPicker: ReactNode; + isGuest: boolean; + isPending: boolean; +}) { + if (isPending) return ; + if (isGuest) { + return ( + + + Sign in to use your career profile + + Career records and generated résumés are saved to your account. + + + + + + + ); + } + return ( +
+ {masterPicker} + {resumeId ? ( + view === 'profile' ? ( + + ) : ( + + ) + ) : ( + + + Start with a master résumé + + + + + )} - {!isGuest && !isPending && } -
- -
-
-

Extra experience

-

- Keep additional projects, skills and achievements here for relevant applications. -

- -
-
+ {view === 'profile' && } +
); } @@ -175,24 +333,10 @@ function OutlineEditor({ const sections = useMemo(() => resumeOutline(source), [source]); const outline = useWorkspaceOutline(); const setSections = outline?.setSections; - const navigation = useMemo( - () => [ - ...sections.map(({ id, title }) => ({ id, title })), - ...(!isGuest - ? [ - { id: 'career-records', title: 'Career profile' }, - { id: 'career-resume-heading', title: 'Generate a resume' }, - ] - : []), - { id: 'sources', title: 'Achievements & sources' }, - { id: 'extra-experience', title: 'Extra experience' }, - ], - [sections, isGuest] - ); useEffect(() => { - setSections?.(navigation); + setSections?.(sections.map(({ id, title }) => ({ id, title }))); return () => setSections?.([]); - }, [setSections, navigation]); + }, [setSections, sections]); const points = listResumePoints(source); async function save() { const snapshot = source; @@ -258,12 +402,6 @@ function OutlineEditor({ {section.title} ))} - - Achievements & sources - - - Extra experience - )} @@ -288,140 +426,19 @@ function OutlineEditor({ -
-
- - - {(source.match(/^#\s+(.+)$/m)?.[1] ?? resume.name).slice(0, 2).toUpperCase()} - - -
-

- {source.match(/^#\s+(.+)$/m)?.[1] ?? resume.name} -

-

Master resume

-
-
-
- - {points.length} {points.length === 1 ? 'point' : 'points'} - - {sections.some((section) => /projects?|products?/i.test(section.title)) && ( - Projects included - )} - - {sections.some((section) => /education/i.test(section.title)) - ? 'Education included' - : 'Add education'} - -
-
- {sections.map((section) => { - const sectionPoints = points.filter( - (point) => point.start >= section.contentStart && point.end <= section.end - ); - let cursor = section.contentStart; - const pieces: React.ReactNode[] = []; - function details(start: number, end: number, suffix: string) { - if (!source.slice(start, end).trim() && sectionPoints.length) return; - const content = source.slice(start, end); - const editStart = start + (content.match(/^\s*/)?.[0].length ?? 0); - const editEnd = Math.max(editStart, end - (content.match(/\s*$/)?.[0].length ?? 0)); - pieces.push( - - setSource(replaceResumeRange(source, editStart, editEnd, value)) - } - /> - ); - } - for (const [index, point] of sectionPoints.entries()) { - details(cursor, point.start, String(index)); - pieces.push( - setSource(setResumePointPinned(source, point.id, pinned))} - onChange={(value) => { - const prefix = point.text.match(/^\s*[-+*]\s+/)?.[0] ?? '- '; - const marker = point.pinned ? ' ' : ''; - const newline = value.indexOf('\n'); - const updated = - newline < 0 - ? prefix + value + marker - : prefix + value.slice(0, newline) + marker + value.slice(newline); - setSource(replaceResumeRange(source, point.start, point.end, updated)); - }} - /> - ); - cursor = point.end; - } - if (cursor < section.end || !sectionPoints.length) - details(cursor, section.end, 'end'); - return ( -
- - - -

{section.title}

-
- - {/experience|employment|work history/i.test(section.title) - ? 'Keep every role and achievement here. Edit only the point you want to improve.' - : /projects?|products?/i.test(section.title) - ? 'Your complete products and projects. Each job ranks these alongside your experience.' - : /education/i.test(section.title) - ? 'Your qualifications stay in every tailored resume.' - : /skills/i.test(section.title) - ? 'Only skills you have supplied appear in your resumes.' - : 'Review your details, then choose Edit to make a change.'} - -
- - {/education/i.test(section.title) && ( -
- - -
- )} -
{pieces}
- {/experience|employment|work history|projects?|products?/i.test( - section.title - ) && ( - - setSource( - replaceResumeRange(source, section.end, section.end, `\n${entry}\n\n`) - ) - } - /> - )} -
-
-
- ); - })} + {sections.map((section) => ( + + ))}
@@ -476,6 +493,113 @@ function OutlineEditor({ ); } +function ResumeOutlineSection({ + section, + source, + points, + onChange, + onEditing, +}: { + section: ResumeSection; + source: string; + points: ReturnType; + onChange: (source: string) => void; + onEditing: (editing: boolean) => void; +}) { + const sectionPoints = points.filter( + (point) => point.start >= section.contentStart && point.end <= section.end + ); + let cursor = section.contentStart; + const pieces: React.ReactNode[] = []; + const addDetails = (start: number, end: number, suffix: string) => { + if (!source.slice(start, end).trim() && sectionPoints.length) return; + const content = source.slice(start, end); + const editStart = start + (content.match(/^\s*/)?.[0].length ?? 0); + const editEnd = Math.max(editStart, end - (content.match(/\s*$/)?.[0].length ?? 0)); + pieces.push( + onChange(replaceResumeRange(source, editStart, editEnd, value))} + /> + ); + }; + for (const [index, point] of sectionPoints.entries()) { + addDetails(cursor, point.start, String(index)); + pieces.push( + onChange(setResumePointPinned(source, point.id, pinned))} + onChange={(value) => { + const prefix = point.text.match(/^\s*[-+*]\s+/)?.[0] ?? '- '; + const marker = point.pinned ? ' ' : ''; + const newline = value.indexOf('\n'); + const updated = + newline < 0 + ? prefix + value + marker + : prefix + value.slice(0, newline) + marker + value.slice(newline); + onChange(replaceResumeRange(source, point.start, point.end, updated)); + }} + /> + ); + cursor = point.end; + } + if (cursor < section.end || !sectionPoints.length) addDetails(cursor, section.end, 'end'); + return ( +
+ + + +

{section.title}

+
+ + {/experience|employment|work history/i.test(section.title) + ? 'Keep every role and achievement here. Edit only the point you want to improve.' + : /projects?|products?/i.test(section.title) + ? 'Your complete products and projects. Each job ranks these alongside your experience.' + : /education/i.test(section.title) + ? 'Your qualifications stay in every tailored resume.' + : /skills/i.test(section.title) + ? 'Only skills you have supplied appear in your resumes.' + : 'Review your details, then choose Edit to make a change.'} + +
+ + {/education/i.test(section.title) && ( +
+ + +
+ )} +
{pieces}
+ {/experience|employment|work history|projects?|products?/i.test(section.title) && ( + + onChange(replaceResumeRange(source, section.end, section.end, `\n${entry}\n\n`)) + } + /> + )} +
+
+
+ ); +} + function Achievement({ id, number, diff --git a/src/components/resume-import-button.tsx b/src/components/resume-import-button.tsx index c9da7a5..ded75f5 100644 --- a/src/components/resume-import-button.tsx +++ b/src/components/resume-import-button.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation'; import { useRef, useState, useTransition } from 'react'; -import { Button } from '@/components/ui/button'; +import { Button } from '@saas-maker/ui/components/button'; import { useAuth } from '@/components/auth-provider'; import { importResumeFromFile } from '@/lib/actions/import-action'; import { localCreateResume } from '@/lib/local-storage'; diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx deleted file mode 100644 index 239a57e..0000000 --- a/src/components/ui/badge.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import type * as React from 'react'; -import { cva, type VariantProps } from 'class-variance-authority'; - -import { cn } from '@/lib/utils'; - -const badgeVariants = cva( - 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', - { - variants: { - variant: { - default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80', - secondary: - 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80', - destructive: - 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80', - outline: 'text-foreground', - }, - }, - defaultVariants: { - variant: 'default', - }, - } -); - -export interface BadgeProps - extends React.HTMLAttributes, - VariantProps {} - -function Badge({ className, variant, ...props }: BadgeProps) { - return
; -} - -export { Badge, badgeVariants }; diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx deleted file mode 100644 index 639673f..0000000 --- a/src/components/ui/card.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const Card = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -Card.displayName = 'Card'; - -const CardHeader = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -CardHeader.displayName = 'CardHeader'; - -const CardTitle = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -CardTitle.displayName = 'CardTitle'; - -const CardDescription = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -CardDescription.displayName = 'CardDescription'; - -const CardContent = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -CardContent.displayName = 'CardContent'; - -const CardFooter = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- ) -); -CardFooter.displayName = 'CardFooter'; - -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }; diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx deleted file mode 100644 index e84695c..0000000 --- a/src/components/ui/checkbox.tsx +++ /dev/null @@ -1,28 +0,0 @@ -'use client'; - -import * as React from 'react'; -import * as CheckboxPrimitive from '@radix-ui/react-checkbox'; -import { Check } from 'lucide-react'; - -import { cn } from '@/lib/utils'; - -const Checkbox = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - - -)); -Checkbox.displayName = CheckboxPrimitive.Root.displayName; - -export { Checkbox }; diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsx deleted file mode 100644 index 50e56b5..0000000 --- a/src/components/ui/table.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import * as React from 'react'; - -import { cn } from '@/lib/utils'; - -const Table = React.forwardRef>( - ({ className, ...props }, ref) => ( -
- - - ) -); -Table.displayName = 'Table'; - -const TableHeader = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( - -)); -TableHeader.displayName = 'TableHeader'; - -const TableBody = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( - -)); -TableBody.displayName = 'TableBody'; - -const TableFooter = React.forwardRef< - HTMLTableSectionElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( - tr]:last:border-b-0', className)} - {...props} - /> -)); -TableFooter.displayName = 'TableFooter'; - -const TableRow = React.forwardRef>( - ({ className, ...props }, ref) => ( - - ) -); -TableRow.displayName = 'TableRow'; - -const TableHead = React.forwardRef< - HTMLTableCellElement, - React.ThHTMLAttributes ->(({ className, ...props }, ref) => ( -
[role=checkbox]]:translate-y-[2px]', - className - )} - {...props} - /> -)); -TableHead.displayName = 'TableHead'; - -const TableCell = React.forwardRef< - HTMLTableCellElement, - React.TdHTMLAttributes ->(({ className, ...props }, ref) => ( - [role=checkbox]]:translate-y-[2px]', - className - )} - {...props} - /> -)); -TableCell.displayName = 'TableCell'; - -const TableCaption = React.forwardRef< - HTMLTableCaptionElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)); -TableCaption.displayName = 'TableCaption'; - -export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }; diff --git a/src/components/user-menu.tsx b/src/components/user-menu.tsx index a5e15f6..aa46a96 100644 --- a/src/components/user-menu.tsx +++ b/src/components/user-menu.tsx @@ -11,12 +11,18 @@ const SignedInUserMenu = dynamic(() => import('./signed-in-user-menu').then((module) => module.SignedInUserMenu) ); -export function UserMenu({ sidebar = false }: { sidebar?: boolean }) { +export function UserMenu({ + sidebar = false, + callbackURL = '/resume-builder', +}: { + sidebar?: boolean; + callbackURL?: string; +}) { const { data: session, isPending } = authClient.useSession(); if (!session?.user) { function handleSignIn() { authClient.signIn - .social({ provider: 'google', callbackURL: '/resume-builder' }) + .social({ provider: 'google', callbackURL }) .then((result) => { if (result?.error) captureAuthFailure({ diff --git a/src/components/workspace-section-nav.tsx b/src/components/workspace-section-nav.tsx new file mode 100644 index 0000000..d8702e0 --- /dev/null +++ b/src/components/workspace-section-nav.tsx @@ -0,0 +1,36 @@ +import { Button } from '@saas-maker/ui/components/button'; +import Link from 'next/link'; + +export function WorkspaceSectionNav({ + label, + items, + current, + resumeId, +}: { + label: string; + items: readonly { href: string; label: string }[]; + current: string; + resumeId?: string; +}) { + return ( + + ); +} diff --git a/src/components/workspace-shell.tsx b/src/components/workspace-shell.tsx index e4b3b05..779b673 100644 --- a/src/components/workspace-shell.tsx +++ b/src/components/workspace-shell.tsx @@ -17,20 +17,40 @@ export function WorkspaceShell({ children }: { children: ReactNode }) { const pathname = usePathname() ?? ''; const router = useRouter(); useEffect(() => { - if (pathname !== '/jobs' && pathname !== '/dashboard') return; - const openHistory = () => { - if (window.location.hash === '#history') router.replace('/history'); + const isJobsRoot = pathname === '/jobs' || pathname === '/dashboard'; + if (!isJobsRoot && pathname !== '/resume-builder') return; + const openBookmark = () => { + const { hash, search } = window.location; + if (isJobsRoot && hash === '#history') { + router.replace('/history'); + } + if (pathname === '/resume-builder') { + if (hash === '#sources' || hash === '#extra-experience') { + router.replace(`/resume-builder/evidence${search}${hash}`); + } else if (hash === '#career-records') { + router.replace(`/resume-builder/profile${search}`); + } else if (hash === '#career-resume-heading') { + router.replace(`/resume-builder/generate${search}`); + } + } }; - openHistory(); - window.addEventListener('hashchange', openHistory); - return () => window.removeEventListener('hashchange', openHistory); + openBookmark(); + if (!isJobsRoot) return; + window.addEventListener('hashchange', openBookmark); + return () => window.removeEventListener('hashchange', openBookmark); }, [pathname, router]); - const builder = pathname === '/resume-builder' || pathname.startsWith('/editor/'); + const builder = + pathname === '/resume-builder' || + pathname.startsWith('/resume-builder/') || + pathname.startsWith('/editor/'); const workspacePage = builder ? '/resume-builder' : pathname === '/history' ? '/history' - : pathname === '/jobs' || pathname === '/dashboard' || pathname.startsWith('/tailor/') + : pathname === '/jobs' || + pathname.startsWith('/jobs/') || + pathname === '/dashboard' || + pathname.startsWith('/tailor/') ? '/jobs' : null; const catalog = pathname === '/pricing' || pathname === '/tools';