feat(frontend): simplify the candidate cabinet header
This commit is contained in:
1 parent
90ff71735a
commit
89932b8714
28 files changed
+1154
-179
No files matched your search
@@ -77,7 +77,7 @@ Clipboard contents and typed text are never read into a signal or sent. The past
|
||||
|
||||
## Candidate results
|
||||
|
||||
`/candidate/results` lists the completed real assessments of the current candidate (`GET /me/assessment-results`, 20 records per page; the cursor comes only from the server response and is never built on the client). `/candidate/results/:attemptId` opens one record by a direct URL. Both screens read data only for a confirmed candidate session: query keys include the account identifier and the session token, data does not outlive the screen (`gcTime: 0`) and is removed when the session changes or ends. A 401, 403, or 404 response shows an "unavailable" screen without data and does not reveal whether another candidate's result exists; the assessment cache is cleared only on 401, while a network or 5xx failure offers a retry and is not treated as lost access. A failed background refresh keeps the data that was already loaded and says so. Dates are shown in the browser time zone with its name. "Show more" moves the focus to the first new row and announces how many were loaded. Loading, empty history, and error states with retry exist. A failed attempt after a successful one, adaptive estimate values, retry dates, and missing-field cases are covered by unit contract fixtures because the stand cannot produce them; the e2e test checks the shape of the flow (a real result, the express run, ownership, sign-out; the interface has no sign-out control yet, so the session ends through the API). By contract, express tests are not part of the history; their result opens from the attempt screen or by a direct URL and is captioned "Экспресс-тест без грейда" (express test without a grade).
|
||||
`/candidate/results` lists the completed real assessments of the current candidate (`GET /me/assessment-results`, 20 records per page; the cursor comes only from the server response and is never built on the client). `/candidate/results/:attemptId` opens one record by a direct URL. Both screens read data only for a confirmed candidate session: query keys include the account identifier and the session token, data does not outlive the screen (`gcTime: 0`) and is removed when the session changes or ends. A 401, 403, or 404 response shows an "unavailable" screen without data and does not reveal whether another candidate's result exists; the assessment cache is cleared only on 401, while a network or 5xx failure offers a retry and is not treated as lost access. A failed background refresh keeps the data that was already loaded and says so. Dates are shown in the browser time zone with its name. "Show more" moves the focus to the first new row and announces how many were loaded. Loading, empty history, and error states with retry exist. A failed attempt after a successful one, adaptive estimate values, retry dates, and missing-field cases are covered by unit contract fixtures because the stand cannot produce them; the e2e test checks the shape of the flow (a real result, the express run, ownership, sign-out; the session ends through the API, not through the account menu, because the menu reloads the page). By contract, express tests are not part of the history; their result opens from the attempt screen or by a direct URL and is captioned "Экспресс-тест без грейда" (express test without a grade).
|
||||
|
||||
On the attempt screen only the phrase "Result received" is a live message; the record is ordinary content, and the focus moves to its heading. The shared `AssessmentResultView` component (`entities/assessment`) only restates the fields of the server response:
|
||||
|
||||
@@ -257,11 +257,11 @@ The interface has no FSP logo. `Wordmark` is the text mark "Lincodex" with a ter
|
||||
## Shared components
|
||||
|
||||
- `Page`, `Section`, `Stack`: page layout; `Page` owns the only `h1` and the document title. `Section` hangs on a circuit trace: a node at the heading and a line down the section.
|
||||
- `Button`, `ButtonLink` (variants `primary`, `secondary`, `quiet`), `TextLink`, `NavItem`: controls with text labels; `NavItem` marks the active section with `aria-current` and an inverted capsule.
|
||||
- `HeaderPlate`, `MenuButton`, `useMenuToggle`, `Wordmark`: the shell header: a floating glass plate, a menu button with `aria-expanded` (the menu closes after a navigation and on Escape, and focus returns to the button), and the wordmark.
|
||||
- `Button`, `ButtonLink` (variants `primary`, `secondary`, `quiet`), `TextLink`, `NavItem`: controls with text labels; `NavItem` marks the active section with `aria-current` and an inverted capsule; a shell can state the current state itself (`current`) for a section that stays active on the routes of its sub-sections.
|
||||
- `HeaderPlate`, `MenuButton`, `useMenuToggle`, `Wordmark`: the shell header: a floating glass plate, a menu button with `aria-expanded` (the menu closes after a navigation and on Escape, and focus returns to the button; with `dismissOutside` it also closes on a press or focus outside it), and the wordmark.
|
||||
- `Card` (`raised`, `inset`, `panel`), `Tag` (`neutral`, `grade`, `stack`, `accent`, `success`, `danger`), `AttentionDot`, `Notice`: containers, tags, and messages. The meaning is always given in text; color only repeats it.
|
||||
- `Stepper` and `buildSteps`: progress through a multi-step flow: a "Шаг N из M" line and a list with `aria-current="step"` and a text status for each step.
|
||||
- `Tabs` (WAI-ARIA tabs pattern, arrow keys, Home and End; inactive panels stay mounted with the hidden attribute, so form state survives) and `SegmentedControl` (a native radio group drawn as capsules).
|
||||
- `Tabs` (WAI-ARIA tabs pattern, arrow keys, Home and End; inactive panels stay mounted with the hidden attribute, so form state survives) and `SegmentedControl` (a native radio group drawn as capsules). `SectionSwitch` is a sub-section switch drawn as capsules but made of links to routes: it has no panels, so tabs do not fit.
|
||||
- `StatusView`, `LoadingState`, `EmptyState`, `ErrorState`, `ForbiddenState`, `SavingStatus`: screen states. Each state has its own shape and text; the empty state draws a circuit trace that ends at an open node. `ErrorState` shows the code, status, server text, and request ID as plain text and offers a retry. `Skeleton`: decorative placeholder lines while loading, always next to a loading message.
|
||||
- `QueryView`: maps a query result to loading, error, forbidden (401 and 403 without retry), empty, or data.
|
||||
- `TrustLevel`: an empty mark, ring, partial fill, or full mark with a visible label.
|
||||
@@ -269,7 +269,7 @@ The interface has no FSP logo. `Wordmark` is the text mark "Lincodex" with a ter
|
||||
|
||||
The steps of a long form (`form-steps.tsx`, `use-form-steps.ts`: a step panel whose heading takes the focus, "Назад" and "Далее" navigation, and a review block with "Изменить") are identical copies in `features/edit-profile` and `features/fill-questionnaire` for now; a shared version belongs in `shared/ui`.
|
||||
|
||||
Shells. Public: a floating plate with the wordmark and links; below 700px the links open from a "Меню" button; a footer links the technical status. Candidate (phone first): below 700px the sections form a scrolling bottom tab bar and the current tab scrolls to the middle; from 700px the tabs sit in the plate. When the tabs do not fit, the strip fades at the edge that hides more of them. The navigation comes before `main` in the document, so the keyboard order is the same at every width. Employer (desktop first): from 1024px a floating 240px sidebar, below that a plate with a "Меню" button.
|
||||
Shells. Public: a floating plate with the wordmark and links; below 700px the links open from a "Меню" button; a footer links the technical status. Candidate: the plate holds the wordmark, four sections (Главная, Профиль, Тест, Приглашения), a notifications bell, and an "Аккаунт" menu (Приватность, Поддержка, Выйти); there is no unread badge because the shell does not read notification data. The questionnaire belongs to "Профиль" and the results belong to "Тест": such a section stays current on the routes of its sub-sections (`aria-current="true"`, and `"page"` on the section page itself), and the sub-section pages show a `SectionSwitch` above the heading ("Профиль" and "Анкета", "Проверка" and "Результаты"), which the shell passes to the pages through `PageNavProvider`. Below 1024px the sections form a bottom bar of five items (the four sections and "Ещё"), the plate keeps the wordmark and the bell, and "Ещё" opens a sheet with notifications, privacy, support, and sign-out. Sign-out ends the session on the server and fully reloads the page on the sign-in screen, so no account data stays in memory; on failure the menu says that you are still signed in. The menu closes on Escape (focus returns to the button), after a navigation, and on a press or focus outside it. The navigation comes before `main` in the document, so the keyboard order is the same at every width. Employer (desktop first): from 1024px a floating 240px sidebar, below that a plate with a "Меню" button.
|
||||
|
||||
Accessibility: every shell starts with a skip link to `main`, has landmarks and a visible focus ring (2px `#9A92FF`, 2px offset), and moves focus to `main` after navigation. Animations respect `prefers-reduced-motion`.
|
||||
|
||||
|
||||
Reference in new issue
Block a user