merge: R3 TypeScript fixes — cc-graph-shapes duplicates, CCGraphNavPanel, snapshotService, App.tsx simplification

This commit is contained in:
CC Worker 2026-06-01 02:37:21 +00:00
commit cbff4deef2
3 changed files with 11 additions and 14 deletions

View File

@ -117,9 +117,9 @@ export class NavigationSnapshotService {
try { try {
if (editor) { if (editor) {
loadSnapshot(editor.store, snapshotCopy as Parameters<typeof loadSnapshot>[1]); loadSnapshot(editor.store, snapshotCopy as any);
} else { } else {
loadSnapshot(store, snapshotCopy as Parameters<typeof loadSnapshot>[1]); loadSnapshot(store, snapshotCopy as any);
} }
logger.debug('snapshot-service', '✅ Snapshot loaded successfully'); logger.debug('snapshot-service', '✅ Snapshot loaded successfully');
} catch (err) { } catch (err) {

View File

@ -35,7 +35,6 @@ import { CCTimetableLessonNodeShape, CCTimetableLessonNodeShapeUtil } from './CC
import { CCPlannedLessonNodeShape, CCPlannedLessonNodeShapeUtil } from './CCPlannedLessonNodeShapeUtil' import { CCPlannedLessonNodeShape, CCPlannedLessonNodeShapeUtil } from './CCPlannedLessonNodeShapeUtil'
import { CCDepartmentStructureNodeShape, CCDepartmentStructureNodeShapeUtil } from './CCDepartmentStructureNodeShapeUtil' import { CCDepartmentStructureNodeShape, CCDepartmentStructureNodeShapeUtil } from './CCDepartmentStructureNodeShapeUtil'
import { CCUserTeacherTimetableNodeShape, CCUserTeacherTimetableNodeShapeUtil } from './CCUserTeacherTimetableNodeShapeUtil' import { CCUserTeacherTimetableNodeShape, CCUserTeacherTimetableNodeShapeUtil } from './CCUserTeacherTimetableNodeShapeUtil'
import { CCTimetableLessonNodeShape, CCTimetableLessonNodeShapeUtil } from './CCTimetableLessonNodeShapeUtil'
// Create a const object with all node types // Create a const object with all node types
export const NODE_SHAPE_TYPES = { export const NODE_SHAPE_TYPES = {
@ -118,8 +117,7 @@ export type AllNodeShapes =
| CCTimetableLessonNodeShape | CCTimetableLessonNodeShape
| CCPlannedLessonNodeShape | CCPlannedLessonNodeShape
| CCDepartmentStructureNodeShape | CCDepartmentStructureNodeShape
| CCUserTeacherTimetableNodeShape | CCUserTeacherTimetableNodeShape;
| CCTimetableLessonNodeShape;
// Export all shape utils in an object for easy access // Export all shape utils in an object for easy access
export const ShapeUtils = { export const ShapeUtils = {
@ -159,7 +157,6 @@ export const ShapeUtils = {
[CCPlannedLessonNodeShapeUtil.type]: CCPlannedLessonNodeShapeUtil, [CCPlannedLessonNodeShapeUtil.type]: CCPlannedLessonNodeShapeUtil,
[CCDepartmentStructureNodeShapeUtil.type]: CCDepartmentStructureNodeShapeUtil, [CCDepartmentStructureNodeShapeUtil.type]: CCDepartmentStructureNodeShapeUtil,
[CCUserTeacherTimetableNodeShapeUtil.type]: CCUserTeacherTimetableNodeShapeUtil, [CCUserTeacherTimetableNodeShapeUtil.type]: CCUserTeacherTimetableNodeShapeUtil,
[CCTimetableLessonNodeShapeUtil.type]: CCTimetableLessonNodeShapeUtil,
} as const; } as const;
// Add a type guard to check if a shape is a valid node shape // Add a type guard to check if a shape is a valid node shape

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect, useCallback, createContext, useContext } from 'react'; import React, { useState, useEffect, useCallback, createContext, useContext, useMemo } from 'react';
import { import {
Box, IconButton, CircularProgress, Collapse, Typography, Tooltip, Box, IconButton, CircularProgress, Collapse, Typography, Tooltip,
ToggleButtonGroup, ToggleButton, ToggleButtonGroup, ToggleButton,
@ -518,7 +518,7 @@ export function CCGraphNavPanel() {
const data = await res.json(); const data = await res.json();
setTree(data.tree); setTree(data.tree);
} catch (err) { } 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'); setError('Failed to load navigation tree');
} finally { } finally {
setLoading(false); setLoading(false);
@ -650,12 +650,12 @@ export function CCGraphNavPanel() {
}, []); }, []);
const handleCalendarWizardComplete = useCallback(() => { const handleCalendarWizardComplete = useCallback(() => {
logger.info('graph-nav-panel', 'School calendar setup complete'); logger.info('graph-panel', 'School calendar setup complete');
refreshAll(); refreshAll();
}, [refreshAll]); }, [refreshAll]);
const handleTimetableWizardComplete = useCallback((timetableId: string) => { 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();
}, [refreshAll]); }, [refreshAll]);