Files
lincodex/frontend
..
2026-10-05 14:23:31 +03:00
2026-10-05 14:23:31 +03:00
2026-10-05 14:23:31 +03:00
2026-10-05 14:23:31 +03:00
2026-10-05 14:23:31 +03:00

Frontend

Русский | English

A React and TypeScript SPA built with Vite and organized using FSD. Registration, email confirmation, sign-in, consent settings, the candidate profile and questionnaire, candidate assessment, company profiles, employer needs, and support cases use the API. A manual assessment request creates a support case and displays its current state; the screen does not present it as an assessment result. The result history and result page use the API. Candidate search, the employer's read of an anonymous card, and sending an invitation from a search result use the API. The candidate reads incoming invitations, accepts them with a choice of contacts, and declines them; the company's invitation list remains a placeholder.

  • src/app/ starts the application: the route tree (router/), the query client (providers/), global styles, and the route error page.
  • src/pages/ holds public pages, sign-in and registration, candidate profile and questionnaire, assessment results, company and employer needs pages, candidate search, the invitation to a candidate, the candidate's incoming invitations, support cases, technical status, and remaining placeholders.
  • src/widgets/ holds shells: public-shell, candidate-shell, employer-shell, the result history widget assessment-history, the search result widget match-list, the invitation preview invitation-preview, and the technical system-status widget.
  • src/entities/ holds entity models, including need (see Need entity), company, and invitation; src/features/ holds user actions and forms.
  • src/shared/ui/ holds design tokens, fonts, the wordmark, and primitives; src/shared/config/ holds route paths; src/shared/api/ holds the API client with generated endpoints, Zod schemas, and MSW mocks.
  • codegen/orval.config.ts configures generation from the shared OpenAPI contract; codegen/mock-patterns.ts is the step after Orval that fixes MSW mocks of strings with a pattern (see API client generation).
  • scripts/ checks FSD boundaries and Orval compatibility with the OpenAPI 3.2 fixture.
  • e2e/ holds Playwright specs and playwright.config.ts configures them; they run only against a Compose stack.

From the repository root, make -C frontend dev starts development and make -C frontend check runs checks and builds the app. In Docker, Nginx serves the built files using configuration from deploy/nginx/.

Routes

Group Paths Shell
Public /, /login, /register, /verify-email, /support, /status PublicShell
Candidate /candidate with onboarding, profile, questionnaire, assessment, results, results/:attemptId, invitations, invitations/:invitationId, privacy, support/cases, support/cases/new, support/cases/manual-assessment, and support/cases/:caseId CandidateShell
Employer /employer redirects to /employer/company; /employer/company, /employer/needs, /employer/needs/new, /employer/needs/:needId, /employer/candidates, /employer/invitations/new, /employer/support/cases, /employer/support/cases/new, /employer/support/cases/:caseId EmployerShell

Each group has its own not-found page. Paths are defined once in shared/config/paths.ts. The router uses React Router data APIs (createBrowserRouter): a route-level error boundary, loader redirects, and later lazy code splitting for cabinets. Loaders do not fetch data; server data belongs to TanStack Query. Cabinet boundaries read the current session and direct guests to sign-in. /support sends a signed-in user to the support area for their account or to sign-in. Need pages pass organization_id in the query string, but the client checks the current owner directory and the server authorizes every request.

/status is a service page: it checks /api/v1/healthz and is linked from the public footer only. It is not a product readiness indicator. In development mode the same page shows a gallery of states built from local fixtures (an error with retry, loading, empty, forbidden, saving, trust levels); production builds do not include it.

Server data

Generated Orval hooks call the shared same-origin apiRequest client, so the QueryClient has no default query function. Defaults in app/providers/query-client.ts:

  • retries: up to two, only for no response (status 0) and 5xx except 501; 4xx and invalid_response fail at once;
  • staleTime of 30 s; window focus does not refetch, and screens that need fresh data opt in per query;
  • automatic mutation retries are disabled; company creation retries through an explicit action with the same body and Idempotency-Key.

Candidate profile

entities/candidate holds the complete profile draft model and converts it to CandidateProfileUpdate. features/edit-profile owns the fields and saving, while pages/profile owns the page. Server data stays in React Query; contacts and drafts are not written to localStorage or sessionStorage.

The form goes in steps (Stepper): contacts, roles with the self-assessment and the confirmed categories, experience with the confirmation of parallel periods, skills, terms, and review with saving. The server takes the whole profile with expected_version, so saving exists on the last step only. "Далее" validates the fields of the current step; a client or server error on save opens the step that owns the field. Inactive steps stay mounted with the hidden attribute: "Назад" keeps what was entered, and the links of fields to their hints and errors remain. A step change moves the focus to the step heading. A saved profile offers "К проверке и сохранению", and the review step leads to any step with "Изменить". A reload opens the first step with the server record; an unsaved draft is not restored.

The form preserves the provenance of untouched suggestions, displays overlapping employment periods, and requires explicit confirmation of parallel work. Confirmation is bound to the current indices and dates; reordering or changing periods requires another review. Confirmed categories are displayed separately and never enter the save body. A 412 version conflict preserves the draft and offers an explicit replacement with current data.

After saving, the form reloads the session and shows the account step returned by the server. Saving a profile does not complete the consent step; that transition is not implemented yet. Independent profile editing works without ML, a file, or FSP.

Candidate questionnaire

