refactor(profile): split account and career into dedicated components
Phase 2.2 — stop backing /profile and /career from one component behind a boolean. /career now renders a dedicated CareerProfilePage; /profile keeps ProfilePage. Each hardcodes its mode and saves only its own concern (identity vs master profile) via the partial-update endpoint. This commit is the behaviour-preserving checkpoint: the two components still share the full implementation (each carries all state, only its own JSX renders). The per-component pruning that removes the other concern's state/JSX follows in subsequent commits, verified by tsc at each step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,11 +2,11 @@ import React from "react";
|
||||
|
||||
import { Alert, Box, Paper, Typography } from "@mui/material";
|
||||
|
||||
import ProfilePage from "./ProfilePage";
|
||||
import CareerProfilePage from "./CareerProfilePage";
|
||||
|
||||
// Phase 2: /career is the Career Workspace — the master career profile, which is the single source
|
||||
// of truth for all generated documents. The CV Builder is deliberately NOT here yet (Phase 4);
|
||||
// Phase 2 only establishes the master profile. The previously-inert "CV Builder" tab was removed.
|
||||
// Phase 2 / 2.2: /career is the Career Workspace — the master career profile, the single source of
|
||||
// truth for all generated documents. It is a dedicated component (CareerProfilePage), no longer a
|
||||
// careerOnly fork of ProfilePage. The CV Builder is deliberately NOT here yet (Phase 4).
|
||||
export default function CareerWorkspacePage() {
|
||||
return (
|
||||
<Box sx={{ display: "grid", gap: 2 }}>
|
||||
@@ -20,7 +20,7 @@ export default function CareerWorkspacePage() {
|
||||
Your master profile is the source of truth. Job-specific CV drafts remain separate and never overwrite it.
|
||||
</Alert>
|
||||
<Paper sx={{ borderRadius: 4, p: { xs: 1.5, md: 2.5 }, boxShadow: "0px 8px 24px -12px rgba(15,23,42,0.12)" }}>
|
||||
<ProfilePage careerOnly />
|
||||
<CareerProfilePage />
|
||||
</Paper>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -226,18 +226,12 @@ function FieldReviewNote({ metadata }: { metadata?: StructuredCvFieldMetadata })
|
||||
);
|
||||
}
|
||||
|
||||
// careerOnly splits the two Phase 2 surfaces this component still backs:
|
||||
// false -> /profile: account identity + security + preferences
|
||||
// true -> /career: the master career profile (source of truth)
|
||||
// Fully separating this into two components is roadmap 2.2; for now the fork keeps each route's
|
||||
// content — and its Save payload — cleanly scoped.
|
||||
export default function ProfilePage({
|
||||
careerOnly = false,
|
||||
onMasterCvAvailabilityChange,
|
||||
}: {
|
||||
careerOnly?: boolean;
|
||||
onMasterCvAvailabilityChange?: (hasMasterCv: boolean) => void;
|
||||
}) {
|
||||
// ProfilePage backs /profile: account identity + security + preferences. The master career
|
||||
// profile lives in CareerProfilePage (/career). Split in Phase 2.2. Saves only identity fields
|
||||
// (partial update), never the master profile.
|
||||
export default function ProfilePage() {
|
||||
// Retained so the shared JSX reads identically; hardcoded for /profile.
|
||||
const careerOnly = false;
|
||||
const { toast } = useToast();
|
||||
const { t } = useI18n();
|
||||
const cvInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user