Skip to content

feat: ER diagram table-only view toggle and edge snap to table names#3

Merged
alswl merged 9 commits intomasterfrom
003-toggle-columns-table-names
Feb 10, 2026
Merged

feat: ER diagram table-only view toggle and edge snap to table names#3
alswl merged 9 commits intomasterfrom
003-toggle-columns-table-names

Conversation

@alswl
Copy link
Owner

@alswl alswl commented Feb 10, 2026

Summary

  • Add table names only view toggle in ER diagram toolbar; relationship edges are preserved and snap to table name nodes.
  • Optional localStorage persistence for view mode.

Changes

  • src/constants/viewMode.ts: ViewMode type and constants.
  • src/services/er/index.ts: parseDatabaseToER(database, { tableOnly }), parseTableToNode / parseRef support tableOnly (no list ports, edges without port for node anchor).
  • src/components/viewer/viewer.tsx: viewMode state, Switch, useEffect(database, viewMode), localStorage.
  • tests/e2e/er-diagram.spec.ts: E2E for toggle table-only → edges preserved → back to full view.
  • Lint: lint script, lint-staged in package.json, pre-commit uses --config package.json; English comments and UI labels.

Spec

  • specs/003-toggle-columns-table-names/ (spec, plan, research, data-model, contracts, quickstart, tasks).

Made with Cursor

alswl and others added 9 commits February 10, 2026 09:09
- 新增 ViewMode 常量与 parseDatabaseToER(database, { tableOnly })
- 仅表名时节点不渲染 list 端口,边 source/target 仅 cell 以吸附表名节点
- Viewer 增加「仅表名」Switch、viewMode 状态与 localStorage 记忆
- 新增 E2E 场景:切换仅表名 → 关系线保留 → 切回完整视图
- 规格与任务:specs/003-toggle-columns-table-names

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add lint script and lint-staged config in package.json
- Pre-commit uses --config package.json to avoid legacy linters config
- Remove .lintstagedrc (config moved to package.json)
- Fix ESLint no-unused-vars in src/nodes/er.ts
- Use English comments and tooltips in viewer and viewMode

Co-authored-by: Cursor <cursoragent@cursor.com>
- 将 .zoom-toolbar button 改为 .zoom-toolbar .ant-btn,避免点到 Switch 的 button
- 修复 should zoom in / zoom out / reset view 三个用例

Co-authored-by: Cursor <cursoragent@cursor.com>
- playwright.config: CI 下在 reporter 中加入 list,保留 html 以生成 playwright-report
- test.yml: 去掉 --reporter=list,改用 config;上传报告步骤加 continue-on-error

Co-authored-by: Cursor <cursoragent@cursor.com>
should display table names 在 CI 上因图未渲染完即断言导致 0 个 text

Co-authored-by: Cursor <cursoragent@cursor.com>
@alswl alswl merged commit 30cee56 into master Feb 10, 2026
5 checks passed
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