Repository navigation
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 |
…apache#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 apache#3043 Fixes apache#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? Generated-by: Claude Code (Claude Opus 4.7)
…9706) ### What changes were proposed in this PR? Remove code that nothing uses, or that repeats what the code next to it already does, from the workflow version service, the versions list, the workspace menu, the dashboard list item, the computing-unit picker and the image build workflow (**+42/−165 lines**). There is no behavior change. - **Version history:** `WorkflowVersionService.displayWorkflowVersions` and its only caller, `MenuComponent.onClickGetAllVersions`, which no template has bound since apache#2500 removed the button's click handler. Their two spec cases go with them. - **Version differences:** `getWorkflowsDifference` loops over a configurable list of element types that has held only `operators` since apache#1503 added it, with an ID-field map that names a type the loop never visits. It now compares operators directly. - The bracket highlighting for links of deleted operators, written twice, becomes one helper. - The versions list's two expand loops, identical but for the value they set, become one. - The unused `Element` and `WorkflowContentKeys` aliases go, and the URL constant that only the spec imported becomes file-local. - **List item:** `ListItemComponent` only ever sets `editingDescription` to false, and its template has had no `#descriptionInput` since apache#4212 replaced the inline editor. The flag, its class binding and style, and the view query go. `CardItemComponent` keeps its own, live copy. - **Computing-unit picker:** three pieces go. - An unused `ShareAccessComponent` import; its dialog left this component in apache#4331. - A doubled `userPackages` assignment. - A `skippedMessages` list that nothing fills, with the block that would print it. - **Image builds:** the AMD64 and ARM64 jobs build inside Docker, so their JDK, sbt launcher and coursier cache setup and their `JAVA_OPTS`/`JVM_OPTS` go. The JOOQ job, which does run sbt, keeps its setup. | Event | PR / Commit | | --- | --- | | Introduced by | Version history: apache#1343 (2021-09-28); version differences: apache#1503 (2022-06-07), the second bracket block apache#5285 (2026-06-05), the versions list apache#1444 (2022-02-15); list item: apache#2819 (2024-09-07); picker: apache#3508 (2025-07-07) and apache#4902 (2026-05-12); image builds: apache#4055 (2025-11-21) | | Usage removed by | Version history: apache#2500 (2024-03-24) removed the button that called it. List item: apache#4212 (2026-02-18) replaced the inline description editor. Picker import: apache#4331 (2026-04-09) moved the share dialog out. Everything else: unused since introduction. | As of 2026-11-25: - The element-type list has held a single type for over 4 years. - The version-history handler has had no caller for over two and a half years. - The image jobs have set up a JDK they never use for a year. - The list item's edit state has been unreachable for 9 months, and the picker's import has been unused for over 7 months. - The skipped-message list has stayed empty for the 6 months since it was added. ### Any related issues, documentation, discussions? Closes apache#9705. ### How was this PR tested? Ran on this branch and on `main` at `fd0e2d5338` (Windows 11; Node 24 with Yarn 4.14.1): ```bash cd frontend npx ng test --watch=false --include='**/workflow-version.service.spec.ts' --include='**/menu.component.spec.ts' --include='**/versions-list.component.spec.ts' --include='**/list-item.component.spec.ts' --include='**/computing-unit-selection.component.spec.ts' npx tsc --noEmit -p src/tsconfig.app.json npx tsc --noEmit -p src/tsconfig.spec.json npx ngc -p src/tsconfig.app.json --noEmit yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src) yarn eslint $(git diff --name-only --relative origin/main -- src | grep -E '\.(ts|html)$') ``` - **Frontend:** the five specs run 478 tests on this branch and 480 on `main`, all passing. The two extra on `main` are the deleted methods' own cases; every other test keeps its name and outcome. Both typechecks, the AOT compile, prettier-eslint and ESLint pass. - **Workflow:** `build-and-push-images.yml` parses, both image jobs keep their Docker steps, and only the JOOQ job sets up a JDK. The image jobs themselves run only after merge. To re-check, both commands return no hits on this branch: ```bash git grep -nwE "displayWorkflowVersions|onClickGetAllVersions|skippedMessages|ELEMENT_TYPES_IN_WORKFLOW_DIFF_CALC|ID_FILED_FOR_ELEMENTS_CONFIG" -- frontend/src git grep -nw editingDescription -- frontend/src/app/dashboard/component/user/list-item/list-item.component.ts frontend/src/app/dashboard/component/user/list-item/list-item.component.html ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
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)