You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a long-requested feature: bidirectional synchronization between the mind map and knowledge graph.
Key changes:
Shared State: A new Zustand store src/store/graph-sync-store.ts acts as an event bus between the two views.
Adapters: src/features/mindmap/sync-adapter.ts and src/features/graph/sync-adapter.ts translate internal library events (like addChild or nodeAdded) into shared GraphSyncEvents.
Synchronization Logic:
Both views subscribe to the store and consume events originating from the other view.
Infinite loops are prevented by source filtering and explicit label comparisons before applying updates.
Conflicts are handled via last-writer-wins, with warnings logged to the console.
UI: A SyncToggle component allows users to enable/disable synchronization on the fly.
Quality:
Unit tests for the store.
Integration tests for the bidirectional flow.
Memory leak prevention by properly cleaning up Graphology listeners.
…d store
Implemented bidirectional synchronization between Mind Map (mind-elixir) and Knowledge Graph (graphology) features.
- Created `GraphSyncStore` Zustand slice to manage sync state and event queue.
- Implemented sync adapters for both Mind Map and Graph to map library-specific operations to shared events.
- Integrated sync logic into `MindMapView` and `GraphView` with loop prevention and last-writer-wins conflict resolution.
- Added `SyncToggle` UI component to both feature toolbars.
- Fixed potential listener leaks and update loops in GraphView.
- Added unit and integration tests for sync logic.
Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.
When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.
I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!
For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!
We reviewed changes in 1d652e1...d2882c7 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type
The any type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown or never type variable.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected empty arrow function
Having empty functions hurts readability, and is considered a code-smell. There's almost always a way to avoid using them. If you must use one, consider adding a comment to inform the reader of its purpose.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type
The any type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown or never type variable.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type
The any type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown or never type variable.
The reason will be displayed to describe this comment to others. Learn more.
Function has a cyclomatic complexity of 8 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable
It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.
The reason will be displayed to describe this comment to others. Learn more.
Function has a cyclomatic complexity of 7 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected any. Specify a different type
The any type can sometimes leak into your codebase. TypeScript compiler skips the type checking of the any typed variables, so it creates a potential safety hole, and source of bugs in your codebase. We recommend using unknown or never type variable.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a long-requested feature: bidirectional synchronization between the mind map and knowledge graph.
Key changes:
src/store/graph-sync-store.tsacts as an event bus between the two views.src/features/mindmap/sync-adapter.tsandsrc/features/graph/sync-adapter.tstranslate internal library events (likeaddChildornodeAdded) into sharedGraphSyncEvents.sourcefiltering and explicit label comparisons before applying updates.SyncTogglecomponent allows users to enable/disable synchronization on the fly.Fixes #286
PR created automatically by Jules for task 5123436395854815461 started by @d-oit