feat: ER diagram table-only view toggle and edge snap to table names#3
Merged
feat: ER diagram table-only view toggle and edge snap to table names#3
Conversation
- 新增 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>
Co-authored-by: Cursor <cursoragent@cursor.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
Changes
src/constants/viewMode.ts: ViewMode type and constants.src/services/er/index.ts:parseDatabaseToER(database, { tableOnly }),parseTableToNode/parseRefsupport 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.lintscript, 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