Skip to content

Commit 3191135

Browse files
committed
get rid of vestige onBlocksChanged
1 parent 232c1c1 commit 3191135

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

src/App.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import * as React from 'react';
2222
import * as Antd from 'antd';
2323
import '@ant-design/v5-patch-for-react-19';
2424

25-
import * as Blockly from 'blockly/core';
2625
import { pythonGenerator } from 'blockly/python';
2726

2827
import Header from './reactComponents/Header';
@@ -240,12 +239,6 @@ const AppContent: React.FC<AppContentProps> = ({ project, setProject }): React.J
240239
}
241240
};
242241

243-
/** Handles Blockly workspace changes and triggers code regeneration. */
244-
const handleBlocksChanged = (_event: Blockly.Events.Abstract): void => {
245-
// This is now handled by individual TabContent components
246-
// Keep this stub for compatibility
247-
};
248-
249242
/** Handles toolbox settings modal confirmation. */
250243
const handleToolboxSettingsOk = async (updatedShownCategories: Set<string>): Promise<void> => {
251244
if (!storage) {
@@ -574,7 +567,6 @@ const AppContent: React.FC<AppContentProps> = ({ project, setProject }): React.J
574567
shownPythonToolboxCategories={shownPythonToolboxCategories}
575568
modulePathToContentText={modulePathToContentText}
576569
messageApi={messageApi}
577-
onBlocksChanged={handleBlocksChanged}
578570
/>
579571
</Antd.Layout>
580572
</Antd.Layout>

src/reactComponents/TabContent.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export interface TabContentProps {
4949
messageApi: MessageInstance;
5050
setAlertErrorMessage: (message: string) => void;
5151
isActive: boolean;
52-
onBlocksChanged: (event: Blockly.Events.Abstract) => void;
5352
}
5453

5554
/**
@@ -67,7 +66,6 @@ export const TabContent: React.FC<TabContentProps> = ({
6766
messageApi,
6867
setAlertErrorMessage,
6968
isActive,
70-
onBlocksChanged,
7169
}) => {
7270
const [blocklyComponent, setBlocklyComponent] = React.useState<BlocklyComponentType | null>(null);
7371
const [editorInstance, setEditorInstance] = React.useState<editor.Editor | null>(null);
@@ -101,9 +99,8 @@ export const TabContent: React.FC<TabContentProps> = ({
10199
if (blocklyComponent && event.workspaceId === blocklyComponent.getBlocklyWorkspace().id) {
102100
setTriggerPythonRegeneration(Date.now());
103101
// Also notify parent
104-
onBlocksChanged(event);
105102
}
106-
}, [blocklyComponent, onBlocksChanged]);
103+
}, [blocklyComponent]);
107104

108105
/** Called when BlocklyComponent is created. */
109106
const setupBlocklyComponent = React.useCallback((_modulePath: string, newBlocklyComponent: BlocklyComponentType) => {

src/reactComponents/Tabs.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import * as commonStorage from '../storage/common_storage';
2424
import * as storageModule from '../storage/module';
2525
import * as storageProject from '../storage/project';
2626
import * as I18Next from 'react-i18next';
27-
import * as Blockly from 'blockly';
2827
import { MessageInstance } from 'antd/es/message/interface';
2928
import {
3029
CloseOutlined,
@@ -60,7 +59,6 @@ export interface TabsProps {
6059
shownPythonToolboxCategories: Set<string>;
6160
modulePathToContentText: {[modulePath: string]: string};
6261
messageApi: MessageInstance;
63-
onBlocksChanged: (event: Blockly.Events.Abstract) => void;
6462
}
6563

6664
/** Default copy suffix for tab names. */
@@ -358,7 +356,6 @@ export function Component(props: TabsProps): React.JSX.Element {
358356
messageApi={props.messageApi}
359357
setAlertErrorMessage={props.setAlertErrorMessage}
360358
isActive={activeKey === tab.key}
361-
onBlocksChanged={props.onBlocksChanged}
362359
/>
363360
) : null,
364361
};

0 commit comments

Comments
 (0)