Skip to content

Comments

feat(CoCreationForm): add daterange question type#3397

Draft
Rogermax wants to merge 1 commit intomainfrom
fct-cocreation-daterange-question
Draft

feat(CoCreationForm): add daterange question type#3397
Rogermax wants to merge 1 commit intomainfrom
fct-cocreation-daterange-question

Conversation

@Rogermax
Copy link
Contributor

@Rogermax Rogermax commented Feb 10, 2026

Summary

  • Adds new daterange question type to CoCreationForm
  • Uses F0DatePicker with range granularity for selecting from/to dates
  • Edit mode: date picker shown as readonly (non-interactive preview)
  • Answer mode: full date range picker for selecting start and end dates
  • Includes Storybook stories for edit mode, answer mode, and pre-filled values
Screen.Recording.2026-02-10.at.16.54.10.mov

Changes

New files

  • DateRangeQuestion/index.tsx — component using F0DatePicker with range granularity
  • DateRangeQuestion/types.ts — TypeScript types (DateRangeValue = { from: Date, to: Date })
  • DateRangeQuestion/index.stories.tsx — 3 stories (edit, answer, with pre-filled value)

Modified files

  • types.ts — added daterange to QuestionType, QuestionElement, OnChangeQuestionParams
  • Question/index.tsx — added switch case for daterange
  • constants.ts — added to the "Add question" menu with Calendar icon
  • lib.ts — added default params and registered in DEFAULT_QUESTION_TYPES
  • i18n-provider-defaults.ts — added dateRange translation key

Test plan

  • Check Storybook stories under CoCreationForm/DateRangeQuestion
  • Verify edit mode shows readonly date picker
  • Verify answer mode allows selecting a date range (from/to)
  • Verify daterange type appears in the "Add question" menu
  • TypeScript compiles cleanly (pnpm tsc)

🤖 Generated with Claude Code

Add new "daterange" question type to CoCreationForm using F0DatePicker
with range granularity. In edit mode, the picker is shown as readonly.
In answer mode, users can select a from/to date range.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added feat react Changes affect packages/react labels Feb 10, 2026
@github-actions
Copy link
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions
Copy link
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-3397 to install the package

Use pnpm i github:factorialco/f0#e3a7ae9297a92a1c40dfe27d7abb1b439a9dca39 to install this specific commit

@github-actions
Copy link
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 37.3% 6603 / 17698
🔵 Statements 36.71% 6744 / 18368
🔵 Functions 27.89% 1400 / 5018
🔵 Branches 26.48% 3678 / 13888
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/lib/providers/i18n/i18n-provider-defaults.ts 100% 100% 100% 100%
packages/react/src/sds/CoCreationForm/constants.ts 0% 100% 0% 0% 16-67
packages/react/src/sds/CoCreationForm/lib.ts 0% 0% 0% 0% 5-130
packages/react/src/sds/CoCreationForm/types.ts 100% 100% 100% 100%
packages/react/src/sds/CoCreationForm/DateRangeQuestion/index.tsx 0% 0% 0% 0% 12-62
packages/react/src/sds/CoCreationForm/DateRangeQuestion/types.ts 100% 100% 100% 100%
packages/react/src/sds/CoCreationForm/Question/index.tsx 0% 0% 0% 0% 23-42
Generated in workflow #10777 for commit b66dc62 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant