Skip to content

feat: scaffold CompanyManagement.PaySchedule with PayScheduleOverview - #2746

Open
mariechatfield wants to merge 4 commits into
mainfrom
feat/marie/sdk-1292-pay-schedule-overview
Open

mariechatfield wants to merge 4 commits into
mainfrom
feat/marie/sdk-1292-pay-schedule-overview

Conversation

@mariechatfield

@mariechatfield mariechatfield commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Scaffolds the new CompanyManagement.PaySchedule component (single-schedule variant), gated behind the new managePaySchedules unstable feature flag
  • PayScheduleOverview shows Name, Frequency, and (opt-in via enableAutoPilot) AutoPilot status as individually-divided rows, each with its own scoped Edit action; Manage (opt-in via enableMultipleSchedules) sits in the header. Layout matches the tech spec's reference screenshot.
  • Schedule Edit reuses the existing onboarding PayScheduleForm. Manage and AutoPilot Edit currently fire events (paySchedule/management/manageAssignment, paySchedule/management/autoPilotEdit) without transitioning anywhere — those land in the follow-up PayScheduleAssignment/AutoPilotDialog tickets.
  • Picks the active schedule (not just the first) when a company has more than one, to handle a company that previously had enableMultipleSchedules on.
  • All new public surface is tagged @alpha (not @public) since this is one slice of a larger epic — full TSDoc lands when it graduates.
  • Wires the new namespace into the sdk-app dev harness (registry, prop-analysis script, default props) so it's previewable.
Screenshot 2026-09-10 at 2 51 57 PM Screenshot 2026-09-10 at 2 52 28 PM

Test plan

  • npm run test -- --run src/components/Company/PaySchedule/management — 10/10 passing
  • npx tsc --noEmit — clean
  • npx eslint on changed files — clean
  • npm run build — clean
  • Verified live in the SDK Dev App against the tech spec's reference screenshot (single-schedule layout, both toggles on/off)
  • Storybook stories added for PayScheduleOverviewPresentation (Default, AutoPilot enabled/disabled, single-schedule-only, loading)

🤖 Generated with Claude Code

mariechatfield and others added 2 commits September 10, 2026 14:48
…ScheduleOverview

Adds the new CompanyManagement namespace behind the managePaySchedules
unstable feature flag, per SDK-1292. PayScheduleOverview shows a single
pay schedule's name, frequency, and (opt-in) AutoPilot status, reusing
the existing PayScheduleForm for editing. Manage and AutoPilot Edit are
wired to emit events but don't transition anywhere yet — that lands in
follow-up tickets for PayScheduleAssignment and AutoPilotDialog.

Also wires the new namespace into the sdk-app dev harness (registry,
prop-analysis script, default props) so it's previewable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment on lines +62 to +64
// PayScheduleEditFormContextual reuses the onboarding PayScheduleForm, whose translations
// live under its own namespace and are otherwise never loaded from this flow.
useI18n('Company.PaySchedule')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it makes sense to use the onboarding version of pay schedule form as-is, but for now I think this is fine. I suspect we'll want to make a management-focused variant with its own copy soon

@mariechatfield
mariechatfield marked this pull request as ready for review September 11, 2026 16:11
@mariechatfield
mariechatfield requested a review from a team as a code owner September 11, 2026 16:11
<div className={styles.rows}>
<Row
label={t('labels.name')}
value={schedule.customName ?? schedule.name}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Quick one — schedule.name is actually the hourly/salaried/department field in the API model, not a name, and customName looks like it's basically always set. Is the ?? schedule.name fallback doing anything here, or can we just drop it?

/>
}
>
{schedule ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What happens if schedules comes back empty? Looks like schedule would be undefined and we'd show Loading forever instead of an actual empty state. Is that reachable in practice, or worth handling explicitly?

label={t('autoPilot.label')}
value={schedule.autoPayroll ? t('autoPilot.enabled') : t('autoPilot.disabled')}
action={
<Components.Button variant="secondary" onClick={onEditAutoPilot}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the Name row and AutoPilot row both just say "Edit," would it be worth giving each button its own aria-label so screen readers can tell them apart?

Comment thread src/shared/constants.ts
PAY_SCHEDULE_DELETED: 'paySchedule/deleted',
PAY_SCHEDULE_DONE: 'paySchedule/done',
PAY_SCHEDULE_MANAGE_ASSIGNMENT: 'paySchedule/management/manageAssignment',
AUTO_PILOT_EDIT: 'paySchedule/management/autoPilotEdit',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small one — should this be PAY_SCHEDULE_AUTO_PILOT_EDIT to match the PAY_SCHEDULE_* naming everything else in this object uses?

enableAutoPilot={enableAutoPilot}
enableMultipleSchedules={enableMultipleSchedules}
onEditSchedule={() => {
onEvent(componentEvents.PAY_SCHEDULE_UPDATE, { uuid: schedule?.uuid })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it safe to pass schedule?.uuid here long-term? It's optional on this side but the reducer expects a required uuid string — wondering if it's worth guarding so this can't fire before schedule exists.

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