pages/questionnaire reads the specialization catalog and the current candidate's private answers through Orval. The draft stays in component state, saved answers stay in React Query, and reload restores the server record. The form offers one or two specializations, self-assessed grades, currently available task languages, stack, experience, and work formats. A specialization without a published bank is marked in development and can be saved without FSP.

The questionnaire goes in steps: directions (one or two specializations and the assessment availability from the catalog), level and experience for each chosen specialization (self-assessment, task language, stack, experience), work format, and review with saving. The step rules are the same as in the profile: one whole save with expected_version on the last step, "Далее" validates the current step, a server error opens its step, steps stay mounted but hidden, the focus goes to the step heading, and a reload opens the first step.

A 412 conflict retains the draft and offers explicit reload or replacement against the latest read version. Session errors hide private answers; responses from a previous account cannot repopulate the cache. Onboarding links follow the step returned by the server. /candidate/questionnaire is the destination for the saved questionnaire step.

Candidate home

/candidate opens at every saved onboarding step and does not redirect: the pages/candidate-home page shows the saved account step (onboarding_step of the current session) and leads to the next action. The "Next step" block (widgets/candidate-next-step) and its selection logic (entities/candidate, buildCandidateJourney) use only server answers: the profile version (GET /me/profile; version 0 means the profile was never saved), the questionnaire (GET /me/questionnaire), and the assessment availability with the confirmed grade (GET /me/assessment-availability). The rules apply in order: a confirmed category leads to the result and visibility settings; an empty profile leads to the profile form; an empty questionnaire leads to the questionnaire; an active attempt leads to resuming it; otherwise the test is next. The saved step is shown only: the server advances it when the profile or the questionnaire is saved from the matching step, so a saved profile can sit behind the earlier "Consents" step, and the presence of saved data decides between the profile, the questionnaire, and the test. Linking an FSP ID and ML extraction are not needed on this path and are never shown as an error or a missing condition.

The declared level and the confirmed category are always shown apart, per specialization: the declared one comes from the questionnaire self_assessed_grade and is labeled as self-assessment, the confirmed one only from the availability confirmed_grade. The client does not derive a category from scores, thresholds, or the target grade. The page also shows the latest result (GET /me/assessment-results?limit=1, restated by assessmentResultSummary, with links to the breakdown and the history) and the profile visibility (GET /me/privacy: card open or closed with the reason, whether the category is shown, search status) with a link to /candidate/privacy.

Every block has loading, error with retry, forbidden (401 and 403 without retry), and empty states. The three reads that the next step depends on form one state: if any of them fails, an error with retry appears instead of a step guessed from partial data. The result and the visibility are independent, so their failure does not hide the next step. Query keys contain the account id, data does not outlive the screen (gcTime: 0) and is read again on every open and on returning to the tab, so a page refresh shows the current API state. Signing in again still opens the saved-step page (getOnboardingDestination), not the home. That page (/candidate/onboarding, the "Consents" step) shows the account steps (consents, profile, questionnaire, and test) with a Stepper, the current step, and its action.

Candidate assessment

/candidate/assessment reads availability and creates attempts through the API; /candidate/assessment/:attemptId resumes an attempt, submits answers, and finalizes it through server commands. Real assessment requires current C3 consent. The express test (demo_express) is shown as "Экспресс-тест" (express test) and does not award a qualification score or confirmed category. The attempt screen displays the server result with the same component as the result page and links to it (see Candidate results). Only the server assigns a category; the client calculates neither scores nor grades.

The attempt screen focuses on the item: a strip above it names the attempt and shows the progress of answered items, the time left until the server deadline expires_at in mono (a timer element that is not announced every second; color and a label mark the last minute), and the save state of the answer (a polite status message). Keys 1-9 choose an option, and Enter on an option sends the answer.

The Idempotency-Key of the express start is kept in the tab's sessionStorage per account until the run is finished or expired, and for 24 hours at most. When a new start gets 409 state_conflict, the page repeats the start with the key of the active run, and the server returns the stored 201 with that attempt: an unfinished demonstration continues after a reload. The key of a start with an unknown outcome (no response, 5xx) is kept and repeated as well. Without a key (another browser, a closed tab, blocked storage), the screen explains that the demonstration ends by itself within 5 minutes of its start.

Before a real attempt starts, the screen shows a dialog that lists the signals. The browser records tab or window switches, copy, paste and cut, and fullscreen exits; the server measures the answer time per item, a change of network address during the attempt, parallel sessions, and the match of answer digests with other candidates' answers. The dialog states that image, sound, and clipboard contents are not collected, that addresses and session tokens are not stored (only one-way keyed digests), and that browser events are stored only while the C3 consent is current. The attempt cannot start without confirmation: closing the dialog or pressing Escape starts nothing. The confirmation is stored on the server (/me/assessment-signal-notice) for the text version, so a reload or a new browser does not ask again; the same dialog opens when an older attempt that was created without the confirmation is resumed. It is a record of being informed, not a consent: C3 stays separate.

During a real attempt, features/assessment-signals collects the disclosed signals: focus loss with its duration, copy, paste and cut with a size only, and fullscreen exit. The listeners are passive, block nothing, and show nothing. Events go in batches (every 10 seconds, when the tab is hidden, or at 20 queued events), and each batch keeps one Idempotency-Key across retries. When the page is closed (pagehide) or the collector unmounts, what remains is sent in one last request with keepalive, so closing the tab does not lose the last seconds of events; the result of that request is not awaited and not retried. A network failure never affects answer submission: a failed batch is sent again with the same key and body after a growing pause and is dropped after the attempt limit. A server refusal (no C3, finished attempt) stops collection. The demonstration run collects no signals.

