Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff view + fixes #189

Merged
merged 3 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/connect/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getNodeInputs = (node: NodeDefinition) => {
export const getInputName = (pinId: string) => {
switch (pinId) {
case TRIGGER_PIN_ID:
return "Trigger";
return "trigger";
default:
return pinId;
}
Expand All @@ -26,7 +26,7 @@ export const getInputName = (pinId: string) => {
export const getOutputName = (pinId: string) => {
switch (pinId) {
case ERROR_PIN_ID:
return "Error";
return "error";
default:
return pinId;
}
Expand Down
9 changes: 9 additions & 0 deletions flow-editor/src/flow-editor/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export type FlydeFlowEditorProps = {

initialPadding?: [number, number];
darkMode?: boolean;

comparisonNode?: VisualNode;
};

const maxUndoStackSize = 50;
Expand Down Expand Up @@ -230,6 +232,13 @@ export const FlowEditor: React.FC<FlydeFlowEditorProps> = React.memo(
};
}, [createAiCompletion]);

const [isDiffViewOpen, setIsDiffViewOpen] = React.useState(false);

// Add a button to toggle the diff view
const toggleDiffView = React.useCallback(() => {
setIsDiffViewOpen((prev) => !prev);
}, []);

const renderInner = () => {
return (
<DarkModeProvider value={props.darkMode ?? isDarkMode}>
Expand Down
2 changes: 2 additions & 0 deletions flow-editor/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export * from "./lib/safe-ls";
export * from "./physics";
export * from "./visual-node-editor/utils";
export * from "./lib/logger";

export * from "./visual-node-editor";
Loading