feat(ui): redesign job workspace sections

This commit is contained in:
cesnimda
2026-10-07 01:58:31 +02:00
parent acd1d94684
commit ac6d78289d
123 changed files with 2842 additions and 205 deletions
+23 -13
View File
@@ -77,15 +77,16 @@ export const CHECKLIST_CATEGORIES: { key: string; label: string }[] = [
{ key: "custom", label: "Your own tasks" },
];
// Workspace navigation. Sections map to the Phase 5 milestones; each is added as its milestone lands
// so the workspace is always usable rather than a shell of placeholders.
export type WorkspaceSectionKey = "overview" | "analysis" | "cv" | "cover-letter" | "interview";
// URL-addressable presentation; domain components remain the data owners.
export type WorkspaceSectionKey = "overview" | "match" | "application" | "documents" | "timeline" | "tasks" | "interview";
export const WORKSPACE_SECTIONS: { key: WorkspaceSectionKey; label: string }[] = [
{ key: "overview", label: "Overview" },
{ key: "analysis", label: "Analysis" },
{ key: "cv", label: "CV" },
{ key: "cover-letter", label: "Cover Letter" },
{ key: "match", label: "Match" },
{ key: "application", label: "Application" },
{ key: "documents", label: "Documents" },
{ key: "timeline", label: "Timeline" },
{ key: "tasks", label: "Notes & tasks" },
{ key: "interview", label: "Interview Prep" },
];
@@ -95,14 +96,14 @@ export function checklistSystemTranslationToken(systemKey?: string | null): stri
}
const LEGACY_WORKSPACE_SECTIONS: Record<string, WorkspaceSectionKey> = {
match: "analysis",
analysis: "match",
cv: "application",
"cover-letter": "application",
"job-details": "overview",
checklist: "overview",
documents: "overview",
timeline: "overview",
communication: "overview",
portfolio: "overview",
notes: "cover-letter",
checklist: "tasks",
communication: "timeline",
portfolio: "documents",
notes: "tasks",
};
/** Preserve old shared/bookmarked workspace links while keeping one clear primary navigation. */
@@ -111,6 +112,15 @@ export const workspaceSection = (value: string | null): WorkspaceSectionKey => {
return WORKSPACE_SECTIONS.some((section) => section.key === value) ? value as WorkspaceSectionKey : "overview";
};
/** Legacy links select their original content, even when unrelated sub metadata is present. */
export function workspaceSubsection(section: string | null, sub: string | null): string {
if (section === "cv") return "cv";
if (section === "cover-letter") return "letter";
if (section === "communication") return "correspondence";
if (workspaceSection(section) === "application") return ["cv", "letter", "answers", "submission"].includes(sub ?? "") ? sub! : "cv";
return sub === "correspondence" ? "correspondence" : "activity";
}
export const applicationWorkspaceApi = {
overview: (jobId: number) =>
api.get<WorkspaceOverview>(`/jobapplications/${jobId}/workspace`).then((r) => r.data),