Clipboard contents and typed text are never read into a signal or sent. The paste size comes from the paste event: file sizes (File.size) plus the UTF-8 length of the plain-text item of clipboardData; the string lives in one local variable during the count and is not kept. The Clipboard API (navigator.clipboard) is not used. The copy and cut size is the selection length in UTF-16 code units taken from the field offsets without reading its value; when the active field has no numeric offsets the size is zero and the page selection is not read. It is an approximate size, not an exact byte count. The answer time per item is measured by the server and not sent by the client. Event timestamps are moved to server time: the client remembers the difference between the device clock and the Date header of API responses, because the server rejects a whole batch when a timestamp is more than five minutes from its own clock. Durations use the device clock and do not depend on that difference. Browser signals are easy to forge and false positives are possible, so they are only a hint for a review.

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 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:

  • the category comes from category_decision, not from the target grade; the decision date, the method and its limitation, the "provisional" status for uncalibrated, the basic score, the method limitations, the practice, and the time (which does not affect the decision) are shown;
  • an adaptive result shows θ, SE, the 95% interval, P_G, and the strength with the values the server returned (decimal comma, two to three digits, no recalculation); when uncertainty, strength, or the score is null, the rows are omitted and no zeros are substituted, and an adaptive attempt without an estimate gets a note; for demo_basic the screen says that no percentile, ability estimate, or P_G is calculated;
  • a failed attempt shows the attempt result separately from the previous category, which stays in force; next steps come from next_steps in the server order under an "as of the decision" heading: the date comes from available_at ("Available from ..."), null means the step was available immediately at the decision, and the checks page shows the current availability;
  • an offer to accept a lower grade (accept_lower_grade) is plain text only: the category does not change without a separate candidate command, and the interface has no such command yet;
  • an express result is captioned "Экспресс-тест без грейда" (express test without a grade), shows no category or estimate, and leads to the full assessment; a prepared full attempt appears as a separate history record. A confirmed category looks the same for every decision basis: the interface prints no demo marks and no calibration status, and the values stay in the API response.

Privacy settings

pages/privacy (/candidate/privacy) shows separate visibility settings. No action enables another: consent, publication, search status, and hiding an organization are saved by their own requests, each with its own version and its own saving state.

  • Consents (features/consent-management): C1-C5 are granted and revoked separately, with the text and version shown before a grant. The block of each purpose has an anchor that the "Go to the C2 consent" button moves focus to.
  • Publication (features/profile-visibility): step 1 shows whether C2 is active from the complete active consent history; an unknown or partly loaded state is not treated as consent, and saving stays unavailable. The step button only moves focus to the C2 block and grants nothing. The card state and fields are chosen next, and the publication is saved by a separate action (SetMyPublication, expected_version in the body). A 412 conflict keeps the draft on screen and offers an explicit reload of the current settings; a failed save does not reset the draft. Revoking C2 closes the card, and a new C2 does not reopen it.
  • Closure explanation: from closed_reason the screen says that future reads are closed at once, that a new C2 does not reopen the card by itself, and that a former company needs a new invitation and a new C4 to read contacts. The same words appear after revoking C2, hiding an organization, unhiding it, and republishing: an earlier contact access is not restored. Hiding does not change the C4 record in the consent ledger, so next to the C4 of a hidden company a note says that the record does not bring contact access back.
  • Search status (SetMySearchStatus) is its own request and its own text. It does not change the publication and grants no consent.
  • Employer preview (EmployerCardPreview from entities/candidate-view) is built only from the GET /me/privacy/preview response. The preview alias is separate from organization aliases. Confirmed categories and self-assessment are shown apart; each specialization has its own "Grade confirmed" or "Grade not confirmed" status (the Russian labels are "Грейд подтвержден" and "Грейд не подтвержден"), told apart by the shape of the mark and by text, not by color. A candidate without a confirmed grade sees the declared level (or "Level not specified") and the not-confirmed status for each specialization separately; a confirmed Backend is not carried over to a network specialization. The evidence block shows the skill, grade, confirmation level, year, and basis (synthetic_demo is shown as "Результат теста", a test result; calibration is not shown in the interface). A closed card is shown as an empty state. The preview creates no access record and ignores organization filters.
  • Hiding organizations: the hide button is offered only for organizations in the candidate's own access history (the server answers 404 for the rest), and only after the list of hidden organizations is fully loaded. Unhiding does not restore contact access.
  • Histories: the settings history and the card access history are paginated; a partial page is never presented as complete. An access record shows the kind of access, the time, and the organization when the server names it (otherwise "Organization is not disclosed"); it carries no employees, queries, filters, or search position. An empty history and a load error are separate states.
  • A link to request a manual assessment stays below.

The employer's card read and the search are described in Candidate search. The effect of hiding or a revoked C2 on a search is not yet checked from the employer's browser: the end-to-end suite does not repeat it on the employer side.

Company profile

pages/company selects a company from the paginated active memberships of the current account. Only an owner may read or edit its profile. The form keeps its draft in memory, displays the server verification level without a promotion action, and builds its preview only from candidate_card.

Creation uses one idempotency key for retries of the same body after a lost response. A 412 version conflict preserves the draft; the user explicitly loads current data, reviews the reapplied changes, and saves again. Background refresh does not reset the draft. A 401/403/404 response hides the profile and clears its cached query, then reloads the company directory. This complements server membership checks rather than replacing them.

Employer needs

