feat: add annotation handling and ER diagram layer functionality#52
Merged
Yashh56 merged 5 commits intoRelwave:developfrom Mar 13, 2026
Merged
feat: add annotation handling and ER diagram layer functionality#52Yashh56 merged 5 commits intoRelwave:developfrom
Yashh56 merged 5 commits intoRelwave:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds ER diagram annotation support using the tldraw library, allowing users to overlay freeform drawings on top of ER diagrams. Annotations are persisted per-project via a new backend API and JSON storage.
Changes:
- Added
AnnotationsFiletype, newproject.getAnnotations/project.saveAnnotationsJSON-RPC handlers, and storage logic inprojectStore.ts - Introduced
AnnotationLayercomponent (lazily loaded) usingtldrawwith debounced save and snapshot load on mount - Integrated annotation mode toggle button into
ERDiagramContent, disabling ReactFlow interactions while annotating and updating export to capture the full layer
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/project.ts |
Adds AnnotationsFile interface and extends ProjectExport with annotations field |
src/services/bridgeApi.ts |
Adds getProjectAnnotations and saveProjectAnnotations API methods |
src/components/er-diagram/AnnotationLayer.tsx |
New component: tldraw canvas overlay with load/save logic |
src/components/er-diagram/ERDiagramContent.tsx |
Adds annotation mode toggle, overlay rendering, ReactFlow disabling, export update |
bridge/src/services/projectStore.ts |
Adds AnnotationsFile type, get/save methods, and includes annotations in export |
bridge/src/handlers/projectHandlers.ts |
New handleGetAnnotations and handleSaveAnnotations handlers |
bridge/src/jsonRpcHandler.ts |
Registers the two new annotation RPC endpoints |
package.json / pnpm-lock.yaml |
Adds tldraw@^4.4.1 dependency (and its transitive deps) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…fier; add license key to AnnotationLayer component
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces ER diagram annotation support using the
tldrawlibrary, allowing users to overlay, save, and load freeform annotations on ER diagrams. The implementation includes backend storage, new API endpoints, and a frontend annotation mode with UI integration.Backend support for annotations:
AnnotationsFiletype and storage of annotation snapshots inbridge/src/services/projectStore.ts. Includes methods for saving and loading annotations, and updates project export structure to include annotations. [1] [2] [3] [4] [5]bridge/src/handlers/projectHandlers.tsand registered them inbridge/src/jsonRpcHandler.ts. [1] [2]Frontend integration and annotation mode:
AnnotationLayercomponent usingtldrawfor annotation overlay, with logic for loading/saving snapshots and debounced persistence via backend API.ERDiagramContent.tsx), including UI controls, overlay rendering, disabling diagram interactions while annotating, and updating export logic to include annotation layer. [1] [2] [3] [4] [5] [6] [7] [8] [9]API and type updates:
bridgeApi.tsand project types to support annotation file operations and project export including annotations. [1] [2] [3] [4]Dependency update:
tldrawlibrary topackage.jsonfor annotation functionality.