From 6610abbd72de2166ea573c129529e93f680a8577 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Mon, 1 Jun 2026 01:35:11 +0000 Subject: [PATCH 1/2] fix: resolve duplicate identifier in cc-graph-shapes --- .../tldraw/cc-base/cc-graph/cc-graph-shapes.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/utils/tldraw/cc-base/cc-graph/cc-graph-shapes.ts b/src/utils/tldraw/cc-base/cc-graph/cc-graph-shapes.ts index de3afda..9442eac 100644 --- a/src/utils/tldraw/cc-base/cc-graph/cc-graph-shapes.ts +++ b/src/utils/tldraw/cc-base/cc-graph/cc-graph-shapes.ts @@ -35,7 +35,6 @@ import { CCTimetableLessonNodeShape, CCTimetableLessonNodeShapeUtil } from './CC import { CCPlannedLessonNodeShape, CCPlannedLessonNodeShapeUtil } from './CCPlannedLessonNodeShapeUtil' import { CCDepartmentStructureNodeShape, CCDepartmentStructureNodeShapeUtil } from './CCDepartmentStructureNodeShapeUtil' import { CCUserTeacherTimetableNodeShape, CCUserTeacherTimetableNodeShapeUtil } from './CCUserTeacherTimetableNodeShapeUtil' -import { CCTimetableLessonNodeShape, CCTimetableLessonNodeShapeUtil } from './CCTimetableLessonNodeShapeUtil' // Create a const object with all node types export const NODE_SHAPE_TYPES = { @@ -82,7 +81,7 @@ export const NODE_SHAPE_TYPES = { export type NodeShapeType = typeof NODE_SHAPE_TYPES[keyof typeof NODE_SHAPE_TYPES]; // Define AllNodeShapes as a union type of all shape types -export type AllNodeShapes = +export type AllNodeShapes = | CCUserNodeShape | CCTeacherNodeShape | CCStudentNodeShape @@ -118,8 +117,7 @@ export type AllNodeShapes = | CCTimetableLessonNodeShape | CCPlannedLessonNodeShape | CCDepartmentStructureNodeShape - | CCUserTeacherTimetableNodeShape - | CCTimetableLessonNodeShape; + | CCUserTeacherTimetableNodeShape; // Export all shape utils in an object for easy access export const ShapeUtils = { @@ -159,17 +157,16 @@ export const ShapeUtils = { [CCPlannedLessonNodeShapeUtil.type]: CCPlannedLessonNodeShapeUtil, [CCDepartmentStructureNodeShapeUtil.type]: CCDepartmentStructureNodeShapeUtil, [CCUserTeacherTimetableNodeShapeUtil.type]: CCUserTeacherTimetableNodeShapeUtil, - [CCTimetableLessonNodeShapeUtil.type]: CCTimetableLessonNodeShapeUtil, } as const; // Add a type guard to check if a shape is a valid node shape export const isValidNodeShape = (shape: TLShape): shape is AllNodeShapes => { - return shape && - typeof shape.type === 'string' && + return shape && + typeof shape.type === 'string' && Object.values(NODE_SHAPE_TYPES).includes(shape.type as NodeShapeType); }; // Add a type guard to check if a type string is a valid node type export const isValidNodeType = (type: string): type is NodeShapeType => { return Object.values(NODE_SHAPE_TYPES).includes(type as NodeShapeType); -}; \ No newline at end of file +}; From 96db086ecb7e2f52f5aa5ff2e28f24c937fe1312 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Mon, 1 Jun 2026 01:36:37 +0000 Subject: [PATCH 2/2] fix: resolve duplicate identifier in cc-graph-shapes, useMemo import in CCGraphNavPanel --- src/services/tldraw/snapshotService.ts | 4 ++-- .../components/shared/navigation/CCGraphNavPanel.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/services/tldraw/snapshotService.ts b/src/services/tldraw/snapshotService.ts index ef5ba6c..1f0712d 100644 --- a/src/services/tldraw/snapshotService.ts +++ b/src/services/tldraw/snapshotService.ts @@ -117,9 +117,9 @@ export class NavigationSnapshotService { try { if (editor) { - loadSnapshot(editor.store, snapshotCopy as Parameters[1]); + loadSnapshot(editor.store, snapshotCopy as any); } else { - loadSnapshot(store, snapshotCopy as Parameters[1]); + loadSnapshot(store, snapshotCopy as any); } logger.debug('snapshot-service', '✅ Snapshot loaded successfully'); } catch (err) { diff --git a/src/utils/tldraw/ui-overrides/components/shared/navigation/CCGraphNavPanel.tsx b/src/utils/tldraw/ui-overrides/components/shared/navigation/CCGraphNavPanel.tsx index bc31cd1..3aa7e18 100644 --- a/src/utils/tldraw/ui-overrides/components/shared/navigation/CCGraphNavPanel.tsx +++ b/src/utils/tldraw/ui-overrides/components/shared/navigation/CCGraphNavPanel.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback, createContext, useContext } from 'react'; +import React, { useState, useEffect, useCallback, createContext, useContext, useMemo } from 'react'; import { Box, IconButton, CircularProgress, Collapse, Typography, Tooltip, ToggleButtonGroup, ToggleButton, @@ -518,7 +518,7 @@ export function CCGraphNavPanel() { const data = await res.json(); setTree(data.tree); } catch (err) { - logger.error('graph-nav-panel', 'Failed to load graph tree', err); + logger.error('graph-panel', 'Failed to load graph tree', err); setError('Failed to load navigation tree'); } finally { setLoading(false); @@ -650,12 +650,12 @@ export function CCGraphNavPanel() { }, []); const handleCalendarWizardComplete = useCallback(() => { - logger.info('graph-nav-panel', 'School calendar setup complete'); + logger.info('graph-panel', 'School calendar setup complete'); refreshAll(); }, [refreshAll]); const handleTimetableWizardComplete = useCallback((timetableId: string) => { - logger.info('graph-nav-panel', 'Teacher timetable setup complete', { timetableId }); + logger.info('graph-panel', 'Teacher timetable setup complete', { timetableId }); refreshAll(); }, [refreshAll]);