/employer/needs shows a paginated list of organizations where the current account has an active owner membership and their needs. /employer/needs/new?organization_id=... creates a need, and /employer/needs/:needId?organization_id=... edits one. A URL or cached response grants no access: the client checks the current session and owner directory, and the server checks membership for every request. Cached data is scoped to the account and organization; a response from a prior session cannot populate the new cache. A 401/403/404 removes the organization's private queries.

The editor draft stays in memory. Fields and skills extracted from the source remain suggestions with provenance until the user confirms, edits, or deletes them. Unknown values are not replaced with defaults. Readiness questions appear next to missing fields; recommendation status and categories come from the API, with no fabricated results. If a create response is uncertain, retry sends the unchanged body with the same idempotency key. A 412 conflict retains the draft, offers the latest version, and requires review of reapplied changes before another save.

The form has five steps (the Stepper component): role and grade, skills, tasks and domain, work conditions, and review and save (features/edit-need/model/steps.ts). Inactive steps stay mounted and hidden with the hidden attribute, so going back or forward loses no draft; focus moves to the heading of the new step. Enter in a field moves to the next step, and only the last step saves. The title is required: step 1 does not let the employer leave without it, and step 4 does not let them leave with an incomplete range. A server field error opens the step of the first one and focuses the field. Beside the form (below it under 1200 px) sits a live summary of the need: the BACKEND · MIDDLE tag, stack tags, the range in mono, the number of unconfirmed suggestions, and, for a saved need, the categories and versions. A saved need has a "К проверке и сохранению" button on steps 1-4. The grade and the tax basis are chosen with a segmented control (SegmentedControl) and the work format with checkbox chips; an unknown grade is its own "Не указан" option, not a default.

Need entity

entities/need converts the generated DTOs of the need contract (Need, NeedCreate, NeedUpdate) to a form model and back. It is pure functions without React and without its own store; server data stays in the TanStack Query cache. Need pages and forms live in pages/needs, pages/need-editor, and features/edit-need.

  • fromTransport builds a draft from a Need. Each requirement field is an explicit state: unknown without a value, extracted as a stored suggestion with its provenance and quote, and confirmed as a confirmed value. An unknown field never becomes an empty string, an empty list, or a default value; a skill outside the taxonomy keeps taxonomy_code: null. Data that breaks the rule "value and source are null exactly when unknown" is rejected with NeedTransportError.
  • toUpdateBody(need, draft) sends only the fields whose request value changed, plus the expected_version of the read version. An untouched suggestion is not sent; when its field or list is sent for another reason, it goes with status extracted. A cleared field is sent as null, an emptied list as [], and an untouched list is absent.
  • toCreateBody(draft) always sends the title and leaves out unknown fields and empty lists, so the server extracts them from source_text.
  • The edit functions (confirmField, setFieldValue, clearField, confirmSkill, moveSkill, and others) keep the invariants: only an untouched suggestion has status extracted, an edited value becomes confirmed, and moving a skill between lists does not confirm it.
  • validateNeedCreate and validateNeedUpdate check the body with the generated Zod schemas and tie the problems to form fields. The server checks cross-field rules (the salary width, a repeated skill), and needFormFieldOf maps its pointer to a form field.

The tests take their fixtures from the named contract examples in api/core/openapi.bundle.yml and check every body with the generated NeedCreate and NeedUpdate schemas.

