Skip to content

fix: clear red change-line brackets when restoring a workflow version#5285

Open
kunwp1 wants to merge 2 commits into
apache:mainfrom
kunwp1:fix/version-restore-red-bracket-highlight
Open

fix: clear red change-line brackets when restoring a workflow version#5285
kunwp1 wants to merge 2 commits into
apache:mainfrom
kunwp1:fix/version-restore-red-bracket-highlight

Conversation

@kunwp1
Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 commented May 29, 2026

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.
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)

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
@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels May 29, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.10%. Comparing base (85c4b0c) to head (f6ad88a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5285      +/-   ##
============================================
+ Coverage     49.09%   49.10%   +0.01%     
  Complexity     2372     2372              
============================================
  Files          1051     1051              
  Lines         40344    40349       +5     
  Branches       4277     4281       +4     
============================================
+ Hits          19805    19812       +7     
+ Misses        19379    19376       -3     
- Partials       1160     1161       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from a899bc8
agent-service 33.76% <ø> (ø) Carriedforward from a899bc8
amber 51.53% <ø> (ø) Carriedforward from a899bc8
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from a899bc8
config-service 0.00% <ø> (ø) Carriedforward from a899bc8
file-service 37.99% <ø> (ø) Carriedforward from a899bc8
frontend 41.09% <100.00%> (+0.02%) ⬆️
python 90.74% <ø> (ø) Carriedforward from a899bc8
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from a899bc8

*This pull request uses carry forward flags. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunwp1
Copy link
Copy Markdown
Contributor Author

kunwp1 commented May 29, 2026

/request-review @aglinxinyuan Can you review this PR?

@github-actions github-actions Bot requested a review from aglinxinyuan May 29, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Red Change Line Persists After Restoring a Previous Workflow Version Bug: Highlighting doesn't disappear after restoring an old version

2 participants