Skip to content

feat: [AI-0000] ERD overlay — getRelationships extension command + source-pointing#1905

Draft
ralphstodomingo wants to merge 3 commits intomasterfrom
feat/ai-0000-erd-overlay-wiring
Draft

feat: [AI-0000] ERD overlay — getRelationships extension command + source-pointing#1905
ralphstodomingo wants to merge 3 commits intomasterfrom
feat/ai-0000-erd-overlay-wiring

Conversation

@ralphstodomingo
Copy link
Copy Markdown
Contributor

Summary

Power-user side of the lineage ERD overlay feature (see companion PRs in altimate-dbt-integration and altimate-frontend).

  • Adds a getRelationships command to the lineage webview panel. The handler runs dbt-integration's RelationshipParser against the current project's testMetaMap and returns { refs: Ref[] }.
  • Registers getRelationships in the webview ApiHelper.get switch so the frontend's call round-trips through executeRequestInSync to the extension host.
  • Source-points the lineage UI to altimate-frontend during development (vite alias + tailwind content paths). Temporary — reverted before merge.
  • Points @altimateai/dbt-integration at the sibling parser worktree via file:../altimate-dbt-integration. Temporary — reverted once the parser is published.

No behavior change for projects without relationships data tests: handler returns an empty refs[], UI renders no overlay edges.

Companion PRs (must land together)

  • altimate-dbt-integration#62RelationshipParser + Ref types
  • [altimate-frontend#XXXX] — lineage canvas integration (link to be added)

Build / verify locally

cd worktrees/lineage-erd-overlay/vscode-dbt-power-user
npm install                                   # already done in the worktree
cd webview_panels && NODE_OPTIONS=--max-old-space-size=8192 npx vite build --minify false
NODE_OPTIONS=--max-old-space-size=8192 npx vite build --config vite.config.renderer.ts --emptyOutDir=false --minify false
cd .. && npx rsbuild build --mode development

Both bundles contain the ERD code:

webview_panels/dist/assets/main.js : 10 occurrences of createRefEdge/getRelationships/REF_EDGE_PREFIX
dist/extension.js                  : 6 occurrences of getRelationships/RelationshipParser

Test plan

  • F5 launch extension, open jaffle-shop-core, open lineage on the orders model → confirm the purple FK edge to customers appears, labeled customer_id → customer_id.
  • Open lineage on a model with no relationships tests → confirm no overlay edges render and no console errors.
  • Toggle through expansions — ref edges should reconcile after each layout.

Before marking ready

  • Revert file:../altimate-dbt-integration back to ^0.2.x once the parser is on npm.
  • Revert webview_panels/vite.config.ts + tailwind.config.ts source-pointing aliases once @altimateai/ui-components publishes a version containing the overlay.
  • Toolbar toggle for showRefs (currently hard-on).

…erlay dev

Temporary dev-loop setup for the ERD overlay feature (see `worktrees/lineage-erd-overlay/PLAN.md`):

- Vite aliases for `@altimateai/ui-components/lineage` and `@altimateai/lego` → altimate-frontend worktree sources, so UI changes in altimate-frontend show up in the power-user webview without a publish.
- Tailwind content paths extended to scan the altimate-frontend sources, so new `al-`-prefixed classes used in lineage/lego during this work get generated into the webview bundle.

Both reverted before this feature ships — final flow is one ui-components publish that includes the overlay, then a dep bump in this repo.
Wires the webview lineage canvas to dbt-integration's `RelationshipParser`
so the ERD overlay can render PK/FK edges.

- `newLineagePanel.ts`: new `getRelationships` handler that instantiates
  `RelationshipParser` against the current project's `testMetaMap` and
  returns `{ refs: Ref[] }`. Extends the existing `handleCommand` switch.
- `LineageView.tsx`: registers `getRelationships` in the `ApiHelper.get`
  command list so the webview's call round-trips through
  `executeRequestInSync` to the handler above.
- `package.json`: points `@altimateai/dbt-integration` at the sibling
  worktree via `file:../altimate-dbt-integration`. Temporary dev-loop
  setup — reverted before this feature ships, when the parser has been
  published as part of a dbt-integration release.

Phase 1 only: refs derive exclusively from dbt `relationships` data
tests. Contracts (Phase 2) and naming-convention inference (Phase 3) are
additive — the UI will pick them up automatically via the `source`
discriminator once the parser gains those methods.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1ca80fa-e3d9-4b9b-a56a-966a84dc211b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ai-0000-erd-overlay-wiring

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ggle

Mount point for the `RefsToggleButton` added in altimate-frontend. Placed
between `#export-container` and `#settings-container` so the toolbar
order reads Expand / Export / Relationships / Settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant