Skip to content

fix: await DOM flush before rendering snapshot comparison#7398

Merged
andypalmi merged 2 commits into
mainfrom
fix/snapshot-flow-rendering-issue
Jun 9, 2026
Merged

fix: await DOM flush before rendering snapshot comparison#7398
andypalmi merged 2 commits into
mainfrom
fix/snapshot-flow-rendering-issue

Conversation

@andypalmi

@andypalmi andypalmi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Snapshot comparison rendering was broken: ports appeared at the top-left corner of nodes and wires were misaligned
  • Root cause: v-show="!loading" hides the container with display: none. After setting loading = false, Vue hasn't flushed the DOM update yet, so flowRenderer.compare() runs while the SVG is still inside a display: none ancestor — getBBox() returns zeros for all elements
  • Fix: await this.$nextTick() after loading = false to ensure the DOM is updated before rendering

Test plan

  • Open a snapshot comparison dialog with two snapshots that have differing nodes
  • Verify nodes render with correct port positions (input on left, output on right)
  • Verify wires connect between ports, not from node top-left corners

andypalmi added 2 commits June 9, 2026 14:07
Vue's v-show="!loading" hides the compare container with display:none.
After setting loading=false, the DOM update is queued but not yet
flushed, so flowRenderer.compare() runs while the SVG is still inside
a display:none ancestor — causing getBBox() to return zeros and
breaking port positions and wire coordinates.
@andypalmi

Copy link
Copy Markdown
Contributor Author

Before

Screenshot 2026-06-09 at 14 11 14

After

Screenshot 2026-06-09 at 14 10 40

@hardillb Finally found the culprit

@andypalmi andypalmi requested a review from hardillb June 9, 2026 12:12
@andypalmi andypalmi enabled auto-merge (squash) June 9, 2026 12:13
@andypalmi andypalmi moved this to Review in 🛠 Development Jun 9, 2026
@andypalmi andypalmi self-assigned this Jun 9, 2026
@andypalmi andypalmi added the area:frontend For any issues that require work in the frontend/UI label Jun 9, 2026
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.66%. Comparing base (d6d525f) to head (bec0f28).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7398   +/-   ##
=======================================
  Coverage   76.66%   76.66%           
=======================================
  Files         410      410           
  Lines       20874    20874           
  Branches     5066     5066           
=======================================
  Hits        16004    16004           
  Misses       4870     4870           
Flag Coverage Δ
backend 76.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypalmi andypalmi merged commit 2531045 into main Jun 9, 2026
36 of 38 checks passed
@andypalmi andypalmi deleted the fix/snapshot-flow-rendering-issue branch June 9, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend For any issues that require work in the frontend/UI

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

2 participants