Skip to content

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

Merged
kunwp1 merged 3 commits into
apache:mainfrom
kunwp1:fix/version-restore-red-bracket-highlight
Jun 5, 2026
Merged

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

Conversation

@kunwp1

@kunwp1 kunwp1 commented May 29, 2026

Copy link
Copy Markdown
Contributor

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

codecov-commenter commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.56%. Comparing base (8a4cb29) to head (9b7f052).

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     
Flag Coverage Δ *Carryforward flag
access-control-service 41.89% <ø> (ø) Carriedforward from 7deed35
agent-service 33.76% <ø> (ø) Carriedforward from 7deed35
amber 52.23% <ø> (ø) Carriedforward from 7deed35
computing-unit-managing-service 1.38% <ø> (ø) Carriedforward from 7deed35
config-service 54.68% <ø> (ø) Carriedforward from 7deed35
file-service 38.42% <ø> (ø) Carriedforward from 7deed35
frontend 46.21% <100.00%> (-0.12%) ⬇️
pyamber 90.69% <ø> (ø) Carriedforward from 7deed35
python 90.84% <ø> (ø) Carriedforward from 7deed35
workflow-compiling-service 58.39% <ø> (ø) Carriedforward from 7deed35

*This pull request uses carry forward flags. 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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunwp1

kunwp1 commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

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

@github-actions github-actions Bot requested a review from aglinxinyuan May 29, 2026 01:11
@xuang7 xuang7 added the release/v1.2 back porting to release/v1.2 label Jun 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with highlightOpVersionDiff()).
  • 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.

@kunwp1 kunwp1 enabled auto-merge June 5, 2026 23:04
@kunwp1 kunwp1 added this pull request to the merge queue Jun 5, 2026
Merged via the queue into apache:main with commit 4f73e95 Jun 5, 2026
24 checks passed
@kunwp1 kunwp1 deleted the fix/version-restore-red-bracket-highlight branch June 5, 2026 23:21
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Backport to release/v1.2 failed. See job log.

Yicong-Huang pushed a commit that referenced this pull request Jun 6, 2026
…#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)
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Backport to release/v1.2 succeeded as 5107c81. Run

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 release/v1.2 back porting to release/v1.2

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

5 participants