fix(frontend): keep candidate progress beside forms

This commit is contained in:
TakuyaYagam1 committed 2026-10-11 22:56:02 +03:00
1 parent e4be4a3956
commit 6dd5a0d54a
10 files changed
+81 -28

No files matched your search

@@ -133,6 +133,14 @@ test("shows the populated specialization catalog on desktop and mobile", async (
).toHaveCount(1);
await specialization.selectOption("backend");
await expect(page.getByText(/Проверка опубликована для уровней:/)).toBeVisible();
const progress = page.getByRole("region", { name: "Профиль, анкета и тест", exact: true });
const answers = page.getByRole("region", { name: "Ответы кандидата", exact: true });
await expect(progress).toBeVisible();
await expect(answers).toBeVisible();
const desktopProgress = await progress.boundingBox();
const desktopAnswers = await answers.boundingBox();
if (!desktopProgress || !desktopAnswers) throw new Error("Candidate sections must be visible");
expect(desktopProgress.x + desktopProgress.width).toBeLessThanOrEqual(desktopAnswers.x);
await page.screenshot({
path: testInfo.outputPath("questionnaire-catalog-desktop.png"),
fullPage: true,
@@ -140,6 +148,10 @@ test("shows the populated specialization catalog on desktop and mobile", async (
await page.setViewportSize({ width: 390, height: 844 });
await expect(specialization).toBeVisible();
const mobileProgress = await progress.boundingBox();
const mobileAnswers = await answers.boundingBox();
if (!mobileProgress || !mobileAnswers) throw new Error("Candidate sections must be visible");
expect(mobileProgress.y + mobileProgress.height).toBeLessThanOrEqual(mobileAnswers.y);
await page.screenshot({
path: testInfo.outputPath("questionnaire-catalog-mobile.png"),
fullPage: true,
@@ -7,7 +7,7 @@
min-width: 0;
}
@media (width >= 64rem) {
@media (width >= 80rem) {
.layout {
grid-template-columns: minmax(0, 1fr) 20rem;
}
@@ -44,7 +44,10 @@ import {
useAssessmentQuestionnaire,
} from "../../../entities/assessment";
import { newIdempotencyKey } from "../../../features/answer-assessment";
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
import {
CandidateJourneyLayout,
CandidateJourneyProgress,
} from "../../../widgets/candidate-next-step";
import {
SignalNoticeDialog,
SignalNoticeSummary,
@@ -490,9 +493,14 @@ export function AssessmentPage() {
lead="Выберите доступную проверку. Уровень из анкеты - это ваша самооценка; результат определяет только сервер после прохождения."
width="wide"
>
<CandidateJourneyProgress />
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
<div className={styles.layout}>
<Card as="section" tone="panel" labelledBy="assessment-full-title" className={styles.main}>
<Card
as="section"
tone="panel"
labelledBy="assessment-full-title"
className={styles.main}
>
<header className={styles["block-header"]}>
<p className={styles.kicker}>Полная проверка</p>
<h2 id="assessment-full-title" className={styles["block-title"]}>
@@ -596,7 +604,9 @@ export function AssessmentPage() {
) : grade.status === "available" ? (
<Button
isBusy={createBusy}
disabled={!taskLanguageReady || pendingCreate?.body.kind === "demo_express"}
disabled={
!taskLanguageReady || pendingCreate?.body.kind === "demo_express"
}
onClick={() => {
if (taskLanguageReady) handleStartReal();
}}
@@ -675,6 +685,7 @@ export function AssessmentPage() {
</Card>
</aside>
</div>
</CandidateJourneyLayout>
<SignalNoticeDialog {...signalNotice.dialog} />
</Page>
);
@@ -1,15 +0,0 @@
.summary {
display: grid;
gap: var(--space-5);
align-items: start;
}
.summary > * {
min-width: 0;
}
@media (width >= 64rem) {
.summary {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}
}
@@ -1,8 +1,10 @@
import { EditProfile } from "../../../features/edit-profile";
import { Page } from "../../../shared/ui";
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
import {
CandidateJourneyLayout,
CandidateJourneyProgress,
} from "../../../widgets/candidate-next-step";
import { CandidateProfilePreview } from "../../../widgets/candidate-profile-preview";
import styles from "./profile-page.module.css";
export function ProfilePage() {
return (
@@ -11,11 +13,10 @@ export function ProfilePage() {
lead="Управляйте своими сведениями и проверяйте, какие данные подтверждены оценкой."
width="wide"
>
<div className={styles.summary}>
<CandidateJourneyProgress />
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
<CandidateProfilePreview />
</div>
<EditProfile />
</CandidateJourneyLayout>
</Page>
);
}
@@ -1,6 +1,9 @@
import { FillQuestionnaire } from "../../../features/fill-questionnaire";
import { Page } from "../../../shared/ui";
import { CandidateJourneyProgress } from "../../../widgets/candidate-next-step";
import {
CandidateJourneyLayout,
CandidateJourneyProgress,
} from "../../../widgets/candidate-next-step";
export function QuestionnairePage() {
return (
@@ -9,8 +12,9 @@ export function QuestionnairePage() {
lead="Укажите специализации и условия поиска. Самооценка не становится подтвержденной категорией."
width="wide"
>
<CandidateJourneyProgress />
<CandidateJourneyLayout progress={<CandidateJourneyProgress />}>
<FillQuestionnaire />
</CandidateJourneyLayout>
</Page>
);
}
@@ -1,2 +1,3 @@
export { CandidateNextStep } from "./ui/candidate-next-step";
export { CandidateJourneyProgress } from "./ui/candidate-journey-progress";
export { CandidateJourneyLayout } from "./ui/candidate-journey-layout";
@@ -0,0 +1,22 @@
.layout {
display: grid;
gap: var(--space-5);
align-items: start;
min-width: 0;
}
.progress,
.content {
min-width: 0;
}
.content {
display: grid;
gap: var(--space-5);
}
@media (width >= 64rem) {
.layout {
grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
}
}
@@ -0,0 +1,17 @@
import type { ReactNode } from "react";
import styles from "./candidate-journey-layout.module.css";
export function CandidateJourneyLayout({
progress,
children,
}: {
progress: ReactNode;
children: ReactNode;
}) {
return (
<div className={styles.layout}>
<aside className={styles.progress}>{progress}</aside>
<div className={styles.content}>{children}</div>
</div>
);
}
@@ -70,7 +70,7 @@ export function CandidateJourneyProgress() {
: 2;
return (
<Card as="section" tone="panel" labelledBy="candidate-journey-progress-title">
<Card as="section" tone="raised" labelledBy="candidate-journey-progress-title">
<h2 id="candidate-journey-progress-title" className={styles.title}>
Профиль, анкета и тест
</h2>