feat(background-check): V1 two-paths redesign — Order / Attach / Exempt#2839
Merged
Conversation
…task surface Implements the V1 design from `design_handoff_background_check/SPEC.md`: the Background Check tab's empty state is now a unified task-oriented page where Order / Attach / Exempt are equal first-class decisions, instead of a marketing-style benefits grid followed by a separate form and upload UI. Page anatomy (top to bottom): status strip with credits + plan link → path picker (3 selectable cards) → contextual body (Order / Attach / Exempt form per selection, form state preserved across switches) → collapsible "What's verified in this check" scope panel. The path picker is a true radiogroup (role=radio, ArrowLeft/Right navigation, Space/Enter to select). Out-of-credits disables Send invite; missing PDF disables Attach report; missing reason disables Confirm exemption. Wiring: - Order → POST /v1/people/:id/background-check (existing endpoint) - Attach → POST /v1/people/:id/background-check/custom (existing) - Exempt → PATCH /v1/people/:id with backgroundCheckExempt + reason + justification (latter two are new; backend ignores until DTO is extended — flagged in PR description) Removed: BackgroundCheckMethodology, BackgroundCheckWizardParts (Overview / BackgroundCheckSummary / BillingCallout), BackgroundCheckDetailsForm, CustomBackgroundCheckUpload, PaymentMethodUpdateDialog, react-hook-form glue for the wizard, sessionStorage pending-request stash, and the 402 "out of credits → redirect to billing" flow (V1 just disables the button and exposes "Choose a plan →" in the status strip). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… screening" scope rows Per Lewis: remove both rows from the "What's verified in this check" panel. The summary count auto-updates from 6 to 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
3 issues found across 21 files
Confidence score: 3/5
- There is moderate merge risk: the keyboard arrow navigation logic in
apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/BackgroundCheckV1Page.tsxuses a hardcoded card id, which can cause incorrect focus/path movement after the first keypress and is user-facing. apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/backgroundCheckUtils.tsmay show wrong credit counts becausecomputeCreditscan select a non-background-check active subscription, creating data-display inaccuracies.- In
apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/EmployeeBackgroundCheck.tsx, sending untrimmedemployeeName/employeeEmailis a smaller but concrete correctness issue that can lead to avoidable API input problems. - Pay close attention to
apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/BackgroundCheckV1Page.tsx,apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/backgroundCheckUtils.ts, andapps/app/src/app/(app)/[orgId]/people/[employeeId]/components/EmployeeBackgroundCheck.tsx- they contain the navigation and data correctness fixes most likely to affect user behavior.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/BackgroundCheckV1Page.tsx">
<violation number="1" location="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/BackgroundCheckV1Page.tsx:69">
P2: Arrow-key path navigation is computed from a hardcoded card id, so keyboard navigation can misbehave after the first move. Compute relative navigation from `selectedPath` instead.</violation>
</file>
<file name="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/backgroundCheckUtils.ts">
<violation number="1" location="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/backgroundCheckUtils.ts:13">
P2: Filter `computeCredits` to background-check subscriptions; currently it can pick an unrelated active subscription and display incorrect credit counts.</violation>
</file>
<file name="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/EmployeeBackgroundCheck.tsx">
<violation number="1" location="apps/app/src/app/(app)/[orgId]/people/[employeeId]/components/EmployeeBackgroundCheck.tsx:122">
P2: Trim `employeeName` and `employeeEmail` before sending them to the API.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Avoids implying a third-party audited report (court records, criminal, civil) — we don't perform that scope. The check is end-to-end via our vendor, which is what the description now says. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r, trim payload Three correctness fixes flagged by cubic-dev-ai review: 1. Arrow-key path navigation: each PathCard's onNavigate was hardcoding its own path id. After the first arrow keypress, selection moved but DOM focus stayed on the original card, so subsequent presses computed the next path from the stale hardcoded id. Now navigateRelative reads selectedPath directly from state, so navigation tracks the current selection regardless of where focus lives. 2. computeCredits could pick a non-background-check active subscription (e.g. a pentest subscription) and display the wrong credit count. Now filters by getBillingSkuProductKey(skuKey) === 'background_check', matching how getBackgroundChecksRemaining already selects. 3. Send invite was POSTing employeeName / employeeEmail untrimmed. Now trims both before the request body — requesterNotes was already trimmed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 3.54.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the V1 design from
design_handoff_background_check/SPEC.md. The Background Check tab's empty state is now a unified task-oriented surface where Order a new check, Attach an existing report, and Mark as exempt are equal first-class decisions, replacing the previous marketing-style benefits grid + separate form + separate upload UI.Page anatomy
What changed
New components (one file per concern, all under 250 lines):
BackgroundCheckV1Page.tsxBackgroundCheckPathCard.tsxrole=radio, ArrowLeft/Right keyboard navigation, Space/Enter to selectBackgroundCheckStatusStrip.tsxBackgroundCheckScopePanel.tsxBackgroundCheckOrderForm.tsxBackgroundCheckAttachForm.tsxBackgroundCheckExemptForm.tsxBackgroundCheckFormHelpers.tsxLabelRow,FormFooterInfo,FormFooterRow(used by all three forms)BackgroundCheckNotices.tsxBackgroundCheckExemptToggle+BackgroundCheckNotice+BackgroundCheckDisabledNoticeBackgroundCheckAuditTimeline.tsxbackgroundCheckUtils.tsisValidEmail,computeCredits,buildAttachNotes,fileToBase64Removed (V1 supersedes):
BackgroundCheckMethodology.tsx— replaced by V1 scope panelBackgroundCheckWizardParts.tsx(OverviewStep,BackgroundCheckSummary,BillingCallout) — V1 has no separate overviewBackgroundCheckDetailsForm.tsx— replaced by Order formCustomBackgroundCheckUpload.tsx+.test.tsx— replaced by Attach formPaymentMethodUpdateDialog.tsx— V1 doesn't gate on stale payment methodsbackgroundCheckForm.ts(react-hook-form glue + sessionStorage pending-request stash) — V1 uses plainuseState, no pending-request persistenceEmployeeBackgroundCheck.tsx — completely rewired:
Wiring to existing APIs
POST /v1/people/:id/background-check(existing)POST /v1/people/:id/background-check/custom(existing; vendor + report date are stuffed intorequesterNotesuntil DTO is extended)PATCH /v1/people/:idwithbackgroundCheckExempt: true,backgroundCheckExemptReason,backgroundCheckExemptJustification— the latter two are new fields; backend currently ignores them. Follow-up: extendapps/api/src/people/dto/update-member.dto.tsto persist them in the audit log.Design fidelity
Tokens, copy, layout, spacing, radii, motion — all per
SPEC.md. Three off-token tinted colors (oklch(0.985 0.012 167),oklch(0.93 0.06 85),oklch(0.99 0.03 90)) used inline for selected card background and amber warning surface, per spec.Icon substitutions where the spec's Carbon name doesn't exist in
@carbon/icons-react— closest geometric match used:LightningBolt/Flash→FlashAttachmentAdd/Paste→AttachmentFingerprint/IdBadge→FingerprintRecognitionBriefcase→PortfolioVerification
audit-design-systemclean — no@trycompai/uiorlucide-react, noclassNameon DS components that reject itBackgroundCheckStatusView.test.tsxtests pass (no changes there)Relationship to PR #2836
This supersedes the marketing-forward methodology overview in PR #2836 (already merged). The V1 design is task-oriented and replaces that overview entirely. The completed-report banner from that PR has been preserved (inlined into
BackgroundCheckReport.tsx).Test plan
🤖 Generated with Claude Code
Summary by cubic
Redesigned the Background Check tab into a single, task‑first V1 flow where users can Order, Attach, or Mark as exempt. Replaces the wizard/marketing views, simplifies billing, improves keyboard navigation, and adds a report audit timeline; backend follow‑up still needed to persist exempt reason/justification.
New Features
POST /v1/people/:id/background-check(email validation; disabled when out of credits). Attach →POST /v1/people/:id/background-check/custom(vendor/date/file; button enables only with a file; vendor/date temporarily encoded inrequesterNotes). Exempt →PATCH /v1/people/:idwithbackgroundCheckExempt,backgroundCheckExemptReason,backgroundCheckExemptJustification(keeps the un‑exempt toggle).Bug Fixes
background_checksubscription to display accurate counts.employeeNameandemployeeEmailbeforePOST.Written for commit 800265a. Summary will update on new commits.