diff --git a/apps/web/src/app/create/worksheets/addition/components/config-panel/RegroupingFrequencyPanel.tsx b/apps/web/src/app/create/worksheets/addition/components/config-panel/RegroupingFrequencyPanel.tsx new file mode 100644 index 00000000..197c16b2 --- /dev/null +++ b/apps/web/src/app/create/worksheets/addition/components/config-panel/RegroupingFrequencyPanel.tsx @@ -0,0 +1,168 @@ +'use client' + +import * as Slider from '@radix-ui/react-slider' +import { css } from '../../../../../../../styled-system/css' +import { stack } from '../../../../../../../styled-system/patterns' +import type { WorksheetFormState } from '../../types' + +export interface RegroupingFrequencyPanelProps { + formState: WorksheetFormState + onChange: (updates: Partial) => void + isDark?: boolean +} + +export function RegroupingFrequencyPanel({ + formState, + onChange, + isDark = false, +}: RegroupingFrequencyPanelProps) { + return ( +
+
+
+ Regrouping Frequency +
+ + {/* Current values display */} +
+
+ Both:{' '} + + {Math.round((formState.pAllStart || 0) * 100)}% + +
+
+ Any:{' '} + + {Math.round((formState.pAnyStart || 0.25) * 100)}% + +
+
+ + {/* Double-thumbed range slider */} + { + onChange({ + pAllStart: values[0] / 100, + pAnyStart: values[1] / 100, + }) + }} + min={0} + max={100} + step={5} + minStepsBetweenThumbs={0} + > + + + + + + + +
+ Regrouping difficulty at worksheet start (Both = all columns regroup, Any = at least one + column regroups) +
+
+
+ ) +} diff --git a/apps/web/src/app/create/worksheets/addition/components/config-panel/SmartModeControls.tsx b/apps/web/src/app/create/worksheets/addition/components/config-panel/SmartModeControls.tsx index f499615a..a23c5d17 100644 --- a/apps/web/src/app/create/worksheets/addition/components/config-panel/SmartModeControls.tsx +++ b/apps/web/src/app/create/worksheets/addition/components/config-panel/SmartModeControls.tsx @@ -25,6 +25,8 @@ import { } from '../../difficultyProfiles' import type { DisplayRules } from '../../displayRules' import { getScaffoldingSummary } from './utils' +import { RegroupingFrequencyPanel } from './RegroupingFrequencyPanel' +import { DigitRangeSection } from './DigitRangeSection' export interface SmartModeControlsProps { formState: WorksheetFormState @@ -74,22 +76,21 @@ export function SmartModeControls({ formState, onChange, isDark = false }: Smart } return ( -
-
+
+ {/* Digit Range */} + onChange({ digitRange })} + isDark={isDark} + /> + + {/* Difficulty Level */} +
+ + {/* Regrouping Frequency */} +
) }