fix: clear red change-line brackets when restoring a workflow version#5285
Conversation
highlightOpVersionDiff draws red brackets on the neighbors of deleted operators, but unhighlightOpVersionDiff only reset the boundary fills of added/modified operators and never the bracket strokes. On close the brackets vanished because reloadWorkflow rebuilds the paper, but revertToVersion does not reload, so the red change line persisted after restore. Reset the deleted-neighbor brackets to transparent so they are cleared on restore as well. Fixes apache#3043 Fixes apache#3828
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5285 +/- ##
============================================
- Coverage 51.62% 51.56% -0.06%
Complexity 2420 2420
============================================
Files 1056 1056
Lines 41046 41109 +63
Branches 4407 4431 +24
============================================
+ Hits 21190 21199 +9
- Misses 18617 18669 +52
- Partials 1239 1241 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/request-review @aglinxinyuan Can you review this PR? |
There was a problem hiding this comment.
Pull request overview
Fixes a UI state bug in the workflow version-restore flow where the red “change line” (bracket strokes around neighbors of deleted operators) could persist after restoring a version, because the unhighlight path only cleared boundary fills and not bracket strokes.
Changes:
- Extend
unhighlightOpVersionDiff()to also clear left/right bracket stroke highlights for neighbors of deleted operators (making it symmetric withhighlightOpVersionDiff()). - Add unit tests covering bracket clearing behavior and the “missing temp workflow” no-op path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/src/app/dashboard/service/user/workflow-version/workflow-version.service.ts | Clears deleted-neighbor bracket strokes (path.left/right-boundary/stroke) when unhighlighting a version diff. |
| frontend/src/app/dashboard/service/user/workflow-version/workflow-version.service.spec.ts | Adds unit tests verifying brackets are reset to transparent and that clearing is skipped safely when temp workflow is absent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Backport to |
…#5285) ### What changes were proposed in this PR? When restoring a previous workflow version that displays a **red change line** (the bracket highlight drawn around the neighbors of deleted operators), the red line stayed visible after the version was restored. Versions whose diff only contained green/orange operator highlights cleared correctly. Why it's a bug: `highlightOpVersionDiff()` applies three kinds of highlight when previewing a version: - orange boundary **fill** on modified operators - green boundary **fill** on added operators - **red bracket strokes** (`path.left-boundary/stroke` / `path.right-boundary/stroke`) on the neighbors of *deleted* operators `unhighlightOpVersionDiff()` only reset the boundary fills — it never reset the bracket strokes. `closeParticularVersionDisplay()` masked the issue because it calls `reloadWorkflow()`, which rebuilds the JointJS paper elements and incidentally wipes the leftover brackets. `revertToVersion()` does **not** reload the paper, so the orphaned red brackets persisted after restore. This PR makes `unhighlightOpVersionDiff()` symmetric with `highlightOpVersionDiff()`: it now also resets the deleted-operators' neighbor brackets back to the default transparent `rgba(0,0,0,0)`, so the red change line is cleared on restore. ### Any related issues, documentation, discussions? Fixes #3043 Fixes #3828 ### How was this PR tested? - Manually verified in the UI that the red change line clears after restoring a version. https://github.com/user-attachments/assets/6417c52c-4f6e-47eb-82d4-0ac95f55ac5f ### Was this PR authored or co-authored using generative AI tooling? (backported from commit 4f73e95) Generated-by: Claude Code (Claude Opus 4.7)
|
Backport to |
What changes were proposed in this PR?
When restoring a previous workflow version that displays a red change line (the bracket highlight drawn around the neighbors of deleted operators), the red line stayed visible after the version was restored. Versions whose diff only contained green/orange operator highlights cleared correctly.
Why it's a bug:
highlightOpVersionDiff()applies three kinds of highlight when previewing a version:path.left-boundary/stroke/path.right-boundary/stroke) on the neighbors of deleted operatorsunhighlightOpVersionDiff()only reset the boundary fills — it never reset the bracket strokes.closeParticularVersionDisplay()masked the issue because it callsreloadWorkflow(), which rebuilds the JointJS paper elements and incidentally wipes the leftover brackets.revertToVersion()does not reload the paper, so the orphaned red brackets persisted after restore.This PR makes
unhighlightOpVersionDiff()symmetric withhighlightOpVersionDiff(): it now also resets the deleted-operators' neighbor brackets back to the default transparentrgba(0,0,0,0), so the red change line is cleared on restore.Any related issues, documentation, discussions?
Fixes #3043
Fixes #3828
How was this PR tested?
Screen.Recording.2026-05-28.at.6.05.58.PM.mov
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)