/employer/candidates (pages/matches) searches through POST /organizations/{org_id}/matches (SearchOrganizationMatches). The server model is in the architecture and the contract in the API.

  • Access. Only the active owner of a company can search. The organization comes from organization_id, and the owner's company list is read on every visit (as on the needs page). Without the right the page shows "Нужны права владельца компании"; 401 and 403 show the forbidden state, 404 shows the error "Потребность или компания не найдены", and other failures show a message with a retry. A 429, if one arrives, shows its Retry-After.
  • Runs only on an action. The page and a reload never search: the result lives in a component mutation and is not stored. Above the "Найти кандидатов" button the form says that a search spends card view quota: each newly shown candidate counts as one view, and a candidate already shown in the current window is not charged again. A second press is ignored while a search runs.
  • Basis. "По потребности": the first 100 needs of the company, the requirements version comes from the GET of the need (requirements_version, not the general version), filters are added on top; the grade of the need is not a filter, and the form says so under the picker. The "Подобрать кандидатов" link on a need opens the search with that need chosen. "По всем профилям": a request with filters only, and each specialization of a candidate arrives as its own entry.
  • Filters (features/filter-matches): specialization, confirmed grade, confirmation status, the grade the candidate declared, card technologies (all required), work format (one common format is enough), and salary expectation compatibility. The declared and the confirmed grade are separate fields with separate labels, and the hint under the declared one says it is not a confirmation. The form sends exactly the filters that are on and relaxes nothing: a contradictory pair (for example "not confirmed" with a confirmed grade) is sent as it is and gives an empty result. If the form changes after a result, a note above the result says that it is out of date; the result does not refresh by itself.
  • Result (widgets/match-list). The heading "Результат поиска" takes focus after a search. Below it come the basis and the current filters: for a search over all profiles these are the normalized filters of the response, and for a need search the response does not repeat them, so the sent filters are shown. Then the three groups in a fixed order: "Подтвержденные", "Близкие варианты", "Грейд не подтвержден". An empty group stays with the line "В этой группе записей нет.". The truncated flag is explained by "Показана часть выдачи; квота просмотров или предел группы" with no number. An empty result is explained separately: the filters stay on, the ones the employer can change are listed, and nothing is relaxed automatically.
  • Specializations. An entry is one candidate under one specialization, so one alias can stand in two groups (confirmed in Backend, not confirmed in Networks). When the result holds more than one specialization a view switch appears ("Все специализации", then each one): it hides the entries of the other specializations, recomputes nothing, and carries no confirmation across. The alias is shortened for display (entities/match/model/views.ts); the full value is used only by requests and the invitation link.
  • Entry (entities/match). It shows the specialization, the status "Грейд подтвержден: X" or "Грейд не подтвержден" (by icon shape and text), the confirmed category with its strength on a line apart from the grade the candidate declared, the safe card context (technologies, experience, formats, expectations), and the server's explanation of sources: every evidence_summary row with the state "Подтверждено", "Подтверждено частично", "Только заявлено кандидатом", or "Пробел: подтверждения нет". A null context value is printed as "Нет значения в карточке", because the contract does not say whether it is hidden or absent. The entry has no contact, no real identifier, and no reason why a grade is unconfirmed.
  • The explanation opens with a button that carries aria-expanded. It is built only from the components of the response: Fit, Cov, Dom, Sem, the percentile, V, Fr, Rsp, and the final score S appear exactly as they arrived, with no rounding beyond six decimals. A neutral value (unknown_flags) is labelled "Нейтральное значение, не измерено" with its reason (ml_unavailable, cohort_below_30, percentile_not_computed, and others). A null percentile is printed as "Нет значения" and no number is invented. A zero competition value is called "не штраф". An entry without a confirmed grade has only Fit and Cov: the server computes no S, percentile, or category for it, and the screen draws none. Unknowns outside the scores (experience, formats, expectations, the assessment result) are listed under "Что неизвестно" with a note that they are not an absence of ability.
  • Opening a card. The "Открыть карточку" button reads GET /organizations/{org_id}/candidate-cards/{handle} and, when the card has categories, the evidence section as well; the server refuses the section for a card without categories, so the request is not sent. Reads are neither retried automatically nor cached after the panel leaves the screen (gcTime: 0, no refetch on focus), because every read is an entry in the candidate's access history. A closed panel stays mounted, and opening it again does not read the card again. A 429 shows "Квота просмотров карточек исчерпана" and the time from Retry-After; when the server named none, no time is invented. A 404 replaces every hidden case with one text and names no reason.
  • Invitation. Every entry has a "Пригласить" button, an unconfirmed one included. It leads to /employer/invitations/new with organization_id, candidate_handle, specialization, and, for a need search, need_id (see Invitation to a candidate). The alias is scoped to the organization and is not a candidate identifier.
  • Layout. The form sits above the result at every width: the basis of the search (a segmented control with "По потребности" and "По всем профилям"), the selects, a row of filter chips (technologies, format, salary compatibility; an applied chip is blue with a check mark), and the action; the result takes the full width. From 768 px an entry is a content column and an action column ("Пригласить", the explanation, the card); at 360 px the actions and the facts fold into one column. The "Почему в подборке" block is set in mono on a nested surface: the sign "+" (confirmed), "+/-" (partial), "?" (declared), "-" (gap) repeats the state word. A technology chip that the search asked for carries a dot and hidden text "совпадает с условием поиска". Every action works from the keyboard, focus is visible, and status is carried by text and shape, not by color.

Checks. Unit tests cover parsing and labels (entities/match), the request built from a draft (features/filter-matches), and the result markup (widgets/match-list). The Playwright suite e2e/match-search.spec.ts has two groups. The first runs on the real backend (it needs the mail and company fixtures): five synthetic candidates publish the same card with declared Backend and Networks grades, and the owner searches and checks the groups, the Backend/Networks switch for one alias, Fit and Cov against the response, a card read, an explained empty result for an impossible filter, no repeated search after a reload, and 360 px. The second group answers from a stub and covers what the stand cannot produce: the order of three groups with a confirmed Backend and unconfirmed Networks for one alias, neutral values and reasons, truncated, a 429 with Retry-After, a 404 card, errors, rights, and a need search. Confirmed groups are not checked on the real backend: a card is served only to a group of at least five identical cards, and a confirmed category on the stand needs each of them to pass an assessment. A real exhausted quota and hiding or revoking C2 from the employer's browser are not checked either.

Invitation to a candidate

