Skip to content

Add commitment templates and presets to the create wizard select-type step#1194

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

Add commitment templates and presets to the create wizard select-type step#1194
greatest0fallt1me wants to merge 1 commit into
Commitlabs-Org:masterfrom
greatest0fallt1me:fix/issue-951

Conversation

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Fixes #951

Summary

  • Adds a CommitmentPreset type and COMMITMENT_PRESETS array in src/components/create/commitmentPresets.ts with three named presets (Conservative 90-day, Balanced 60-day, Aggressive 30-day)
  • Adds a keyboard-accessible preset picker (role="radiogroup" / role="radio") above the existing type cards in CreateCommitmentStepSelectType
  • Wires onApplyPreset callback in src/app/create/page.tsx to prefill durationDays and maxLossPercent state; all fields remain editable in the configure step
  • Adds tests in src/components/create/CreateTemplates.test.tsx covering rendering, interaction, keyboard activation, accessibility, scratch option, and data validity
  • Adds docs/CREATE_TEMPLATES.md documenting props, behavior, accessibility, and usage examples

Test plan

  • Preset buttons render and show labels/descriptions
  • Clicking a preset sets aria-checked=true on that preset and aria-checked=false on others
  • Configure step opens pre-populated with preset values after selecting a preset
  • All configure fields remain editable after preset prefill
  • Start from scratch option does not prefill any values
  • Keyboard: Enter and Space activate a preset
  • Continue button is disabled until a type is selected (either via preset or direct card click)
  • Draft persistence saves preset-prefilled values correctly

🤖 Generated with Claude Code

…t-type step

Adds a preset/template picker to CreateCommitmentStepSelectType that prefills
duration and max-loss in the configure step. Includes preset definitions,
accessible UI with radiogroup/radio roles, keyboard support, draft persistence
integration, tests (happy-dom + RTL), and CREATE_TEMPLATES.md documentation.

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 commitment templates and presets to the create wizard select-type step

1 participant