liam icon indicating copy to clipboard operation
liam copied to clipboard

Feat/table name tooltip for only truncated text

Open khiroshi-win opened this issue 7 months ago β€’ 4 comments

Issue

  • resolve:

Why is this change needed?

What would you like reviewers to focus on?

Testing Verification

What was done

pr_agent:summary

Detailed Changes

pr_agent:walkthrough

Additional Notes

khiroshi-win avatar May 27 '25 06:05 khiroshi-win

πŸ¦‹ Changeset detected

Latest commit: 3be663661963def7bfc9221bcbe4ccd68464c5cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@liam-hq/erd-core Minor
@liam-hq/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar May 27 '25 06:05 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
liam-app βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 5, 2025 0:57am
liam-erd-sample βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 5, 2025 0:57am
liam-storybook βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jun 5, 2025 0:57am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Jun 5, 2025 0:57am

vercel[bot] avatar May 27 '25 06:05 vercel[bot]

Updates to Preview Branch (feat/table-name-tooltip-for-only-truncated-text) β†—οΈŽ

Deployments Status Updated
Database βœ… Thu, 05 Jun 2025 00:55:04 UTC
Services βœ… Thu, 05 Jun 2025 00:55:04 UTC
APIs βœ… Thu, 05 Jun 2025 00:55:04 UTC

Tasks are run on every commit but only new migration files are pushed. Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations βœ… Thu, 05 Jun 2025 00:55:05 UTC
Migrations βœ… Thu, 05 Jun 2025 00:55:05 UTC
Seeding ❌ Thu, 05 Jun 2025 00:55:05 UTC
Edge Functions ⏸️ Thu, 05 Jun 2025 00:54:49 UTC

❌ Branch Error β€’ Thu, 05 Jun 2025 00:55:06 UTC

failed to send batch: ERROR: duplicate key value violates unique constraint "users_email_partial_key" (SQLSTATE 23505)

View logs for this Workflow Run β†—οΈŽ. Learn more about Supabase for Git β†—οΈŽ.

supabase[bot] avatar May 27 '25 06:05 supabase[bot]

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: _e2e-tests (Mobile Safari)

Failed stage: Run e2e tests [❌]

Failed test name: top

Failure summary:

The action failed due to visual regression testing (VRT) failures in the Playwright tests running on
Mobile Safari. Specifically:

1. The "top" test in tests/vrt/vrt.test.ts (line 24) failed because the screenshot comparison showed
differences (1060 pixels different from expected).

2. Two other tests were marked as flaky:
- "Table node should be highlighted when clicked" test
in tests/e2e/page.test.ts (line 25) failed with timeout errors because it couldn't find the expected
element with attribute 'data-erd' set to 'table-node-highlighted'.
- "zoom in button should
increase zoom level" test in tests/e2e/toolbar.test.ts (line 47) failed because the zoom level
didn't increase as expected (received 100, expected less than 14).

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

218:  ENVIRONMENT: Preview – liam-app
219:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
220:  ##[endgroup]
221:  Scope: all 18 workspace projects
222:  Lockfile is up to date, resolution step is skipped
223:  Progress: resolved 1, reused 0, downloaded 0, added 0
224:  Packages: +2252
225:  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
226:  Progress: resolved 2252, reused 1022, downloaded 0, added 0
227:  Progress: resolved 2252, reused 2238, downloaded 0, added 247
228:  Progress: resolved 2252, reused 2238, downloaded 0, added 695
229:  Progress: resolved 2252, reused 2238, downloaded 0, added 1122
230:  Progress: resolved 2252, reused 2238, downloaded 0, added 1431
231:  Progress: resolved 2252, reused 2238, downloaded 0, added 2183
232:  Progress: resolved 2252, reused 2238, downloaded 0, added 2252, done
233:  WARN  Failed to create bin at /home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/.bin/liam. ENOENT: no such file or directory, open '/home/runner/work/liam/liam/frontend/packages/cli/dist-cli/bin/cli.js'
234:  devDependencies:
...