/employer/invitations/new (pages/invitation-compose) opens from the "Пригласить" button of a search result. The candidate is named only by the alias of the entry (candidate_handle, shortened on screen); an address without an alias offers to go to the search. The contract is in the API.

  • Access. As with the search, only the active owner of the company in organization_id can use the screen: the company list is read on every visit, and a member with another role gets no send button ("Нужны права владельца компании"). The server checks the role itself and answers 403; the form shows it as lost access.
  • Form (features/send-invitation). The fields follow InvitationTerms and nothing more: the role, the specialization (from the search entry), the grade, the offer type, the tasks (one per line), the team, the technologies, the work formats and the place of work, the channel with an optional note, the range in rubles with an explicit basis (net or gross), the four package conditions, and a response period of 3, 7, or 14 days. Each package condition is chosen explicitly: "Предусмотрено" with a description or "Не предусмотрено"; nothing is preselected. For a need search the form is prefilled only with the confirmed requirements of the need, and the draft refers to its requirements_version.
  • Checks before a request. The client repeats the contract rules: required fields and lengths, a range in whole rubles with a step of 1000, a lower bound below the upper one, and a width from 10% to 40% of the midpoint (entities/invitation/model/salary-range.ts), a place of work for office and hybrid, and a technology repeated in another letter case. With an incomplete range, no communication method, or an unanswered package condition nothing is sent. Issues are listed in a focused summary at the top of the form and bound to their fields with aria-invalid and aria-describedby.
  • The server decides. RFC 9457 errors from errors[].pointer are mapped to form fields (fieldOfPointer, for example /terms/salary/salary_to, /terms/communication_method, /terms/package/training); server text is not shown. /candidate_handle and /need give a general message without the reason.
  • Steps. The form runs in four steps (Stepper): terms, package and response period, preview, send. "Далее" on the first step checks only its fields; "К предпросмотру" checks the whole form. An error opens the step of the first field in trouble and focuses the issue list above the step. The offer type, the grade, the tax basis, the package conditions, and the response period are segmented controls, and the work format is chips. Enter in a field moves to the next step, and only the last step sends.
  • Preview (widgets/invitation-preview). "К предпросмотру" checks the form and shows the company card from candidate_card (GET /organizations/{org_id}) and every term as the candidate will see them; focus moves to the heading of the step. The preview is rebuilt each time the step opens, sends nothing, and creates no draft.
  • Sending. "Отправить приглашение" runs a command of three operations (features/send-invitation/model/send-command.ts): CreateOrganizationInvitation with an Idempotency-Key, UpdateOrganizationInvitation with expected_version when the terms of a saved draft changed, then SendOrganizationInvitation with its own Idempotency-Key. The create key is bound to the request body and the send key to the draft and its version; both are kept until the command completes, so a click after a lost response, a 5xx, or 409 idempotency_in_progress repeats the same key. A click while the command runs starts nothing. After 412 the form reads the draft again and applies its terms on the next send. Responses are checked with the generated Zod schema.
  • Result. After a successful send the screen shows the state "Доставлено", the delivery moment and the response deadline from the server response (response_deadline_at, in UTC), the terms version, the salary indicator, and the sent terms; focus moves to the heading. Once a draft exists its invitation_id is written to the address: a reload reopens an unsent draft for sending or a sent invitation with its stored deadline.

Checks. Unit tests cover the range rules (entities/invitation), draft validation and pointer mapping, the send command over MSW (keys, a retry after a lost create and a lost send response, 400 with fields, a draft update, 412), and the preview and page markup (owner access, an empty address). The Playwright suite e2e/invitation-compose.spec.ts runs on the real backend in make -C deploy test-e2e-registration: five synthetic candidates publish the same card, the owner finds them with a search, opens the invitation from the result, fills [100000; 140000] net and a package step by step, and checks the preview against every term; without the communication method the form does not leave the terms step, a field error shows, no request is sent, and the candidates' inboxes stay empty. Then the send is slowed down and its first response lost, a second click during the request starts nothing, and the retry uses the same key; the result is one invitation in one inbox (GET /me/invitations) with the deadline the screen shows, also after a reload. A 403 for a recruiter is not checked in the browser, since the stand cannot grant that role; the screen for a non-owner role is covered by a unit test.

Candidate incoming invitations

/candidate/invitations (pages/candidate-invitations) shows the incoming invitations: a cursor-paged list from GET /me/invitations, newest first, which records no view. /candidate/invitations/:invitationId opens one invitation. The contract is in the API.

  • Reading and viewing. The screen reads the invitation with GET /me/invitations/{id} and records the view once per opening (POST .../view with the CSRF token, without an Idempotency-Key). Reading changes nothing; the view moves delivered to viewed and keeps the deadline. A view answer replaces the shown invitation only when its version is newer.
  • Terms. The company, the role, the tasks, the team, the technologies, the format and place of work, the salary range with its basis (net or gross), the package, and the communication method are shown as in the company's preview (widgets/invitation-preview, the shared InvitationTermsArticle). The response deadline is shown with a UTC label (formatServerMoment). The candidate sees no company card: the contract returns only the name.
  • Deadline. Whether an answer is open depends on the invitation state and the server clock (useServerNow, corrected by the Date header). After the deadline the answers are closed, even before the server applies the expiry on a later read.
  • Acceptance with C4 (features/accept-contact-consent). The contact kinds come from contact_consent.available_fields: full name, email, phone, and Telegram, as far as the profile holds them. Nothing is preselected, and each kind is chosen separately. The button becomes available after at least one kind and a separate confirmation of the text are chosen. The consent text is shown as plain text, unchanged, with its paragraphs from the server response. Without a contact in the profile the invitation cannot be accepted, and the screen offers to open the profile.
  • Decline (features/respond-invitation). A reason is chosen explicitly; none is preselected. The comment is optional for every reason, including "Другая причина", up to 500 characters. Only the candidate reads the comment.
  • Outdated terms. A 412 version_conflict (and a 409 with the same code) reads the invitation again: the new version of the terms is shown, the choice of contacts and the confirmation are reset, and the screen asks for a new confirmation. A 409 state_conflict shows the final state instead of a retry. A repeated answer after a lost response or a 5xx uses the same Idempotency-Key (entities/invitation/model/command-key.ts); a changed choice gets a new key.
  • Outcome. After acceptance the screen shows only the contact kinds that the grant covers (contact_grant.fields) and whether the company can read them now: with readable false and the reason visibility, it explains that the card must be published and open to the company. After a decline it shows the reason and the candidate's own comment. The company gets contacts only through its own endpoint, and only the kinds of the grant.

