Skip to content

feat: wire early exit modal to live preview#619

Closed
xx7412421-cloud wants to merge 10 commits into
Commitlabs-Org:masterfrom
xx7412421-cloud:grantfox-579-early-exit-live-preview
Closed

feat: wire early exit modal to live preview#619
xx7412421-cloud wants to merge 10 commits into
Commitlabs-Org:masterfrom
xx7412421-cloud:grantfox-579-early-exit-live-preview

Conversation

@xx7412421-cloud

Copy link
Copy Markdown
Contributor

Closes #579

Summary

  • Fetch live early-exit preview figures when the commitment early-exit modal opens.
  • Disable final confirmation while the preview is loading, then show live penalty/net refund values when available.
  • Keep preview failures non-blocking by showing an inline warning and falling back to the local estimate.
  • Add helper coverage for API-envelope parsing, 0% grace-period previews, and failed preview responses.

Validation

  • npm exec -- vitest run tests/components/CommitmentEarlyExitModal.test.tsx tests/components/earlyExitPreview.test.ts
  • npm exec -- eslint src/app/commitments/page.tsx src/components/CommitmentEarlyExitModal/CommitmentEarlyExitModal.tsx src/components/CommitmentEarlyExitModal/earlyExitPreview.ts tests/components/CommitmentEarlyExitModal.test.tsx tests/components/earlyExitPreview.test.ts
  • npm exec -- prettier --check src/components/CommitmentEarlyExitModal/earlyExitPreview.ts tests/components/earlyExitPreview.test.ts
  • git diff --check origin/master..HEAD

Full npm run test -- --run was also attempted, but the repository baseline still has unrelated failures outside this change, including duplicate declarations in backend modules, existing invalid JSX in CommitmentDetailsModal.tsx, missing @testing-library/user-event, jest is not defined in an existing Vitest file, and several tests missing DOM environment setup.

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

@xx7412421-cloud is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece

Copy link
Copy Markdown
Contributor

the early-exit live-preview wiring looks like solid work, but the same process applies — #579 isn't assigned to you. please get assigned first, then reopen; i'm closing as invalid until then. ping us on https://discord.gg/WV7tdYkJk if you want help claiming it.

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.

Wire CommitmentEarlyExitModal to the early-exit preview endpoint for live penalty figures

2 participants