248:  β”‚   Ignored build scripts: @biomejs/biome, @bundled-es-modules/glob,           β”‚
249:  β”‚   @depot/cli, @prisma/client, @prisma/engines, @sentry/cli,                  β”‚
250:  β”‚   @tailwindcss/oxide, core-js-pure, esbuild, onnxruntime-node, protobufjs,   β”‚
251:  β”‚   sharp, style-dictionary.                                                   β”‚
252:  β”‚   Run "pnpm approve-builds" to pick which dependencies should be allowed     β”‚
253:  β”‚   to run scripts.                                                            β”‚
254:  β”‚                                                                              β”‚
255:  ╰──────────────────────────────────────────────────────────────────────────────╯
256:  frontend/apps/docs postinstall$ fumadocs-mdx
257:  frontend/packages/jobs postinstall$ cp ../db-structure/node_modules/@ruby/prism/src/prism.wasm prism.wasm
258:  frontend/packages/jobs postinstall: Done
259:  frontend/apps/docs postinstall: [MDX] types generated
260:  frontend/apps/docs postinstall: Done
261:  frontend/apps/app postinstall$ cp ../../packages/db-structure/node_modules/@ruby/prism/src/prism.wasm prism.wasm
262:  frontend/apps/app postinstall: Done
263:  WARN  Failed to create bin at /home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/.bin/liam. ENOENT: no such file or directory, open '/home/runner/work/liam/liam/frontend/apps/erd-sample/node_modules/@liam-hq/cli/dist-cli/bin/cli.js'
264:  Done in 8.9s using pnpm v10.10.0
...

266:  with:
267:  path: ~/.cache/ms-playwright
268:  key: playwright-Linux-4ee6e27ddbe2591ae52b132256c321851380c9f68db3ca6ca76475b7b256169a
269:  restore-keys: playwright-Linux-
270:  
271:  enableCrossOsArchive: false
272:  fail-on-cache-miss: false
273:  lookup-only: false
274:  save-always: false
275:  env:
276:  CI: true
277:  URL: https://liam-fds40ezeq-route-06-core.vercel.app
278:  ENVIRONMENT: Preview – liam-app
279:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
280:  ##[endgroup]
281:  [warning]Event Validation Error: The event type deployment_status is not supported because it's not tied to a branch or tag ref.
282:  ##[group]Run pnpm exec playwright install --with-deps
...

