fix: stabilize mini skill card height and fix preview updates

**Issue 1: Buttons jumping around**
- Mini skill cards had variable height based on description text length
- Prev/Next buttons would shift position when switching skills

**Fix 1: Fixed height cards**
- Added `minHeight: '5.5rem'` to both addition and subtraction mini skill cards
- Buttons now stay in consistent position regardless of content

**Issue 2: Preview not updating on skill change**
- React Query cache wasn't invalidating when clicking prev/next buttons
- Query key was missing skill IDs for mastery+mixed mode

**Fix 2: Include skill IDs in query key**
- Added `currentAdditionSkillId`, `currentSubtractionSkillId`, `currentStepId` to query key
- Preview now regenerates when skills change in mastery mode

Files changed:
- `MasteryModePanel.tsx`: Fixed height for mini skill cards (5.5rem)
- `WorksheetPreview.tsx`: Added skill IDs to query key dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-10 14:12:59 -06:00
parent 113af870f5
commit 4a5294353e
2 changed files with 10 additions and 0 deletions

View File

@ -104,6 +104,10 @@ function PreviewContent({ formState, initialData, isDark = false }: WorksheetPre
formState.displayRules, // Smart mode: conditional scaffolding
formState.difficultyProfile, // Smart mode: difficulty preset
formState.manualPreset, // Manual mode: manual preset
// Mastery mode: skill IDs (CRITICAL for mastery+mixed mode)
formState.currentAdditionSkillId,
formState.currentSubtractionSkillId,
formState.currentStepId,
// Other settings that affect appearance
formState.name,
formState.pAnyStart,

View File

@ -287,6 +287,9 @@ export function MasteryModePanel({ formState, onChange, isDark = false }: Master
border: '1px solid',
borderColor: isDark ? 'gray.600' : 'gray.300',
backgroundColor: isDark ? 'gray.600' : 'white',
minHeight: '5.5rem',
display: 'flex',
flexDirection: 'column',
})}
>
<div
@ -429,6 +432,9 @@ export function MasteryModePanel({ formState, onChange, isDark = false }: Master
border: '1px solid',
borderColor: isDark ? 'gray.600' : 'gray.300',
backgroundColor: isDark ? 'gray.600' : 'white',
minHeight: '5.5rem',
display: 'flex',
flexDirection: 'column',
})}
>
<div