feat(frontend): edit projects and show semantic match evidence

This commit is contained in:
shira committed 2026-10-11 14:03:31 +03:00
1 parent 5a731c25b7
commit bc00d6901f
52 files changed
+2992 -111

No files matched your search

@@ -26,6 +26,7 @@ export const publishableCardFields = [
"experience",
"work_formats",
"salary_compatibility",
"projects",
] as const satisfies readonly CardField[];
export type PublishableCardField = (typeof publishableCardFields)[number];
@@ -144,8 +145,20 @@ export const cardFieldLabels: Readonly<Record<PublishableCardField, string>> = {
experience: "Общий опыт",
work_formats: "Форматы работы",
salary_compatibility: "Совместимость по зарплатным ожиданиям",
projects: "Проекты: название, описание и технологии",
};
/**
* What publishing the projects reveals. It is shown beside the choice, before
* the candidate makes it, and again in the card preview.
*/
export const projectsPublicationWarning = {
identify:
"Название и описание проектов пишете вы, и по ним вас могут узнать. Не публикуйте проект, если в тексте есть имя, контакт или название работодателя. Размер группы похожих кандидатов эти тексты не скрывает: карточка с проектами может быть единственной в своем роде.",
repository:
"Адрес репозитория и его владелец компаниям не показываются никогда. Они видят только отметку, что публичный репозиторий проекта найден.",
} as const;
export const specializationLabels = {
backend: "Backend",
frontend: "Frontend",
@@ -215,6 +228,13 @@ export type EvidencePresentation = {
basisLabel: string;
};
export type CardProjectPresentation = {
title: string;
description: string | null;
stack: readonly string[];
repositoryVerified: boolean;
};
export type CandidateViewPresentation = {
pseudonym: string;
categories: readonly CategoryPresentation[] | null;
@@ -223,6 +243,8 @@ export type CandidateViewPresentation = {
experience: string | null;
workFormats: readonly string[] | null;
salaryCompatibility: string | null;
/** Published projects in the candidate's order; null when the field is not published. */
projects: readonly CardProjectPresentation[] | null;
/**
* Supporting assessment facts as an organization reads them. Null while the
* card is closed; an empty list when no visible fact supports a category.
@@ -302,6 +324,13 @@ export function presentCandidatePreview(preview: CardPreview): CandidateViewPres
salaryCompatibility: card.salary_compatibility
? salaryCompatibilityLabels[card.salary_compatibility]
: null,
projects:
card.projects?.map((project) => ({
title: project.title,
description: project.description,
stack: [...project.stack],
repositoryVerified: project.repository_verified,
})) ?? null,
evidence: preview.evidence ? preview.evidence.items.map(evidencePresentation) : null,
};
}