Checks. Unit tests cover the deadline and view rules, the classification of answer errors (entities/invitation/model/response-failure.ts), the idempotency keys, the form draft states, and the adapters and answer commands over MSW (CSRF and Idempotency-Key headers, schema checks of the response, a retry after a lost response), and the markup of the list, the screen, the forms, and the terms block. The Playwright suite e2e/candidate-invitations.spec.ts runs on the real backend in make -C deploy test-e2e-registration: five synthetic candidates publish a card, the owner finds them with a search, and three invitations are sent through the API. At 360 px a candidate accepts with the email only: the candidate's API shows one grant, and the company's contact endpoint returns the email and no phone. Outdated terms are checked with an intercepted response: the backend does not implement the raise of the upper salary bound after sending (RaiseOrganizationInvitationSalary), so the 412 and the new version of the terms come from a route, while the absence of a grant is checked on the real backend. A decline with "Другая причина" and no comment, followed by a reload, is checked on the real backend: the declined state stays after the reload, and the company's contact endpoint answers 404.

Support and manual assessment

/candidate/support/cases and /employer/support/cases show each account's paginated support history. Their .../new routes create a case and .../:caseId routes show its status and history. The public /support route directs a signed-in user to their cabinet. The form draft stays in memory, and a retry of an unchanged request reuses its idempotency key. Support history is scoped to the current account and cleared when the session changes or the server denies access.

Candidates can use /candidate/support/cases/manual-assessment to submit a support request with a specialization, desired grade, and description. This does not run automatic assessment, create an attempt, change C3, or grant a confirmed grade. The hint under the specialization and grade selectors uses the published grades from the catalog but does not promise a rubric: the server pins the version on submission. The case page displays the status and rubric version returned by the server and, for null, says plainly that no published rubric existed when the request was made; the client does not create an outcome. After a page reload the form loses its idempotency key, and a repeated submission while a manual assessment of the same specialization is open receives 409; the page explains this and links to "My cases" without creating a second request.

Notifications

features/notifications shows the inbox of the signed-in account at /candidate/notifications and /employer/notifications, and each shell links to it. NotificationInbox takes a scope: the candidate cabinet, or one organization. OrganizationNotificationInbox chooses the organization from the active memberships of the account (the organization_id parameter keeps the choice across reloads) and renders the inbox. The list is read on every visit and window focus and is never kept (gcTime: 0); the cached pages are keyed by account and cabinet and dropped when the account or the session changes or when the server refuses access.

The server resolves the text of every item from its current source. An item without content stays in the list with a generic line, and the client never shows an earlier copy. The read state is a word ("Не прочитано" or "Прочитано"), not only a style. "Отметить прочитанным" is a native button, sends the CSRF token of the session (read at call time; after a 403 it reads the session again and retries once, and only a 401 or 404 counts as lost access), and moves focus to the heading of the item after it succeeds, with a polite status message. A content link opens only if it is a same-origin path inside the cabinet that shows it. States: loading, empty, error with retry, forbidden (including a membership that ended), and "Показать еще" for the next page. Component tests render markup in Node; the keyboard path and the delivery of a real event are checked by frontend/e2e/notifications.spec.ts.

API client generation

make -C frontend generate runs Orval with codegen/orval.config.ts and then codegen/mock-patterns.ts. For a string with a pattern, Orval 8.40 writes faker.helpers.fromRegExp(pattern) into the MSW mock: faker prints the ^ and $ anchors and (?:...) groups as plain text, and Orval ignores minLength and maxLength when a pattern is present. The second step replaces such calls with fakeFromPattern(pattern, {minLength, maxLength}) from src/shared/api/mock-pattern.ts. It takes the length bounds from the OpenAPI contract by the name of the property that holds the call and by the pattern. The step fails when a call has an unexpected form, when the contract has no such property with that pattern, or when the matching schemas disagree on the length bounds. It leaves its own output unchanged, so generation is reproducible and make check-generated stays stable. Enums in the mocks are written as literals (enumGenerationType: "union"): Object.values of a zod.enum returns Zod internals, not the values.

fakeFromPattern parses a regular expression subset (characters, escapes, classes, groups, alternatives, quantifiers, and ^ and $ at the ends), picks a length within the pattern and the bounds, and builds the string with the faker generator, so the same seed gives the same data. Every value is checked with new RegExp(pattern, "u") and the length bounds; a pattern outside the subset (for example, a lookahead or a back reference) or unreachable bounds throw an error.