1536:  |β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β–         |  90% of 2.3 MiB
1537:  |β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– β– | 100% of 2.3 MiB
1538:  FFMPEG playwright build v1011 downloaded to /home/runner/.cache/ms-playwright/ffmpeg-1011
1539:  ##[group]Run pnpm exec playwright test --project="Mobile Safari"
1540:  [36;1mpnpm exec playwright test --project="Mobile Safari"[0m
1541:  shell: /usr/bin/bash -e {0}
1542:  env:
1543:  CI: true
1544:  URL: https://liam-fds40ezeq-route-06-core.vercel.app
1545:  ENVIRONMENT: Preview – liam-app
1546:  PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
1547:  ##[endgroup]
1548:  Running 17 tests using 1 worker
1549:  °°°·°×××××±···×±·°°°°°×××××F
1550:  1) [Mobile Safari] β€Ί tests/vrt/vrt.test.ts:24:5 β€Ί top ────────────────────────────────────────────
1551:  Error: [2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1552:  1060 pixels (ratio 0.01 of all image pixels) are different.
...

1580:  |                      ^
1581:  12 | }
1582:  13 |
1583:  14 | interface TargetPage {
1584:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1585:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1586:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1587:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1588:  ────────────────────────────────────────────────────────────────────────────────────────────────
1589:  attachment #2: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1590:  test-results/vrt-vrt-top-Mobile-Safari/top-1-actual.png
1591:  ────────────────────────────────────────────────────────────────────────────────────────────────
1592:  attachment #3: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1593:  test-results/vrt-vrt-top-Mobile-Safari/top-1-diff.png
1594:  ────────────────────────────────────────────────────────────────────────────────────────────────
1595:  Error Context: test-results/vrt-vrt-top-Mobile-Safari/error-context.md
1596:  Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
1597:  Error: [31mTimed out 5000ms waiting for [39m[2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1598:  Failed to take two consecutive stable screenshots.
1599:  Expected: [33m/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png[39m
...

1631:  14 | interface TargetPage {
1632:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1633:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1634:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1635:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1636:  ────────────────────────────────────────────────────────────────────────────────────────────────
1637:  attachment #2: top-1-previous.png (image/png) ──────────────────────────────────────────────────
1638:  test-results/vrt-vrt-top-Mobile-Safari-retry1/top-1-previous.png
1639:  ────────────────────────────────────────────────────────────────────────────────────────────────
1640:  attachment #3: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1641:  test-results/vrt-vrt-top-Mobile-Safari-retry1/top-1-actual.png
1642:  ────────────────────────────────────────────────────────────────────────────────────────────────
1643:  attachment #4: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1644:  test-results/vrt-vrt-top-Mobile-Safari-retry1/top-1-diff.png
1645:  ────────────────────────────────────────────────────────────────────────────────────────────────
1646:  Error Context: test-results/vrt-vrt-top-Mobile-Safari-retry1/error-context.md
1647:  attachment #6: trace (application/zip) ─────────────────────────────────────────────────────────
1648:  test-results/vrt-vrt-top-Mobile-Safari-retry1/trace.zip
1649:  Usage:
1650:  pnpm exec playwright show-trace test-results/vrt-vrt-top-Mobile-Safari-retry1/trace.zip
1651:  ────────────────────────────────────────────────────────────────────────────────────────────────
1652:  Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
1653:  Error: [31mTimed out 5000ms waiting for [39m[2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1654:  Failed to take two consecutive stable screenshots.
1655:  Expected: [33m/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png[39m
...

1687:  14 | interface TargetPage {
1688:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1689:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1690:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1691:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1692:  ────────────────────────────────────────────────────────────────────────────────────────────────
1693:  attachment #2: top-1-previous.png (image/png) ──────────────────────────────────────────────────
1694:  test-results/vrt-vrt-top-Mobile-Safari-retry2/top-1-previous.png
1695:  ────────────────────────────────────────────────────────────────────────────────────────────────
1696:  attachment #3: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1697:  test-results/vrt-vrt-top-Mobile-Safari-retry2/top-1-actual.png
1698:  ────────────────────────────────────────────────────────────────────────────────────────────────
1699:  attachment #4: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1700:  test-results/vrt-vrt-top-Mobile-Safari-retry2/top-1-diff.png
1701:  ────────────────────────────────────────────────────────────────────────────────────────────────
1702:  Error Context: test-results/vrt-vrt-top-Mobile-Safari-retry2/error-context.md
1703:  Retry #3 ───────────────────────────────────────────────────────────────────────────────────────
1704:  Error: [31mTimed out 5000ms waiting for [39m[2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1705:  Failed to take two consecutive stable screenshots.
1706:  Expected: [33m/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png[39m
...

1738:  14 | interface TargetPage {
1739:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1740:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1741:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1742:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1743:  ────────────────────────────────────────────────────────────────────────────────────────────────
1744:  attachment #2: top-1-previous.png (image/png) ──────────────────────────────────────────────────
1745:  test-results/vrt-vrt-top-Mobile-Safari-retry3/top-1-previous.png
1746:  ────────────────────────────────────────────────────────────────────────────────────────────────
1747:  attachment #3: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1748:  test-results/vrt-vrt-top-Mobile-Safari-retry3/top-1-actual.png
1749:  ────────────────────────────────────────────────────────────────────────────────────────────────
1750:  attachment #4: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1751:  test-results/vrt-vrt-top-Mobile-Safari-retry3/top-1-diff.png
1752:  ────────────────────────────────────────────────────────────────────────────────────────────────
1753:  Error Context: test-results/vrt-vrt-top-Mobile-Safari-retry3/error-context.md
1754:  Retry #4 ───────────────────────────────────────────────────────────────────────────────────────
1755:  Error: [31mTimed out 5000ms waiting for [39m[2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1756:  Failed to take two consecutive stable screenshots.
1757:  Expected: [33m/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png[39m
...

1789:  14 | interface TargetPage {
1790:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1791:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1792:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1793:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1794:  ────────────────────────────────────────────────────────────────────────────────────────────────
1795:  attachment #2: top-1-previous.png (image/png) ──────────────────────────────────────────────────
1796:  test-results/vrt-vrt-top-Mobile-Safari-retry4/top-1-previous.png
1797:  ────────────────────────────────────────────────────────────────────────────────────────────────
1798:  attachment #3: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1799:  test-results/vrt-vrt-top-Mobile-Safari-retry4/top-1-actual.png
1800:  ────────────────────────────────────────────────────────────────────────────────────────────────
1801:  attachment #4: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1802:  test-results/vrt-vrt-top-Mobile-Safari-retry4/top-1-diff.png
1803:  ────────────────────────────────────────────────────────────────────────────────────────────────
1804:  Error Context: test-results/vrt-vrt-top-Mobile-Safari-retry4/error-context.md
1805:  Retry #5 ───────────────────────────────────────────────────────────────────────────────────────
1806:  Error: [31mTimed out 5000ms waiting for [39m[2mexpect([22m[31mpage[39m[2m).[22mtoHaveScreenshot[2m([22m[32mexpected[39m[2m)[22m
1807:  Failed to take two consecutive stable screenshots.
1808:  Expected: [33m/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png[39m
...

1840:  14 | interface TargetPage {
1841:  at screenshot (/home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:11:22)
1842:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/vrt/vrt.test.ts:25:3
1843:  attachment #1: top-1-expected.png (image/png) ──────────────────────────────────────────────────
1844:  tests/vrt/vrt.test.ts-snapshots/top-1-Mobile-Safari-linux.png
1845:  ────────────────────────────────────────────────────────────────────────────────────────────────
1846:  attachment #2: top-1-previous.png (image/png) ──────────────────────────────────────────────────
1847:  test-results/vrt-vrt-top-Mobile-Safari-retry5/top-1-previous.png
1848:  ────────────────────────────────────────────────────────────────────────────────────────────────
1849:  attachment #3: top-1-actual.png (image/png) ────────────────────────────────────────────────────
1850:  test-results/vrt-vrt-top-Mobile-Safari-retry5/top-1-actual.png
1851:  ────────────────────────────────────────────────────────────────────────────────────────────────
1852:  attachment #4: top-1-diff.png (image/png) ──────────────────────────────────────────────────────
1853:  test-results/vrt-vrt-top-Mobile-Safari-retry5/top-1-diff.png
1854:  ────────────────────────────────────────────────────────────────────────────────────────────────
1855:  Error Context: test-results/vrt-vrt-top-Mobile-Safari-retry5/error-context.md
1856:  2) [Mobile Safari] β€Ί tests/e2e/page.test.ts:25:5 β€Ί Table node should be highlighted when clicked ─
1857:  [31mTest timeout of 10000ms exceeded.[39m
1858:  Error: [2mexpect([22m[31mlocator[39m[2m).[22mtoHaveAttribute[2m([22m[32mexpected[39m[2m)[22m
1859:  Locator: getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')
1860:  Expected string: [32m"table-node-highlighted"[39m
1861:  Received: <element(s) not found>
1862:  Call log:
1863:  [2m  - expect.toHaveAttribute with timeout 5000ms[22m
1864:  [2m  - waiting for getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')[22m
1865:  35 |   await expect(
1866:  36 |     tableNode.locator('div[class^="TableNode_wrapper"]'),
1867:  > 37 |   ).toHaveAttribute('data-erd', 'table-node-highlighted')
1868:  |     ^
1869:  38 | })
1870:  39 |
1871:  40 | test('Edge animation should be triggered when table node is clicked', async ({
1872:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/e2e/page.test.ts:37:5
1873:  Error Context: test-results/e2e-page-Table-node-should-be-highlighted-when-clicked-Mobile-Safari/error-context.md
1874:  Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
1875:  [31mTest timeout of 10000ms exceeded.[39m
1876:  attachment #1: trace (application/zip) ─────────────────────────────────────────────────────────
1877:  test-results/e2e-page-Table-node-should-be-highlighted-when-clicked-Mobile-Safari-retry1/trace.zip
1878:  Usage:
1879:  pnpm exec playwright show-trace test-results/e2e-page-Table-node-should-be-highlighted-when-clicked-Mobile-Safari-retry1/trace.zip
1880:  ────────────────────────────────────────────────────────────────────────────────────────────────
1881:  Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
1882:  [31mTest timeout of 10000ms exceeded.[39m
1883:  Error: [2mexpect([22m[31mlocator[39m[2m).[22mtoHaveAttribute[2m([22m[32mexpected[39m[2m)[22m
1884:  Locator: getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')
1885:  Expected string: [32m"table-node-highlighted"[39m
1886:  Received: <element(s) not found>
1887:  Call log:
1888:  [2m  - expect.toHaveAttribute with timeout 5000ms[22m
1889:  [2m  - waiting for getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')[22m
1890:  35 |   await expect(
1891:  36 |     tableNode.locator('div[class^="TableNode_wrapper"]'),
1892:  > 37 |   ).toHaveAttribute('data-erd', 'table-node-highlighted')
1893:  |     ^
1894:  38 | })
1895:  39 |
1896:  40 | test('Edge animation should be triggered when table node is clicked', async ({
1897:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/e2e/page.test.ts:37:5
1898:  Error Context: test-results/e2e-page-Table-node-should-be-highlighted-when-clicked-Mobile-Safari-retry2/error-context.md
1899:  Retry #3 ───────────────────────────────────────────────────────────────────────────────────────
1900:  [31mTest timeout of 10000ms exceeded.[39m
1901:  Retry #4 ───────────────────────────────────────────────────────────────────────────────────────
1902:  [31mTest timeout of 10000ms exceeded.[39m
1903:  Error: [2mexpect([22m[31mlocator[39m[2m).[22mtoHaveAttribute[2m([22m[32mexpected[39m[2m)[22m
1904:  Locator: getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')
1905:  Expected string: [32m"table-node-highlighted"[39m
1906:  Received: <element(s) not found>
1907:  Call log:
1908:  [2m  - expect.toHaveAttribute with timeout 5000ms[22m
1909:  [2m  - waiting for getByRole('button', { name: 'accounts table', exact: true }).locator('div[class^="TableNode_wrapper"]')[22m
1910:  35 |   await expect(
1911:  36 |     tableNode.locator('div[class^="TableNode_wrapper"]'),
1912:  > 37 |   ).toHaveAttribute('data-erd', 'table-node-highlighted')
1913:  |     ^
1914:  38 | })
1915:  39 |
1916:  40 | test('Edge animation should be triggered when table node is clicked', async ({
1917:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/e2e/page.test.ts:37:5
1918:  Error Context: test-results/e2e-page-Table-node-should-be-highlighted-when-clicked-Mobile-Safari-retry4/error-context.md
1919:  3) [Mobile Safari] β€Ί tests/e2e/toolbar.test.ts:47:5 β€Ί zoom in button should increase zoom level ──
1920:  Error: [2mexpect([22m[31mreceived[39m[2m).[22mtoBeLessThan[2m([22m[32mexpected[39m[2m)[22m
1921:  Expected: < [32m14[39m
1922:  Received:   [31m100[39m
1923:  57 |
1924:  58 |   const zoomLevelAfter = await zoomLevelText.textContent()
1925:  > 59 |   expect(Number.parseInt(zoomLevelBefore)).toBeLessThan(
1926:  |                                            ^
1927:  60 |     Number.parseInt(zoomLevelAfter),
1928:  61 |   )
1929:  62 | })
1930:  at /home/runner/work/liam/liam/frontend/packages/e2e/tests/e2e/toolbar.test.ts:59:44
1931:  Error Context: test-results/e2e-toolbar-zoom-in-button-should-increase-zoom-level-Mobile-Safari/error-context.md
1932:  1 failed
1933:  [Mobile Safari] β€Ί tests/vrt/vrt.test.ts:24:5 β€Ί top ─────────────────────────────────────────────
1934:  2 flaky
1935:  [Mobile Safari] β€Ί tests/e2e/page.test.ts:25:5 β€Ί Table node should be highlighted when clicked ──
1936:  [Mobile Safari] β€Ί tests/e2e/toolbar.test.ts:47:5 β€Ί zoom in button should increase zoom level ───
1937:  9 skipped
1938:  5 passed (3.3m)
1939:  ##[error]Process completed with exit code 1.
1940:  ##[group]Run actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 πŸ”΅πŸ”΅βšͺβšͺβšͺ
πŸ§ͺΒ No relevant tests
πŸ”’Β No security concerns identified
⚑ Recommended focus areas for review

Precision Issue

The magic number 0.017 added to the width comparison for truncation detection seems arbitrary. Consider documenting why this specific value was chosen or use a more explicit approach for determining truncation.

const isTruncated = textWidth > containerWidth + 0.017

Performance Concern

The DOM manipulation for measuring text width on every hover event could cause performance issues. Consider debouncing or throttling this operation, especially for tables with many elements.

const handleHoverEvent = (event: MouseEvent<HTMLSpanElement>) => {
  // Get computed styles to check if text is truncated
  const element = event.currentTarget
  // Create a range to measure the text
  const range = document.createRange()
  range.selectNodeContents(element)

  // Get the text width using getBoundingClientRect
  const textWidth = range.getBoundingClientRect().width
  const containerWidth = element.getBoundingClientRect().width
  const isTruncated = textWidth > containerWidth + 0.017

  updateNode(name, {
    data: {
      ...data,
      isTooltipVisible: isTruncated,
    },
  })
}

@MH4GF I have passed all CI testing. Please review this PR if you have a time.

khiroshi-win avatar Jun 03 '25 06:06 khiroshi-win

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestionΒ  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  Impact
General
Prevent unnecessary node updates

The handleHoverEvent function is called on every mouse enter event, causing
unnecessary node updates when the truncation status hasn't changed. Add a check
to only update the node when the tooltip visibility state actually changes.

frontend/packages/erd-core/src/features/erd/components/ERDContent/components/TableNode/TableHeader/TableHeader.tsx [27-45]

 const handleHoverEvent = (event: MouseEvent<HTMLSpanElement>) => {
   // Get computed styles to check if text is truncated
   const element = event.currentTarget
   // Create a range to measure the text
   const range = document.createRange()
   range.selectNodeContents(element)
 
   // Get the text width using getBoundingClientRect
   const textWidth = range.getBoundingClientRect().width
   const containerWidth = element.getBoundingClientRect().width
   const isTruncated = textWidth > containerWidth + 0.017
 
-  updateNode(name, {
-    data: {
-      ...data,
-      isTooltipVisible: isTruncated,
-    },
-  })
+  if (data.isTooltipVisible !== isTruncated) {
+    updateNode(name, {
+      data: {
+        ...data,
+        isTooltipVisible: isTruncated,
+      },
+    })
+  }
 }
  • [ ] Apply / Chat <!-- /improve --apply_suggestion=0 -->
Suggestion importance[1-10]: 6

__

Why: This is a valid performance optimization that prevents unnecessary updateNode calls when the tooltip visibility state hasn't actually changed. The suggestion correctly identifies that the current implementation will trigger updates on every mouse enter event, even when isTooltipVisible already matches the calculated isTruncated value.

Low
  • [ ] Update <!-- /improve_multi --more_suggestions=true -->

πŸ’­ It may be more efficient to calculate during rendering using useRef instead of calculating at hover. I'll try to write some sample code.

MH4GF avatar Jun 03 '25 06:06 MH4GF

πŸ’­ It may be more efficient to calculate during rendering using useRef instead of calculating at hover. I'll try to write some sample code.

Just moment. let me update to use the useRef hook function and will push again. at that time please check again and give me feedback. please don't waste your time. you have to do many things for another devs. really thank you.

khiroshi-win avatar Jun 03 '25 06:06 khiroshi-win

@khiroshi-win

Just moment. let me update to use the useRef hook function and will push again. at that time please check again and give me feedback. please don't waste your time. you have to do many things for another devs. really thank you.

Thank you, I'm very happy to hear thatπŸ˜„

On second thought, it doesn't look good, because although useRef can retrieve DOM information, the calculation using it requires the useEffect. And, I used react-scan to measure performance during hover, and there was no significant difference between the main branch and this branch.

Therefore, this implementation appeared to be fine πŸ‘πŸ»

MH4GF avatar Jun 03 '25 06:06 MH4GF

@MH4GF I don't know why Supabase Preview always fails on my PR. After merging it from the main branch, I can't get this CI test to pass.

khiroshi-win avatar Jun 05 '25 00:06 khiroshi-win