From 258b9ac1b4e9a64a145318e4c965b149986eea25 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Fri, 7 Nov 2025 22:09:16 -0600 Subject: [PATCH] fix(worksheets): update display options preview to use new problem-stack signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Display options preview failed with "unexpected argument" error. Root cause: Example route was calling problem-stack with old signature that had individual digit parameters (aT, aO, bT, bO), but the function was refactored to extract digits internally from full numbers. Solution: Updated to new signature: - Old: problem-stack(a, b, aT, aO, bT, bO, index, ...) - New: problem-stack(a, b, index, show-carries, show-answers, ...) Removed manual digit extraction and let the function handle it internally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../app/api/create/worksheets/addition/example/route.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/api/create/worksheets/addition/example/route.ts b/apps/web/src/app/api/create/worksheets/addition/example/route.ts index 6e9f7304..c52ca58d 100644 --- a/apps/web/src/app/api/create/worksheets/addition/example/route.ts +++ b/apps/web/src/app/api/create/worksheets/addition/example/route.ts @@ -76,17 +76,13 @@ function generateExampleTypst(config: ExampleRequest): string { ${generateTypstHelpers(cellSize)} -${generateProblemStackFunction(cellSize)} +${generateProblemStackFunction(cellSize, 3)} #let a = ${a} #let b = ${b} -#let aT = calc.floor(calc.rem(a, 100) / 10) -#let aO = calc.rem(a, 10) -#let bT = calc.floor(calc.rem(b, 100) / 10) -#let bO = calc.rem(b, 10) #align(center + horizon)[ - #problem-stack(a, b, aT, aO, bT, bO, if show-numbers { 0 } else { none }, show-carries, show-answers, show-colors, show-ten-frames, show-numbers) + #problem-stack(a, b, if show-numbers { 0 } else { none }, show-carries, show-answers, show-colors, show-ten-frames, show-numbers) ] ` }