src/shared/api/mock-validity.test.ts calls every get*ResponseMock factory in endpoints/*/*.msw.ts with 25 faker seeds and checks the result with the generated Zod response schema. Orval's Zod schemas do not check uniqueItems, so the test does not cover that constraint; the response arrays with uniqueItems currently hold enum values, and the mock picks them with faker.helpers.arrayElements without repeats.

Tokens and theme

Tokens live in shared/ui/theme/tokens.css: palette, semantic colors, type scale, spacing in 4px steps, radii, lines, focus ring, content widths, header height, and motion. The values come from the graphite system in docs/other/design/DESIGN.md, except the FSP brand mark: the product is Lincodex. Breakpoints are fixed in media queries: 360px minimum, phone layout below 700px (43.75rem), 768px tablet (48rem), 1024px desktop navigation (64rem), and 1280px verified wide layout.

One dark theme ships, and it is the default (color-scheme: dark). The canvas is #1B1C21, cards and fields are #202129, elevated surfaces are #2D2E37, boundaries are 1px hairlines, and only popover menus have a shadow. The single action color is blue #402FFF on primary buttons; on hover the button inverts to #EDEDED with blue text. Text, links, the focus ring, and selected markers use the readable accent #9A92FF: #402FFF itself reaches only 2.49 on graphite. Red #EC1D35 is used only for 6-8px dots, error text is #FF5A6A, and success is #3CCF7E. The current section, the selected tab, and the current step are shown by inversion: a light capsule with graphite text. Every button, field, tab, and tag is a capsule; cards have a 24px radius, panels 32px, surfaces nested in a card 16px, and small objects 6px.

app/ui/styles.css sets the base: headings use JetBrains Mono, paragraphs and meta use Inter. Native inputs and selects get the dark capsule and padding from element rules with specificity (0,1,2): above a module rule such as .field input, below a state rule such as .field input[aria-invalid]. Field borders stay in the screen modules and use --color-border-strong.

WCAG 2.2 contrast of the pairs in use:

Foreground Background Ratio Use
#EDEDED #1B1C21 14.53 Text on the canvas
#EDEDED #202129 13.68 Text on cards, fields, and the header
#EDEDED #2D2E37 11.52 Secondary button, menus
#FFFFFF #1B1C21 17.01 Headings on the canvas
#FFFFFF #202129 16.02 Card titles, salary
#FFFFFF #414246 10.04 Secondary button on hover
#9B9C9E #1B1C21 6.19 Secondary text, meta
#9B9C9E #202129 5.83 Secondary text on cards
#9B9C9E #2D2E37 4.91 Secondary text on the elevated surface
#878994 #1B1C21 4.89 Hints and placeholders
#878994 #202129 4.60 Field placeholders
#9A92FF #1B1C21 6.42 Links, accent labels, focus ring
#9A92FF #202129 6.05 Links and focus ring on cards
#9A92FF #2D2E37 5.09 Links and focus in menus
#FFFFFF #402FFF 6.84 Primary button, skip link
#FFFFFF #3324E0 8.50 Primary button when pressed
#402FFF #EDEDED 5.85 Primary button on hover (inversion)
#1B1C21 #EDEDED 14.53 Current section, selected tab, current step
#1B1C21 #9A92FF 6.42 Completed step, text selection
#FF5A6A #1B1C21 5.61 Error text
#FF5A6A #202129 5.28 Error text on cards
#FF5A6A #30212A 5.03 Text in the error box (8% red over #202129)
#9B9C9E #30212A 5.55 Description in the error box
#FF5A6A #41202B 4.72 Error tag (16% red over #202129)
#3CCF7E #1B1C21 8.44 Success: saved, confirmed
#3CCF7E #243935 6.09 Success tag (14% green over #202129)
#9A92FF #262450 5.47 Accent tag (18% blue over #202129)
#9B9C9E #2C2D35 4.98 Neutral tag (6% paper over #202129)
#EDEDED #34353D 10.41 Stack tag (10% paper over #202129)
#EDEDED #1F2028 13.85 Text on the glass header (88% #202129 over the canvas)
#73757F #1B1C21 3.71 Field and control boundary (needs 3:1)
#73757F #202129 3.49 Field boundary on cards (needs 3:1)
#1B1C21 #FF5A6A 5.61 Glyph inside the error mark (graphic)
#EC1D35 #1B1C21 3.88 Red "new" or "live" dot (graphic, meaning repeated in text)

Excluded pairs: #402FFF is not used as text or as a boundary on graphite (2.49 on #1B1C21); #878994 and #FF5A6A are not used on #2D2E37 (3.88 and 4.44); the #2D2E37 hairline on the canvas (1.26) is decorative only and is never the only boundary of a control.

Fonts and wordmark

All fonts are self-hosted (font-src 'self') under the SIL Open Font License 1.1; licenses, authors, sources, and character ranges are in shared/ui/theme/fonts/ (SOURCES.txt). The files are subsets made with fontTools:

  • JetBrains Mono 2.304 from the brandbook archive, variable weight 400-700: headings, navigation, buttons, labels, numbers, grades, stack, codes; Mono adds tabular figures.
  • Inter 4.001 from the Google Fonts repository, variable weight 400-700, Latin and Cyrillic: paragraphs, meta, form fields.
  • Unbounded 1.701 from the Google Fonts repository, Latin only, used only for the wordmark. The wide geometric face sets the name apart from interface text, which is set in mono and Inter.

The interface has no FSP logo. Wordmark is the text mark "Lincodex" with a terminal caret in the action color; the link's accessible name is exactly "Lincodex", the caret is decorative, and the cabinet name sits next to the link. The tab icon public/favicon.svg is an L with a caret on a blue square.

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; 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). 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.
  • CircuitTrace, Mono, VisuallyHidden, SkipLink, MainRegion.

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: 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.

Tests

Vitest runs in the Node environment with no DOM library. Routes are rendered through React Router's static handler and checked as HTML: shells, landmarks, the skip link, the active item, redirects, and not-found pages. State tests render components to markup; the query-error test runs the real QueryClient with the generated health operation and a stubbed fetch. Playwright checks clicks, input, and focus movement in real Chromium; Vitest does not substitute a browser environment.

Playwright specs in e2e/ run in a real Chromium against the built frontend and backend: make -C deploy test-e2e starts a throwaway Compose stack and runs them in the official Playwright image, so no browser is installed on the host. Vitest excludes e2e/; make -C frontend typecheck and lint cover the specs. Artifacts of the last run are in test-results/e2e/. Details: TESTING.md.

See the development guide.