release(v2.1.0): entity relationship diagrams - #21
Merged
Merged
Conversation
Adds erd.html, a local-only entity relationship page backed by src/schema.ts (declared PK/unique/FK parsing across T-SQL, PostgreSQL, DB2, and SQLite), src/erd.ts (deterministic Mermaid erDiagram export), and tests/schema.ts fixtures wired into the golden suite. Includes the 8-table/4-view DB2 sample (examples/db2-erd-sample.sql) with standalone AUDIT_LOG and APP_SETTINGS tables.
Drag-to-pan scrolls the entity canvas without changing selection; selecting an entity highlights connected cards and FK lines, dims unrelated ones, labels the active relationships, and lists each declared FK (direction, column mapping, cardinality, constraint) with click-through navigation.
Pauses auto-draw above the shared large-input threshold, auto-compacts entity boxes above 150 entities, batches card DOM, precomputes FK adjacency and degrees for O(degree) selection, caches overlay geometry, and adds Find (highlight + Enter/Shift+Enter jump). Adds a 300-table bulk fixture; an 800-table/175 KB estate parses in ~90 ms with 0 diagnostics.
setPointerCapture on the canvas retargeted the compatibility click to the canvas, so entity cards never received clicks and the FK inspector never opened. Pan listeners now live on document without capture; the drag threshold is 6px and a real drag still suppresses its trailing click. Strengthens the selected/related outlines and adds touch-action handling.
Adds a shared splitter (pointer, keyboard, double-click reset) to the flowchart and ERD pages. ERD entity cards are now draggable to declutter crowded relationships; offsets survive re-renders, double-click resets one card, and Reset layout restores the grid. Canvas panning still works from empty space and drags never change selection.
Adds zoom out/in and Fit controls to the ERD canvas (whole estate, or the selected table and its declared neighbours), keeps the selection visible as an overlay ring at estate zoom, and hides line labels when zoomed out. Replaces the ambiguous cross-page link with an active-state Flowchart/ERD switcher in the header of both pages.
Version 2.1.0: ERD page with declared PK/unique/FK parsing across four dialects, Mermaid erDiagram export, estate navigation (pan, draggable tables, FK inspector, find, zoom/Fit), resizable pane divider, and page switcher. Includes the v2.1.0 release note and metrics snapshot, and fixes for hidden view cards, runaway Fit, and pointer-capture click retargeting.
The ERD overlay uses createElementNS with the W3C SVG namespace, which the external-URL grep treated as a network URL. The guard now allows exactly that identifier and still fails on any other URL.
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.
Summary
erd.html): DDL parsing for declared tables, views, columns, primary/unique/foreign keys, and composite-key grouping across T-SQL, PostgreSQL, DB2, and SQLite, with raw type fidelity and source spans.erDiagramexport with declared cardinality, optionality, and provenance comments. Declared constraints only; unresolved references stay explicit.docs/releases/v2.1.0.md, anddocs/metrics-v2.1.0.json.Test plan
npm run typecheck,npm run build,npm run test:file,npm run metricstests/index.html: 220/220 (v2.1.0 schema suite 22/22, Mermaid 7/7, 300-table bulk fixture)npm run package:smoke:procflow-v2.1.0.zipstructure and local-file startup passNotes