Skip to content

feat(dashboard): show Pending badge for future-dated compensations on job card and table#1897

Merged
serikjensen merged 6 commits into
mainfrom
feat/sdk-901-pending-comp-badge-v2
May 22, 2026
Merged

feat(dashboard): show Pending badge for future-dated compensations on job card and table#1897
serikjensen merged 6 commits into
mainfrom
feat/sdk-901-pending-comp-badge-v2

Conversation

@serikjensen
Copy link
Copy Markdown
Member

@serikjensen serikjensen commented May 21, 2026

Summary

  • When a job has no current (on-or-before-today) compensation — i.e., it was created with a future effective date and hasn't started yet — display a Pending status badge instead of the existing change alert
  • Single-job card view (exempt or nonexempt with one job): adds a Status / Pending badge row below the effective date field
  • Multi-job table view: conditionally adds a visually-hidden-labeled Status column with a Pending badge for future-dated job rows; column is omitted entirely when all jobs have current compensations
  • Existing warning alert behavior is unchanged for jobs that already have an active compensation with a scheduled future update

How it works

`getPendingCompensationChanges` now carries an `isNewJob: boolean` field on each `PendingCompensationChange`. It is `true` when `baseline === null` (no current comp exists for the job), which maps to the existing `buildNewJobDetails` path. The view splits pending changes into two buckets — `newJobPendingChanges` (badge) and `updatePendingChanges` (alert) — and drives each UI surface independently.

Test plan

  • Unit tests for `isNewJob` flag in `getPendingCompensationChanges.test.ts` (update-only → false, new-job-only → true, stacked future comps → true on first / false on subsequent)
  • Integration tests in `Dashboard.test.tsx`:
    • Single exempt (salary) job with only future comp → Pending badge, no alert
    • Single nonexempt job with only future comp → Pending badge, no alert
    • Single job with current comp + future update → alert still shown, no badge
    • Multi-job table with a pending-new secondary job → Status column with Pending badge on that row only
    • Multi-job table with all current jobs → no Status column
    • Mixed: one job with comp update + one pending-new job → badge in table + inline alert for the update
Screenshot 2026-05-21 at 2 51 16 PM Screenshot 2026-05-21 at 2 43 57 PM

Made with Cursor

…job card and table

When a job has no current (on-or-before-today) compensation — i.e., the
job itself hasn't started yet — show a "Pending" status badge instead of
the existing warning alert. The alert remains for jobs that have an active
compensation with a scheduled future update.

- Add `isNewJob: boolean` to `PendingCompensationChange` (true when baseline
  is null, meaning the job's only comp is future-dated)
- Single-job card view (exempt or nonexempt): renders a Status / Pending
  badge row below start date; no alert for pending-new jobs
- Multi-job table view: conditionally adds a Status column with a Pending
  badge for future-dated jobs; column is hidden when all jobs are current
- Add i18n strings: `columns.status` and `pendingStatus`
- Unit tests for `isNewJob` flag in `getPendingCompensationChanges`
- Integration tests in Dashboard.test.tsx covering single-job badge,
  table column, no-column-when-all-current, and mixed badge+alert case

Co-authored-by: Cursor <cursoragent@cursor.com>
@serikjensen serikjensen requested a review from a team as a code owner May 21, 2026 20:52
@gusto-fresh-eyes
Copy link
Copy Markdown

gusto-fresh-eyes Bot commented May 21, 2026

Fresh Eyes Review

Found 1 issue in this PR.

Download findings.json — drag the file into Claude or use /add to propose fixes


Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews

krisxcrash and others added 2 commits May 21, 2026 16:53
Move duplicated Compensation/JobFixture types and helper functions
(buildEmployeeWithJobs, overrideEmployee, goToJobAndPayTab) to the
parent describe block so both 'Compensation pending changes' and
'Compensation pending badge' describe blocks share a single definition.
@serikjensen serikjensen enabled auto-merge (squash) May 22, 2026 01:27
…f employee endpoint

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +233 to +243
// vs "update" (existing comp with a scheduled future change).
// New-job changes get a Pending badge on the card/table row.
// Update changes get the existing warning alert treatment.
const newJobPendingChanges = pendingChanges.filter(c => c.isNewJob)
const updatePendingChanges = pendingChanges.filter(c => !c.isNewJob)

const pendingNewJobUuids = new Set(newJobPendingChanges.map(c => c.jobUuid))
const singleJobIsPendingNew = singleJob ? pendingNewJobUuids.has(singleJob.uuid) : false
const hasAnyPendingNewJobs = pendingNewJobUuids.size > 0

const hasPendingUpdates = updatePendingChanges.length > 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Minor | [fresh_eyes]: logic-errors-dataflow

When a new (not-yet-started) job has stacked future compensations, only the first comp gets isNewJob: true (baseline === null). Subsequent comps get isNewJob: false and flow into updatePendingChanges. In the single-job view this means both a 'Pending' badge AND an inline 'Compensation will change' alert would render simultaneously for the same job that hasn't started yet. The badge says the job is pending, while the alert warns about a future comp change — on a job with no current comp. This is a potential UX-confusing state, but more importantly the alert's content (referencing a future change relative to a 'current' comp that doesn't exist) may produce misleading text since nextChange would contain details diffed against a baseline that is the first future comp, not an actual active comp.


Please 👍🏽 👎🏽 if you found this useful. Generated by Fresh Eyes Reviewer. Get help in #ai-code-reviews

@serikjensen serikjensen merged commit 41031b4 into main May 22, 2026
24 of 25 checks passed
@serikjensen serikjensen deleted the feat/sdk-901-pending-comp-badge-v2 branch May 22, 2026 01:46
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.

3 participants