Skip to content

Add a live cost-and-yield estimator panel to CreateCommitmentStepConfigure#1190

Open
greatest0fallt1me wants to merge 1 commit into
Commitlabs-Org:masterfrom
greatest0fallt1me:fix/issue-953
Open

Add a live cost-and-yield estimator panel to CreateCommitmentStepConfigure#1190
greatest0fallt1me wants to merge 1 commit into
Commitlabs-Org:masterfrom
greatest0fallt1me:fix/issue-953

Conversation

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Fixes #953

Summary

  • Adds CostYieldEstimator component (src/components/create/CostYieldEstimator.tsx) that reactively computes projected yield range, worst-case penalty, and platform fee from protocol constants as the user adjusts amount, duration, and max-loss inputs (debounced 300ms).
  • Integrates the panel into CreateCommitmentStepConfigure.tsx between AllocationConstraintsEditor and Advanced Risk Parameters.
  • Sources all fee/penalty values from /api/protocol/constants via fetchProtocolConstants() — no hardcoded constants.
  • Handles invalid/empty inputs by showing a placeholder without throwing.
  • Uses aria-live="polite" and aria-label for accessible screen-reader announcements.

Changes

  • src/components/create/CostYieldEstimator.tsx — new estimator component
  • src/components/create/CostYieldEstimator.test.tsx — tests covering rendering, interaction, edge cases, and constants sourcing (happy-dom + React Testing Library)
  • src/components/CreateCommitmentStepConfigure.tsx — imports and renders CostYieldEstimator
  • docs/COST_YIELD_ESTIMATOR.md — feature documentation with props/API, accessibility notes, edge-case table, and usage example

…epConfigure

Adds CostYieldEstimator component that reactively computes projected yield
range, worst-case penalty, and platform fee from protocol constants as the
user adjusts amount, duration, and max-loss inputs (debounced 300ms).
Includes tests and accessibility attributes (aria-live, aria-label).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize 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.

Add a live cost-and-yield estimator panel to CreateCommitmentStepConfigure

1 participant