WS-2 items 4+5: draw structure on canvas + preserve N-deep tree on save
app-ci-deploy / test-build-deploy (push) Has been cancelled
app-ci-deploy / test-build-deploy (push) Has been cancelled
Round-trip fix (item 5): serializeCanvasShapes no longer re-derives the question tree from boundary pairs (which flattened 3-deep → 2-tier). The whole tree is now carried as 'part' shapes that hold parentId + isContainer + depth; save preserves the real parent_id chains (persisted parent wins; geometry is only a fallback for manually-drawn shapes). Boundary-pair synthesis is kept but attaches to a covering container box when one exists. New test locks a 3-deep Q→part→subpart round-trip. Draw structure (item 4): shapesFromTemplate now draws containers too (were skipped), each with nesting depth. examCanvasShapes renders container frames (transparent, depth-hued border), PRINTS MARKS on part/container boxes (◆N pill; were never drawn), and NAMES context figures (figure name as label + description tooltip + '→ Q' tether pill; was an anonymous purple box). Context name/description round-trip via exam_response_areas.meta. Threads new shape props through the tldraw util + setup page + types. Adds meta to ExamResponseArea + replace payload. tsc: no new errors; 7/7 model tests pass. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01GruxHXxfdp4kZCgAMVFgvV
This commit is contained in:
@@ -91,6 +91,10 @@ export interface ExamQuestion {
|
||||
spec_ref: string | null;
|
||||
bounds?: Record<string, number> | null;
|
||||
page?: number | null;
|
||||
/** Analyse contract v2 (migration 78): primary command verb for a leaf part. */
|
||||
command_word?: string | null;
|
||||
/** Analyse contract v2 (migration 78): stem prose for the outline view. */
|
||||
preamble?: Record<string, unknown> | null;
|
||||
source: ExamTemplateSource;
|
||||
confirmed: boolean;
|
||||
confidence: number | null;
|
||||
@@ -116,6 +120,8 @@ export interface ExamResponseArea {
|
||||
kind: ExamResponseAreaKind;
|
||||
response_form: string | null;
|
||||
context_type?: string | null;
|
||||
/** Rich recognition payload (migration 75): figure name/description, OMR box geometry, unit/quantity, table… */
|
||||
meta?: Record<string, unknown> | null;
|
||||
source: ExamTemplateSource;
|
||||
confirmed: boolean;
|
||||
confidence: number | null;
|
||||
@@ -197,6 +203,7 @@ export interface TemplateReplacePayload {
|
||||
kind: ExamResponseArea['kind'];
|
||||
response_form?: string | null;
|
||||
context_type?: string | null;
|
||||
meta?: Record<string, unknown> | null;
|
||||
source?: 'manual' | 'ai';
|
||||
confirmed?: boolean;
|
||||
confidence?: number | null;
|
||||
|
||||
Reference in New Issue
Block a user