Skip to content

feat(onboarding): show job title eligibility statements for maybe and not eligible roles - #1508

Merged
gabrielseco merged 2 commits into
mainfrom
feat/onboarding-job-title-eligibility-statements
Oct 12, 2026
Merged

gabrielseco merged 2 commits into
mainfrom
feat/onboarding-job-title-eligibility-statements

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When the job title eligibility check on contract details returns needs_review or not_eligible, the Onboarding flow now shows a statement under Role description telling the partner what that means.

Why

Since #1413 the SDK runs the check and stores its result in additional_job_title_eligibility_check_result, but only yes_with_ack changes the UI (the risk acknowledgement). A no or maybe result showed nothing, so partners had no idea the role couldn't be hired, or was still uncertain.

Dragon already shows an error statement under role_description when the result is no (employer/contractDetails/jsfModify.jsx). The backend doesn't send a message for maybe yet, so we add one on the SDK side. Both messages are worded the same way and say "AI" rather than "Remote AI".

Verdict Result Severity Title Description
needs_review maybe info AI isn't sure if we can hire this role in {country} Complete the add employee process and we'll let you know as soon as we can if we can hire this role.
not_eligible no error AI determined we can't hire this role in {country} Based on the job title and role description entered, we can't hire this role. Update the role details to check again.

Other verdicts show nothing. Submit isn't blocked on no; the backend still decides, same as Dragon.

What changed

Toggle details
  • src/flows/Onboarding/utils.ts: adds getJobTitleEligibilityStatement(result, countryName), which returns a createStatementProperty for maybe and no. If there's no country name, the title says "in this country".
  • src/flows/Onboarding/hooks.tsx: when job_title_eligibility is enabled, role_description gets a calculateDynamicProperties that adds the statement. It goes through the same contract details custom-fields override as equity_compensation and daily_schedule, so it covers both the JSF v0 and v1 contract details. If an integrator already has a calculateDynamicProperties on role_description in their jsfModify, theirs still runs and the results are merged. The statement renders through components.statement, so partners can override how it looks.
  • OnboardingFlowJobTitleEligibility.test.tsx: 4 new tests, each run against the v0 and v1 schemas: maybe shows the info statement, no shows the error statement, eligible shows nothing, and a re-check switches the statement and then removes it once eligible. They fail without the hook change.

Public API: no type or signature changes. The new statements only show when the job_title_eligibility feature is on.

Screenshots

Open as a gallery: click a screenshot, then use the arrow keys.

Maybe needs review info statement
Maybe needs review info statement
No not eligible error statement
No not eligible error statement

Verified against the sandbox gateway with a seeded USA employment and the real AI check (example app, onboarding-basic demo): 100 lines of gibberish as the role description returned needs_review; a licensed, onsite surgical role returned not_eligible.

Related Resources

🤖 Generated with Claude Code


Note

Low Risk
UI-only messaging gated by an existing feature flag; submit behavior is unchanged and partner jsfModify hooks are preserved via merge.

Overview
Job title eligibility feedback on contract details — When job_title_eligibility is enabled, partners now see inline statements under Role description for uncertain or blocked roles, not only the existing risk-acknowledgement path.

getJobTitleEligibilityStatement maps stored check results maybe (needs_review) and no (not_eligible) to info and error statements (country-aware titles, “AI” wording aligned with Dragon). Eligible and other verdicts still show nothing.

Onboarding wires this through role_description’s calculateDynamicProperties in contract-details custom fields (JSF v0 and v1), merging with any partner jsfModify hook on that field. Tests cover info/error/no-message cases and statement updates when re-checks change the verdict.

Reviewed by Cursor Bugbot for commit 1ddb34e. Bugbot is set up for automated code reviews on this repo. Configure here.

… not eligible roles

When the job_title_eligibility check returns needs_review (maybe) or
not_eligible (no), render an info or error statement under
role_description on contract details, mirroring Dragon's ineligible
role message. The statement follows re-checks and is removed once the
role is eligible. Submit is not blocked; the backend still decides.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 230.33 kB 229.96 kB +364 B (+0.2%) 🔴
Total (raw) 641.55 kB 640.72 kB +828 B (+0.1%) 🔴
CSS (gzip) 21.94 kB 21.94 kB 0 B (0%) 🟢
CSS (raw) 114.43 kB 114.43 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 230.33 kB / 350 kB (65.8%)
  • ✅ Total raw: 641.55 kB / 850 kB (75.5%)
  • ✅ CSS gzipped: 21.94 kB / 25 kB (87.8%)

Largest Files (Top 5)

  1. index.esm-wIkXrqU6.js - 11.4 kB (0 B (0%))
  2. styles.css - 10.97 kB (0 B (0%))
  3. index.css - 10.97 kB (0 B (0%))
  4. internals-CQ6AEqzp.js - 6.12 kB (new)
  5. hooks-ClE1K2pu.js - 5.85 kB (new)
View All Files (291 total)
File Size (gzip) Change
index.esm-wIkXrqU6.js 11.4 kB 0 B (0%)
styles.css 10.97 kB 0 B (0%)
index.css 10.97 kB 0 B (0%)
internals-CQ6AEqzp.js 6.12 kB new
hooks-ClE1K2pu.js 5.85 kB new
sdk.gen-BRPiw4M1.js 5.58 kB 0 B (0%)
index.js 5.51 kB 0 B (0%)
flows/Onboarding/hooks.js 4.65 kB +121 B (+2.7%)
utils-CUgvJHl4.js 4.07 kB 0 B (0%)
FieldSetField-QbfQb5Lp.js 4.04 kB 0 B (0%)

✅ Bundle size check passed

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-6gtf863gc-remotecom.vercel.app
Latest Commit:1ddb34e

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-fbpe7lg85-remotecom.vercel.app
Latest Commit:1ddb34e

Deployed with vercel-action

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 89.81% 89.79% +0.02% 🟢
Statements 89.39% 89.37% +0.02% 🟢
Functions 88.39% 88.37% +0.01% 🟢
Branches 81.12% 81.13% 0% ⚪

Detailed Breakdown

Lines Coverage
  • Covered: 5342 / 5948
  • Coverage: 89.81%
  • Change: +0.02% (12 lines)
Statements Coverage
  • Covered: 5443 / 6089
  • Coverage: 89.39%
  • Change: +0.02% (12 statements)
Functions Coverage
  • Covered: 1423 / 1610
  • Coverage: 88.39%
  • Change: +0.01% (2 functions)
Branches Coverage
  • Covered: 3335 / 4111
  • Coverage: 81.12%
  • Change: 0% (8 branches)

✅ Coverage check passed

…e combined

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gabrielseco
gabrielseco merged commit 30009ed into main Oct 12, 2026
13 checks passed
@gabrielseco
gabrielseco deleted the feat/onboarding-job-title-eligibility-statements branch October 12, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants