Stabilize phases 0–4: autosave, rename cascade, auto-commit, apply-to-warehouse#59
Merged
Merged
Conversation
…ply-to-warehouse)
Phase 0 — Foundation & consistency
- Canonicalize FK shape to {entity, field} in EntityNode + schemaAdapter
- YAML structural validation on PUT /api/files (422 on parse/shape errors)
- NodeErrorBoundary wraps diagram nodes so one bad field can't blank canvas
Phase 1 — Autosave + diagram sync
- 800ms debounced autosave in workspaceStore; save-on-blur from ColumnsView
- bumpModelGraphVersion on shape edits so cross-file edits repaint
Phase 2 — Import fidelity & warnings
- Import Results panel surfaces sync report, manifest-only banner, unknown-type counts
- modelToFlow attaches warnings to entities; EntityNode shows amber chip + tooltip
- importers emit partial relationships with status: unresolved (dashed grey edges)
Phase 3 — Rename cascade hardening
- applyRenameCascade walks FKs, relationships, and indexes via bulkRefactor
- matchesRenameSource path normalization (renamePaths helper + tests)
- POST /api/projects/:id/rename-cascade atomic rewrite with snapshot/rollback
Phase 4 — Auto-commit + apply-to-warehouse
- PATCH /api/projects/:id/config with one-level deep merge for autoCommit settings
- saveCurrentFile fires POST /api/git/commit (2s debounced) when autoCommit.enabled
- ApplyDdlDialog + Shell palette entry; ⌘⇧E export PNG shortcut
- DiagramToolbar promotes PNG/SVG export to primary row
Tests: 55 web-app + 59 api-server unit tests pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Lands the backend + frontend stabilization work from the DataLex roadmap (phases 0–4 of
plans/you-are-focusin-on-foamy-bachman.md). Every UI edit now persists within 1s, renames cascade atomically, auto-commit is opt-in, and forward-engineering to the warehouse is one click.Changes by phase
Phase 0 — Foundation
{entity, field}end-to-end (EntityNode.jsx,schemaAdapter.js)PUT /api/filesreturns 422 with{code, message, details}on parse/shape errors; non-YAML files skipNodeErrorBoundarywraps React-Flow nodes so a malformed entity renders a red chip without blanking the canvasPhase 1 — Autosave + diagram sync
activeFile.fullPath; flushes on Ctrl+S, tab switch, close, and input blurbumpModelGraphVersionfires on structural edits so cross-file changes repaint open diagramsShell.jsxmemo key onmodelGraphVersionPhase 2 — Import fidelity
ImportResultsPanelsurfaces the sync report (models imported,type: unknowncounts, unresolved relationships, manifest-only banner when warehouse creds missing)modelToFlow.jsattacheswarnings[]to entities;EntityNoderenders amber chip + tooltipimporters.pyemits partial relationships withstatus: "unresolved"instead of dropping silently — rendered as dashed grey edges, skipped by DDL generationPhase 3 — Rename cascade
applyRenameCascadecomposes withbulkRefactorwalkers to rewrite FKs, relationship endpoints, and indexesmatchesRenameSourcenormalizes paths (./foo,/foo,fooall compare equal) — unit tests inrenamePaths.test.jsPOST /api/projects/:id/rename-cascadeendpoint snapshots every rewrite target, applies serially, and rewinds on any write failure; returns{ touched, untouched }on partial failurePhase 4 — Auto-commit + apply
PATCH /api/projects/:id/configmergesprojectConfigpatches with a shallow+one-level-deep strategy so{ autoCommit: { enabled: true } }doesn't wipemessageTemplatesaveCurrentFilefiresPOST /api/git/commitwith a 2s debounce whenautoCommit.enabled— bursty autosaves produce one commitApplyDdlDialog+ Shell palette entry "Apply to warehouse…" wires to/api/forward/apply(existingDIRECT_APPLY_ENABLEDgate)⌘⇧E/Ctrl+Shift+Eshortcut exports diagram to PNG viahtml-to-image;DiagramToolbarpromotes export buttons to the primary rowTest plan
npm testinpackages/web-app— 55 passingnpm testinpackages/api-server— 59 passing (incl. 6 newput-files-validation.test.js)customers.model.yaml→ change a field type → reload → persistsgit logshows 1 commitFollow-ups
PR #2 (next) replaces the bundled jaffle-shop fixture with a clone-from-GitHub flow, adds Playwright E2E coverage, CI workflow, and rewrites the tutorial docs.
🤖 Generated with Claude Code