From 16ae3aa089fe7cd2ae0688b099105048a66bfed5 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Sun, 7 Jun 2026 01:03:08 +0000 Subject: [PATCH] =?UTF-8?q?fix(exam):=20setup=20toolbar=20crash=20?= =?UTF-8?q?=E2=80=94=20MUI=20Button=20color=20'default'=20is=20invalid=20i?= =?UTF-8?q?n=20v5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Select + Furniture tool buttons used color='default', which MUI v5 resolves to theme.palette.default (undefined) -> TypeError reading 'main'/'dark' at render, tripping the ErrorBoundary ('Template setup canvas crashed'). Use 'inherit'. Caught by live browser-verify t_11f5a049; model-level tests never rendered the toolbar. Co-Authored-By: Claude Opus 4.8 --- src/pages/exam/setup/ExamTemplateSetupPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/exam/setup/ExamTemplateSetupPage.tsx b/src/pages/exam/setup/ExamTemplateSetupPage.tsx index 21a11a6..07cc21c 100644 --- a/src/pages/exam/setup/ExamTemplateSetupPage.tsx +++ b/src/pages/exam/setup/ExamTemplateSetupPage.tsx @@ -17,7 +17,7 @@ import { ExamCanvasShapeModel, PAGE_HEIGHT, PAGE_WIDTH, isUuid, newDomainId, ser import { examCanvasShapeUtils, examCanvasTools, ExamCanvasTLShape, SHAPE_TYPES, shapeTypeToKind } from './examCanvasShapes' const TOOLS = [ - { id: 'select', label: 'Select', tip: 'Move, resize, or delete shapes.', color: 'default' as const }, + { id: 'select', label: 'Select', tip: 'Move, resize, or delete shapes.', color: 'inherit' as const }, { id: SHAPE_TYPES.boundary, label: 'Boundary', tip: 'Draw one horizontal line. A main question is saved from each top+bottom pair.', color: 'error' as const }, { id: SHAPE_TYPES.part, label: 'Part', tip: 'Draw the markable sub-question box inside a boundary pair.', color: 'warning' as const }, { id: SHAPE_TYPES.response, label: 'Response', tip: 'Draw around where the student writes; saved with response_form=lines.', color: 'primary' as const }, @@ -25,7 +25,7 @@ const TOOLS = [ { id: SHAPE_TYPES.question_number, label: 'Q Number', tip: 'Box the printed question number.', color: 'success' as const }, { id: SHAPE_TYPES.mark_area, label: 'Mark Area', tip: 'Box printed marks such as [2].', color: 'success' as const }, { id: SHAPE_TYPES.reference, label: 'Reference', tip: 'Box student resources/reference material.', color: 'info' as const }, - { id: SHAPE_TYPES.furniture, label: 'Furniture', tip: 'Mark margins/page numbers/ignored decoration.', color: 'default' as const }, + { id: SHAPE_TYPES.furniture, label: 'Furniture', tip: 'Mark margins/page numbers/ignored decoration.', color: 'inherit' as const }, ] function apiMessage(err: unknown): { message: string; conflict: boolean } {