From 4b667587f826ae68d81da7d7708d67b6362bfc51 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Mon, 10 Nov 2025 18:12:23 -0600 Subject: [PATCH] feat: move difficulty parameters into Smart mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Group difficulty configuration parameters inside Smart Difficulty mode: - Digit Range moved from always-visible to Smart mode - Regrouping Frequency moved from always-visible to Smart mode - These are difficulty tuning parameters, not general settings Changes: - Add DigitRangeSection to top of SmartModeControls - Add RegroupingFrequencyPanel to bottom of SmartModeControls - Extract RegroupingFrequencyPanel as standalone component - Remove both from ConfigPanel's always-visible section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../config-panel/RegroupingFrequencyPanel.tsx | 168 ++++++++++++++++++ .../config-panel/SmartModeControls.tsx | 28 +-- 2 files changed, 184 insertions(+), 12 deletions(-) create mode 100644 apps/web/src/app/create/worksheets/addition/components/config-panel/RegroupingFrequencyPanel.tsx 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 */} +
) }