All files / web/src/lib/curriculum skipped-parts.ts

91.3% Statements 21/23
100% Branches 0/0
0% Functions 0/1
91.3% Lines 21/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 242x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x      
import type { SkippedPart } from '@/db/schema/session-plans'
 
/**
 * Student-facing copy for a part the planner's readiness gates dropped. Shared by
 * the planner (its "nothing left to practise" error) and the start modal (the
 * skipped-part note while a plan generates), so both paths read the same.
 */
export const PART_NAMES: Record<SkippedPart['type'], string> = {
  abacus: 'Abacus',
  visualization: 'Visualization',
  linear: 'Number sentences',
}
 
export const SKIP_REASONS: Record<SkippedPart['reason'], string> = {
  'not-ready': 'not ready yet',
  vetoed: "you said 'not yet'",
  'no-visual-skills': 'no visual skills yet',
}
 
/** e.g. "Number sentences skipped — not ready yet" */
export function describeSkippedPart(part: SkippedPart): string {
  return `${PART_NAMES[part.type]} skipped — ${SKIP_REASONS[part.reason]}`
}