Skip to content

Commit 30cee56

Browse files
alswlcursoragent
andauthored
feat: ER diagram table-only view toggle and edge snap to table names (#3)
* feat: ER 图仅表名视图切换与关系线吸附 - 新增 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> * chore: enable lint in pre-commit, use English comments and UI labels - 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> * fix: ignore * fix(e2e): 工具栏测试使用 .ant-btn 排除仅表名 Switch,修复 CI 失败 - 将 .zoom-toolbar button 改为 .zoom-toolbar .ant-btn,避免点到 Switch 的 button - 修复 should zoom in / zoom out / reset view 三个用例 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): 保证 E2E 生成 playwright-report 并容错上传 - playwright.config: CI 下在 reporter 中加入 list,保留 html 以生成 playwright-report - test.yml: 去掉 --reporter=list,改用 config;上传报告步骤加 continue-on-error Co-authored-by: Cursor <cursoragent@cursor.com> * fix(e2e): 等待 svg text 出现后再断言表名,避免 CI 时序失败 should display table names 在 CI 上因图未渲染完即断言导致 0 个 text Co-authored-by: Cursor <cursoragent@cursor.com> * fix(e2e): 合并冲突,统一 should display table names 等待逻辑 Co-authored-by: Cursor <cursoragent@cursor.com> * chore: no spec --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3e54268 commit 30cee56

File tree

13 files changed

+7721
-2668
lines changed

13 files changed

+7721
-2668
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ jobs:
7272
run: npx playwright install --with-deps chromium
7373

7474
- name: Run E2E tests
75-
run: npm run test:e2e -- --project=chromium --reporter=list
75+
run: npm run test:e2e -- --project=chromium
7676

7777
- name: Upload test results
7878
if: always()
79+
continue-on-error: true
7980
uses: actions/upload-artifact@v4
8081
with:
8182
name: playwright-report

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ tests/e2e/**/*.mp4
3434
# Playwright 浏览器缓存
3535
.cache/ms-playwright/
3636
specs
37+
.cursor/

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx --no-install lint-staged --quiet
1+
npx --no-install lint-staged --config package.json --quiet

.lintstagedrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dev": "max dev",
88
"format": "prettier --cache --write .",
99
"postinstall": "max setup",
10+
"lint": "max lint",
1011
"prepare": "husky",
1112
"setup": "max setup",
1213
"start": "npm run dev",
@@ -17,6 +18,23 @@
1718
"test:e2e:ui": "playwright test --ui",
1819
"test:watch": "jest --watch"
1920
},
21+
"lint-staged": {
22+
"*.{md,json}": [
23+
"prettier --cache --write"
24+
],
25+
"*.{js,jsx}": [
26+
"max lint --fix --eslint-only",
27+
"prettier --cache --write"
28+
],
29+
"*.{css,less}": [
30+
"max lint --fix --stylelint-only",
31+
"prettier --cache --write"
32+
],
33+
"*.{ts,tsx}": [
34+
"max lint --fix --eslint-only",
35+
"prettier --cache --write"
36+
]
37+
},
2038
"dependencies": {
2139
"@ant-design/icons": "^5.0.1",
2240
"@ant-design/pro-components": "^2.4.4",

playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export default defineConfig({
1616
/* CI 环境禁用并行 */
1717
workers: process.env.CI ? 1 : undefined,
1818

19-
/* 测试报告配置 */
19+
/* 测试报告配置:CI 下加 list 便于日志,同时保留 html 以生成 playwright-report 供上传 */
2020
reporter: [
21+
...(process.env.CI ? [['list']] : []),
2122
['html', { outputFolder: 'playwright-report' }],
2223
['json', { outputFile: 'test-results/results.json' }],
2324
['junit', { outputFile: 'test-results/junit.xml' }],

0 commit comments

Comments
 (0)